Element.SetName not functioning

Newbie here again, has anyone encounter the problem that Element.SetName from clockwork is not functioning properly?
I’ve checked other posts and it seems to me that simple scripts like image 1 should work but actually aren’t.
i’m trying to sort beam families by their size, as shown in image 2, then rename the type name based on my on code, but it just never changes the type name, what am i doing wrong here?
On an urgent project, any help will be really appreciated.

Hey, whats the error saying in screenshot one? Might be worth updating clockwork I had a similar problem fixed by updating a package.

Can you share the Python.
If you are using it to concatonate 4 values, there’s also no need for a Python node but a simple Design Script will do

Nothing special in python node actually, i used a datashape node to allow user decide the code prefix and if they want the renamed code to include size (e.g a1 or a1 300*500), so ( boolean, code, sequence, size text) is taken as input. Just to make the dynamo script cleaner.

i’ve updated clockwork to the latest version 2.1.1, and i’m using dynamo 2.0.1 and revit 2018.
It doesn’t show error now, but still type name has not be changed

1 Like

Weird, tried to do some googling and it looks like a pretty vague node and people are using it to rename a bunch of things.

ikr, what i’m trying to do is quite alike to what you shared,i used it to rename family types and has worked properly by far, but it started to malfunction recently and the dynamo script which i used quite often can’t be manipulated, thus i’m panicking.

Ermm, could you attach the script. Il try running it

Here it is, thank you for your time and help.

BeamCode.dyn (166.0 KB)

Same issue :frowning:

tried working changing family name instead and no luck. Il try and get a guro over; maybe @jacob.small has any ideas

1 Like

thank you for your help,really appreciated.
By the way, perhaps it’s just a temporarily issue, or even i’m the one who messed up,but few clockwork nodes seems to work improperly in my other scripts, maybe it’s a version issue or there’s some change in the revit api?

@brian3814 - can you confirm which version of the Clockwork package you’re using, as well as provide a list of all packages in use?

Building this from scratch in 2019 with Dynamo 2.1 (on a daily build today to test some other stuff) and it worked fine for me:

As did this:

Same results in Revit 2016 with Dynamo 1.3.2.

Sorry folks, there is indeed a very strange bug at work here.
A classic case of what we call “Verschlimmbessern” in German (https://en.wiktionary.org/wiki/verschlimmbessern).
I’ll create a bug fix release of Clockwork over the weekend.
In the meantime, you can replace the SetElementName() function in the Python node with this (more forgiving) version:

def SetElementName(item, name):
	if item.GetType().ToString() == "Autodesk.Revit.DB.FamilyParameter":
		try: 
			doc.FamilyManager.RenameParameter(item, name)
			return True
		except: return False
	else:
		try: 
			item.Name = name
			return True
		except: return False
5 Likes

@Andreas_Dieckmann wow, to make something worse in an honest but failed attempt to improve it … this describes a typical day for me :stuck_out_tongue:

1 Like

thank you for your time, really appreciated, the clockwork version is 2.1.1, and i’m using dynamo 2.0.1 in revit 2018.
Packages i’m using includes datashape, clockwork, Rhythm, archi-lab.net, lunchbox, i think that’s all, while a few packages are installed but not used.

1 Like

wow~ never thought my post can have andydandy involved, this makes my day haha
thank you for you help and making dynamo that much interesting with clockwork

2 Likes

Have you figured out this issue?
maybe I have same trouble…

No errors, No results.

I’m using Revit2108, Dynamo 2.0.2, and 2.1.2 Clockwork.

Hi Jacob,
I am using Revit 2018, Dynamo 2.0.2, Clockwork 2.1.2

and my results are same as brian3814

If it’s not a version issue, is there a problem with my graph?

Structural Frame, Change Names of families2.dyn (101.7 KB)

Test the contents of the node to see if that fails. Also you’re in a project environment, right?