Grasshopper

algorithmic modeling for Rhino

Hey Guys,

I want delete an object with a button.
Therefore i want find the object by layer and then delete.
But i think there is more scripting necessary.
Has anybody a short solution for me?

regards

henne

Views: 1470

Replies to This Discussion

In order to delete an object fro Rhino you need to either know the GUID of it or have a good method of finding it in the object database. If you want to delete all objects on a specific layer, then:

Dim doc As RhinoDoc = RhinoDocument
Dim objs As Rhino.DocObjects.RhinoObject() = doc.Objects.FindByLayer("layerName")
If (objs IsNot Nothing) Then
  For Each obj As Rhino.DocObjects.RhinoObject In objs
    doc.Objects.Delete(obj, True)
  Next
End If

--

David Rutten

david@mcneel.com

David what would I do without you. :)
Another great times thank you!


how can I delete object if I know the Guid

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service