Grasshopper

algorithmic modeling for Rhino

Hi everyone,

Would you know how to create a VB.NET compontent that allows me to bake objects to specific layers. there are many excellent examples in the forum before ,But now they don't work in GH 0.7.0030 . Any help is appreciated.

 

Thanks !

Views: 3188

Replies to This Discussion

Private Sub RunScript(ByVal obj As Brep, ByVal lay As String, ByVal col As Color, ByRef A As Object)
  Dim lay_index As Int32 = doc.Layers.Find(lay, True)
  If (lay_index < 0) Then
    lay_index = doc.Layers.Add(lay, col)
  End If

  Dim att As New DocObjects.ObjectAttributes()
  att.LayerIndex = lay_index

  A = doc.Objects.AddBrep(obj, att)
End Sub


--
David Rutten
david@mcneel.com
Poprad, Slovakia
Oh sorry, the Layers.Add(lay, col) overload doesn't exist yet in the RhinoCommon version you have. You'll have to specifically construct a LayerInfo object and set the properties.

In the next release of Grasshopper you'll be able to construct layers in this way.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
thanks a lot!
David:

Rhino.DocObjects.LayerInfo seems to be unavailable. I am using C#, GH 0.8.0001, and Rhino 5 WIP (x64 9-Nov-2010). I originally made and used the defintion (including LayerInfo) in GH 0.7 but now it is not working (becuase it can't use LayerInfo). Is this a RhinoCommon issue, an issue with GH, or perhaps an issue at my end?

Thanks


Jason
Hi Jason,

we took LayerInfo out again and merged the functionality back into Layer.

--
David Rutten
david@mcneel.com
Seattle, WA

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service