Thought I almost had this one but when I run this script, the door numbers don’t match their room numbers at all. This script is meant to match door numbers to room numbers and add a suffix to any duplicate values. Can’t figure out where I messed up. Please help someone.
What is the error message on both yellow nodes? Can you also show us a watch node for the set parameter value node please.
Element.GetParameterValueByName - Warning: Internal error, please report: Dereferencing a non-pointer.
Element.SetParameterByName - Warning: Element.SetParameterByName operation failed.
The call is ambiguous between the following methods or properties: ‘Revit.Elements.InternalUtilities.ElementUtils.SetParameterValue(Autodesk.Revit.DB.Parameter, Revit.Elements.Element)’ and ‘Revit.Elements.InternalUtilities.ElementUtils.SetParameterValue(Autodesk.Revit.DB.Parameter, string)’
I’d try replacing the null room values with “000”
Looks like there are nulls or empty values coming out of the custom nodes you’re using, which will give you warnings when using the set/get parameter value nodes.
Use the list clean node before the set/get parameter value node, that should get rid of the warnings at least.
If you have doors that open onto a non-enclosed space, like the exterior or an unlabeled room, it causes a problem. Instead of returning ‘null’ values it return NO value. meaning that your list of “ToRooms” or “FromRooms” won’t line up correctly. That is why your room numbers aren’t matching. Try creating dummy rooms round the exits and filling any space that has a door with a fill room. This won’t fix everything, but its a step in the right direction.
To see if this is the problem look at the count of door elements and the count of ToRooms & FromRooms. if they aren’t equal, you have unenclosed doors.
Now, if anyone wants to spell out how to write that suffix adding code, I’d be forever grateful.
Have a look here:
Thanks, like the idiot that I am, I didn’t think the “in” part of the Code Block node would auto generate. “Just copy what shows up in the code block and it will magically create in ports and an out port”. Worked like a charm, now I just need to reorder them to match my element id order. But that’s for another topic.