Python Help: AttributeError: 'NoneType' object has no attribute 'Name'

I’m finally getting back to my efforts from this thread: and am having an issue with the last piece of Python to write the names back to the objects.

When I run the graph I’m getting an error: AttributeError: ‘NoneType’ object has no attribute ‘Name’ in line 40. I retyped it from the image in the original post and skimped on some of the comments :flushed: but as far as I could tell the code itself is the same. Has there been a backend change that would affect the i.Name section of the code or did I just do something wrong? Any advice on a fix is most appreciated.

Images of the error & the Dynamo graph attached.

Thanks :beers:

ExportFillPatterns.dyn (19.3 KB)

Hello! What is the output of Id to Element? Maybe it’s a list of nulls.

:persevere: The output of Id to Element is a list of nulls… Let me try it a little differently and see what happens.

Thanks :slight_smile:

edit: slight revision to the Id to Element node (added the python back in to convert to integers) fixed the null error but it created another error:

Traceback (most recent call last):
  File "<string>", line 40, in <module>
Exception: Name must be unique.
Parameter name: name

There are duplicate names in the fill pattern list but that is because there are Model patterns & Drafting patterns. In that case would I need to split the list and run it twice?

Hi Chad,
Which Revit and Dynamo version your using?

2017 (no SP1 installed yet)

I just looked and the renaming worked, at least as far as I can tell. There were 2 model patterns with a similar name other than capitalization: Louver & LOUVER - they could have been the culprit as well.

@Chad_Clary Sorry for calling you in a very old post, but by chance do you remember how did you solve this one? I’m kind of having the same problem over here: Modifing light parameters for Lighting Fixtures

I honestly have no idea…
If it helps at all, I’m including a graph that I’m pretty sure gets the end result I was looking for in the original post.

Manage-FillPatterns-Rename-DeleteByFilter.dyn (34.2 KB)

1 Like

Thanks a lot, Chad! In the end, I found out that the problem (at least for me) was that I was calling a parameter that has its value defined by another parameter :sweat_smile:

1 Like