Element.SetName not functioning

This thread didn’t come up when search but I’m also having problems with weird Element.SetName behavior. I’ll follow here too now.

Did you test the contents of the custom node (double click on it, select all the nodes except the inputs and outputs in the custom node, copy, switch back to the dyn file, paste, wire in accordingly)?

I’m in a project environment.
And I did test the custom node but It still doesn’t work…

This seems to be happening to many people, but is it still unclear whether it is a version issue or a program problem?

What is the error message?


This message appeared, but nothing is connected to this custom node…
An error message appears, but this error message appears because there is no input…

You need to wire inputs into the python node. Reduce them to a single item not a list first, then attempt the list as it may be due to how the list elements are being processed across the model. Also ensure you’re using the most recent version of the package.

No errors but Still doesn’t work.
Clockwork 2.1.2 and Dynamo 2.0.2, Revit 2018.
Hmm…

What is the element you’re trying to rename? I can’t make this fail in the way which you’re seeing… Design option or worksharing issue maybe? Perhaps it’s actually working and you’re just not seeing it? Can you upload the relevant content to reproduce this?

190422 직선으로_AdaptiveComponenet test 이름바꾸는 것 실패.dyn (109.2 KB)
DDDD.rfa (388 KB)
Civil Report_안성방향 V0.0.11 - z0 직선.xlsx (142.1 KB)

Thanks, Jacob.
I uploaded my files.
and, plus,
Do you have any suggestions for this topic?:smiley:

You can’t do what you’re after, but not just because of a few missing nodes (edited to clarify that the clockwork node is working as intended).

Each family type can only have one name. You’re trying to set family DDDD to be A11111, A44444, and A55555. It can only have one value (usually the last one given but I haven’t tested the setup to verify).

Instead I think you might want to consider using the mark value, and simply using an Element.SetParameterValueByName node to set the mark to be A11111, A22222, or whatever else you may want. Otherwise you’ll have to not only rename items, but duplicate the family types as well. If you really do want a new type (and name) for each placed section of tunnel then use the Element.Types.Duplicate node in the archilab package. That doesn’t really feel like a good idea though as the type values would otherwise stay consistent.

To make the Element.SetName work, you have to be sure that you’re feeding an object with a name - that is a family, family type, or other higher level object. Instances of a family type do not have a name so there is nothing to set.

You can get a better understanding of how to troubleshoot this on your own by wiring an Object.Type node in after your Adaptivecomponent.ByPoints node. Note that the returned object type is Revit.Elements.AdaptiveComponent element. This is the easiest way to troubleshoot and verify data types.

To resolve this specific instance you’ll need to use a Element.GetParameterValueByName node to retrieve the “Type”, followed by the Element.SetName node to set the value as you were before. In the sample you provided the result will be this (as family types cannot have more than one name):image

Hi all
I know this is an old tread, But just wondering if this node has been Fixed. I am using Clockwork Version 2.3.0 and tried to use this node to change the family names. The node returns no errors but does not change the name. When I hover over the node it says “Get the name of a given revit element”. But the node itself is Element.SetName. Am I missing something or has the node being not fixed yet?

At the first Screenshot, try to Use levels for elements and names! It was my solution for same issue.

I’m not the most experienced Dynamo user, but I try. Trying to rename selected families (adding a prefix) and it’s not working. Can someone tell me if I am missing something in my script, or is the Element.SetName node not working for me? I already tried different nodes and orders, as well as the Python code provided above, and nada. Thanks!