Grasshopper

algorithmic modeling for Rhino

Is there a Component that gives you the Degree of a curve?

If not then what would be the best way to get this using C# or .NET component?

Views: 1222

Replies to This Discussion

Hi Danny,

if you type hint x as OnCurve (old SDK) write this in a C# component:

if(x != null)
    A = x.Degree();


otherwise, in RhinoCommon (Gh 0.7.X), if you type hint x as Curve this will do:

if(x != null)
    A = x.Degree;


Hope this helps,

- Giulio
______________
giulio@mcneel.com
McNeel Europe, Barcelona
Hi Giulio,

Thanks for your help but I seem to be missing something still. I just get nulls as the output.

Attachments:
It works now after I had a restart. Thanks again
Great!

Just a little comment about the picture:

the statement inside the "if" clause unconditionally assigns a boxed integer to A. So, if the result is and there is no exception, it means that that statement never ran, and that in turn means that the input x was null.

This might be good to know in case we find some more in this script other times.

- Giulio
______________
giulio@mcneel.com
McNeel Europe, Barcelona

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service