Watch node is showing null


I want to renumber my rebars in drawing by 3 parameters (“Bar Diameter” , “Bar Length” and finally ‘‘Shape’’). I am stuck on the parameter ‘‘Shape’’ with this warning. Can someone help me out ?
This is the code in the Pythone script :
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *

The inputs to this node will be stored as a list in the IN variables.

dataEnteringNode = IN

allRebars = IN[0]
partition = IN[1]

rebars =

for rebar in allRebars:
if rebar.GetParameterValueByName(“Partition”) == partition:
rebars.append(rebar)

Assign your output to the OUT variable.

OUT = rebars

Get the name of the element type and pass that into the SortByKey node instead of the element type itself.

Elements are not a valid thing to sort by as you can’t directly compare them to each other and know which is ‘greater’ in a consistent way from project to project.

1 Like


Is this the right way ?

Nope. From your previous graph, after the Element.GetParameterValueByName node use an Element.Name node before the List.SortByKey node.

2 Likes

Thank you very much