Renaming Views - Strange List Behavior


I have two scripts that are built very similarly. One works fine and the other does not. I am trying to figure out what has gone wrong with the second one but I am having zero luck.

The first script looks for views with a TXXX and replaced them with a proper project number.

The second script is taking views that are not on a sheet and attempts to rename them with a “NOS_” prefix. This script is throwing a “The name entered is already in use. Enter a unique name.” warning but there are no duplicate names. It seems to be taking the first value from the list and trying to apply it to each view (hence the warning). The first script replaced multiple view names but works just fine.

Any ideas?

Working Script

RenameCBSViewsToProjectNumber.dyn (32.8 KB)

Broken Script
RenameDetailsWithSheetAndNumber2.dyn (23.8 KB)

Considering the second “halfs” of your graphs (you should call them “graphs” instead of scripts, otherwise you’ll annoy some people on this forum :wink:) look the same, what data are you sending in both the Element.GetParameterValueByName nodes?

1 Like


Hah, yeah. I am still getting the verbiage down. Thanks for the advice. :wink:

Here is what is being fed into each Element.GetParameterValueByName:

Looking at the list structure, could the fact that the list in the second graph has 3 levels be the issue?

That might be the case, it’d be nice if a simple flatten node could fix this.