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

Parameter needs GUID or string representing a GUID

$
0
0

Hello all!
This is a dumb question - first time poster, I’m a beginner in python and gh-python, so apologies! There is a lot of refactoring to be made in this code, but for now I just want it to work :slight_smile:

I’ve looked at several topics with the same question but I can not quite figure it out. I think this is a problem that boils down to the differences of using methods/functions from rhino.geometry and rhinoscriptsyntax-

I am trying to create breps from rectangles created on perp frames (earlier in code, not included as I dont think it matters - works fine).

To extrude the rectangles I use rs.extrudeCurve with SDL-lines as guides. These SDL-lines are generated from the “rg.line” method. I think the issue is trying to use lines from rg.lines in rs.ExtrudeCurve because the rg.lines aren’t added to the document/rhino and as such don’t have GUIDs?

How do I fix this issue?
Many thanks in advance

extrusion_lines = []
for rectangle in rectangles:
    iteration = 0 
    start_point = rs.CurveAreaCentroid(rectangle)
    start_point = start_point[0L
    direction = perp_frame_intersections[iteration].ZAxis #gets Z-vector from perp frames generetated earlier in script
    line_sdl = rg.Line(start_point, direction, 150) 
    extrusion_curves.append(line_sdl)

rectangle_breps = []
for rectangle in rectangles:
    iteration = 0
    rectangle_brep = rs.ExtrudeCurve(rectangle, extrusion_curves[iteration]) #gets sdl-line from list extrusion_lines
    rectangle_breps.append(rectangle_brep)

errormessage:
Runtime error (TypeErrorException): Parameter must be a Guid or string representing a Guid

7 posts - 4 participants

Read full topic


Viewing all articles
Browse latest Browse all 4159

Latest Images

Trending Articles



Latest Images