Hello
I want to remove Selectionobsever after a certain operation, but I can’t do it.
Thanks!
class MySelectionObserver < Sketchup::SelectionObserver
def onSelectionBulkChange(selection)
face = selection.grep(Sketchup::Face)[0]
p face.persistent_id
Sketchup.active_model.selection.remove_observer(selection)
end
end
# Attach the observer.
Sketchup.active_model.selection.add_observer(MySelectionObserver.new)
Thanks a lot! Here is the logic i want to achieve:
Use the Selectionobsever to pass the persistent_id of the face to the plugin page when the face is selected, and close the Selectionobsever when the plugin page changes.