I’m trying too delete a hidden object but I cant get it to work:
For Each obj As DocObjects.RhinoObject In doc.Objects
doc.Objects.Show(obj.Id, True)
doc.Objects.Unlock(obj.Id, True)
doc.Objects.Delete(New DocObjects.ObjRef(obj.Id), True)
Next
I create a plane and hide it in rhino then run the command. And It’s still there when I use the command show.
What am i doing wrong?
doc.Objects only contains Visible items. You need to use doc.Objects.GetObjectList and set the ObjectEnumeratorSettings correctly. Then, unhide the object and delete it.