I’ve created a Dynamo script that generates an ordering code for duct fittings by combining a few parameters into a single parameter value. I currently have it working as intended, but I’m looking for advice on how to optimize and/or streamline the graph so it’s cleaner and easier to maintain for future Revit updates. I will also be adding a lot more Duct Fittings so the more smoothly it runs the better.
Any help would be greatly appreciated. In particular, I’d love to improve the following areas:
Removing decimals more efficiently – at the moment I’m using Math.Round along with several other nodes, and I’m wondering if there’s a cleaner or more robust approach.
Reducing duplicated parameter nodes – I currently have two Element.GetParameterValueByName nodes. Ideally, I’d like to use just one. When I tried using a single node, it only returned one of the two parameter values I needed, so I’m not sure what the best approach is here.
Thanks in advance for any suggestions or guidance.
When going from a single input structure to a list of input structures, you should just need to manage the list levels. For a single list of elements, all of which you want to pull multiple parameter values for, you should just need to set the list level of either input to @1. Using element @1 will prioritize the element and give you values by element (sets of two). Using parameterName @1 will prioritize the parameters and give you values by parameter (sets of however many elements you have). You can use this to control your list structure for downstream nodes if necessary.
Your search terms are double wrapped so you have a list of a list instead of just a list of terms. This is adding an extra dimension to your list structure and probably why things aren’t aligning elsewhere.