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

Gh python: error workting with coercecurve but not in Rhino python editor

$
0
0

Hello,

Running my script from the Rhino Python editor does not produce any errors, a similar script embedded in Gh as a component however, does:
After filtering a curve input for deg=1 , I am trying to create a vector in the direction of the lines and use its start-/Endpoint for a series of transformations.
In Gh python I get the follwing errors:
using rs.CurveStartPoint(Id): Unable to convert Id into curve

Earlier in the script I use a filter with rs.coercecurve on every id in the list, only the segments of an exploded polyline not.

Using Rhino.geo.curve.PointAtStart(Id): I get an error message working with the start/endpoin a few lines latert: could not convert property PointAtEnd to a point3d.

Fed to the script are a rectangle and four lines forming a pyramid.
I assume it has to do with the rectangle-polyline, which components should be added to the list, but the polyline id removed;

It would be amazing if you can help me pinpoint how the error can be avoided.
Any general advice or improvements are much appreciated, too, as I am only starting to learn scripting.

Attached you can find screenshots, the grasshopper setup with the ghpython script and the working rhino script.



gh excerpt.gh (9.5 KB)
grasshopper assembly.3dm (820.2 KB)

Thank you very much, with best regards,
Aero

Mero Script V2, test.py (2.4 KB)

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles