algorithmic modeling for Rhino
I have a [hopefully] quick question about the sweep utility. How do I add the resulting sweep to a list? Or, how do I assign multiple sweeps to the output?
The following does not work:
Dim sweep As New Rhino.Geometry.SweepOneRail
Dim objList As New RhinoList (Of Object)
objList.Add(sweep.PerformSweep(C, profileFace))
objList.Add(sweep.PerformSweep(C, profileWall))
A = bList
The following does work, but I don't know how to assign multiple sweeps to the 'A' output:
Dim sweep As New Rhino.Geometry.SweepOneRail
A = sweep.PerformSweep(crv, profile)
Again, how do I add these sweeps to a list
or
how do I assign multiple sweeps to an output
Tags:
A = bList
should be
A= objList
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Hi David,
I re-wrote the code in these examples for readability. Before I was using something like...
Dim bList as New List (Of Brep)
bList.Add (sweep.PerformSweep(crv, profile))
A = bList
The problem I ran into was using a list of surface or brep. If I use the code:
A = sweep.PerformSweep(crv, profile)
I believe it returns a surface. But, the grasshopper vb component does not allow me to add these items to a surface (or brep) list.
Thanks again...
PerformSweep returns an array of breps. Since you've defined your bList as a List(Of Object), there is no error as an array of breps can be stored in an Object variable. Had you declared your bList as a List(Of Brep) you'd have gotten a compiler error.
What you are outputting to A is a List of Brep arrays. Grasshopper does not attempt to interpret jagged or multidimensional collections. What you should do instead is write:
bList.AddRange(sweep.PerformSweep(crv, profile))
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by