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