Hello,
Are there any known issues with changing the current tool from an EntitiesObserver in the onElementedAdded callback? As currently when I try to do this it just crashes SU, I know the EntitiesObserver has plenty of issues, but I was hoping this wasn't going to be one of them.
Basically I want to be able to change the current tool when a specific kind of component is added, checking if the component is the right one that I want is easy.
I tried changing the tool in a Thread but the sleep functionality doesn't seem to work as expected, as it doesn't wake up again until the onElementAdded function is called again which is bizarre in itself.
I also tried a onPlaceComponent ModelObserver which doesn't crash but it also doesn't do anything either.
This is what the code boils down to.
class MyObserver < Sketchup;;EntitiesObserver
def onElementAdded(entities, entity)
if (check_entity(entity))
Sketchup.active_model.select_tool $my_tool
end
end
end
Sketchup.active_model.entities.add_observer(MyObserver.new())
I tried searching on the forum for anything about changing the current tool from an observer and I didn't find anything.
If this is a known issue/limitation then it's not the end of the world.
Thanks