algorithmic modeling for Rhino
Hi, i have a question.
I make a logic that makes edge curves in triangle surface.
this return output is that.
{0,0,0} - (3)
{0,0,1} - (3)
{0,0,2} - (3)
{0,0,3} - (3)
{0,0,4} - (3)
{0,0,5} - (3)
{0,0,6} - (3)
total output is 7-branch, and each branch have three edge curves.
but I make this output to one branch list like grasshopper component 'flatten'
21 locally define values
line-like curve
line-like curve
line-like curve
.
.
.
line-like curve
how to make this?
runscript(byval trisurfaces as brep, byref a as object)
dim explodecurves as curve()
explodecurves = trisurfaces.duplicateEdgeCurves
dim curvelist as new list(of curve)
for each explodecurve as curve in explodecurves
curvelist.add(explodecurve)
next
a = curvelist
thanks
Tags:
You can't. If you want to output a single list of data, you must do so within a single iteration of the RunScript method. You can change your trisurfaces input to list access:
RunScript(ByVal trisurfaces As List(Of Brep), ByRef a As Object)
Dim explodeCurves As New List(Of Curve)
For Each brep As Brep in trisurfaces
explodeCurves.AddRange(brep.DuplicateEdgeCurves())
Next
a = explodeCurves
End Sub
--
David Rutten
david@mcneel.com
Poprad, Slovakia
wow thanks! your method is working well!
but, i have a question. what is different single list and list access?
they seems similar...
If you set the input to List access instead of Item access, the RunScript signature changes from:
RunScript(ByVal trisurfaces As Brep, ByRef a As Object)
to:
RunScript(ByVal trisurfaces As List(Of Brep), ByRef a As Object)
This allows you to iterate over all the Breps that 'belong together' and aggregate the results into a single list. I'm not sure what it is you're asking though, so this may not be the droids you're looking for.
--
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