Grasshopper

algorithmic modeling for Rhino


hey guys,

with the command  Curve.DivideByCount
if the return value is:

Return Value

List of curve parameters at the division points on success, null on failure.





how do i dim the list and add the returns to that list with RhinoCommon?


thanks 

Views: 309

Replies to This Discussion

This should help for VB and C# divideByCount, may not be what your asking though...
Attachments:
hey chaz!

thanks,

basically, i want to loop through the array of returns from DivideByCount. you know the syntax for that?
double[] ts = MyCurve.DivideByCount(100, true);

To iterate over this list, use either:

for (int i = 0; i < ts.Length; i++)
{
//Do something with ts[i]
}


or

foreach (double t in ts)
{
//Do something with t
}


I suppose you should test for null in case DivideByCount failed:

if (ts == null) { return; }

--
David Rutten
david@mcneel.com
Poprad, Slovakia

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service