Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 4125

Runtime error (ArgumentTypeException): expected Brep, got Guid

$
0
0
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

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4125