Grasshopper

algorithmic modeling for Rhino

Hi,

I'm trying to project a curve to a Brep using RhUtil.RhinoProjectCurvesToBreps and am having troubles with firstly creating an array for the projected curves. I can send the projected curves out as a VB output 'A' but need to send them to an array within the VB component.

Dim arrCrv As New OnCurveArray()
RhUtil.RhinoProjectCurvesToBreps(arrBrep.ToArray(), inCrv.ToArray(), inVec, arrCrv, Nothing, Nothing, tol)


This is the error I get with the script:
Value of type 'RMA.OpenNURBS.OnCurveArray' cannot be converted to '1-dimensional array of RMA.OpenNURBS.OnCurve'.

Thanks

Views: 481

Replies to This Discussion

From just that error (I haven't taken an actual look yet), it would seam that you can not simply pass an OnCurveArray out of a scripting component. That means that you will have to manually step through the OnCurveArray and put all the items into a normal array of OnCurves or a generic List of OnCurves. Just a few lines, so no big worry

Dim FinalCrvs as new List(OnCurve)
For i=0 to OnCrvArr.Count -1
FinalCrvs.Add(OnCrvArr(i))
Next
Substitute the line:
Dim arrCrv As New OnCurveArray()
with:
Dim arrcrv(0) As oncurve

You can also have different vb.net components connected together, and not everything has to be in one component (depending on what you are doing). Also, there's a component that does just this, are you sure you can't connect the result of this component to a vb.net component to avoid writing the code?
Thanks Vincent - I didn't know about this code at all - works perfectly. I do need to write this up in VB as it's a recursive function. The only other question I have is how to create a bounding box for a list of curves (not separate BB's but one for the entire list)?

Damien - 'Generic List of Curves' does not work as it needs an Array - same goes for projected points - thanks for looking anyway.

D

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service