algorithmic modeling for Rhino
Tags:
When you try to bake a component in Grasshopper, the method "BakeGeometry" is automatically called. the "List(Of Guid)" obj_ids is actually information that the method creates, rather than the required input to the method - it's information OUT, not IN.
When BakeGeometry is called, this list gets populated by some other function within the method - usually something like RhinoDoc.Objects.AddText (or AddCurve or AddBrep etc). These functions return a Guid, which is then added to obj_ids.
VB's not my strong suit, but I think something like this would be a correct override to BakeGeometry:
Public Overrides Sub BakeGeometry(doc As Rhino.RhinoDoc, att As Rhino.DocObjects.ObjectAttributes, obj_ids As List(Of Guid))
For Each tag As Text3d In tags
Guid id = Rhino.RhinoDoc.ActiveDoc.Objects.AddText(tags, att)
obj_ids.Add(id)
Next
End Sub
This assumes you've already populated tags as a list of Text3d in your SolveInstance. To do things properly, you should also do some things to avoid errors - checking that att isn't null, for instance, or that the Guid is a valid one. (AddText returns Guid.Empty if it was unable to add the object to the document.)
told you VB wasn't my strong suit :)
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
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by