Runtime error (ArgumentTypeException): expected Brep, got Guid

import Rhino.Geometry as rg

# Define material resistivity (in ohm-meters)
resistivity = 1.68e-8 

# Define input geometry parameter
brep = x

# Calculate cross-sectional area of Brep
area = rg.AreaMassProperties.Compute(brep, True, False, False, False).Area

# Calculate length of Brep
edges = brep.DuplicateEdgeCurves(True)
length = sum(edge.GetLength() for edge in edges)

# Calculate resistance
resistance = (resistivity * length) / area

# Output resistance
a = resistance


this code should be able to get a brep, and calculate its resistance, but everything that I try out, I have problems with the brep

Maybe you need to set the type hint on the x input to ‘Brep’.

I am tagging this with Grasshopper, as this is obviously a script running in GH.

I don’t get what you mean by “type hint”?

Right-click on the x input and from the drop down menu, find Type Hint and from the submenu choose Brep.

1 Like