[request] Start Sketchup with activated Plugin
-
Can we start Sketchup in that way?
-
Yes.
Now please explain what you want to do...
NOTE:
If you had a tool activated by the codeTIG.doit()
in a file calledTIG-doit.rb
in the Plugins folder, then you can write a short script in the Plugins folder called sayzzz_TIG-doit_activator.rb
containing the [pseudo] code:
require "TIG-doit.rb" TIG.doit() if Sketchup.active_model
I named it with leading z's so that it auto-loads late on, in case any other scripts are trying also to launch their own tool at startup !
If you wanted to launch a native tool then use something like:
Sketchup.send_action("selectSelectionTool:") if Sketchup.active_model
which changes the default 'Line' tool to become 'Select'.
You could also add a couple of Observers to the Sketchup App... to redo this should the user Open or make a New SKP, when the .rb won't auto-reload... -
@tig said:
If you wanted to launch a native tool then use something like:
Sketchup.send_action("selectSelectionTool:") if Sketchup.active_model
which changes the default 'Line' tool to become 'Select'Thanks TIG. I've always been mystified why they chose 'Line' as the default tool - 'Select' seems much more sensible to me; so now I have made my first ever .rb file (though I think it will be 1000 years before there's any chance I'll rival you, ThomThom, Fredo et al.!!).
-
Thanks TIG. No need for me to explain this since I'm not a coder and this is all mystical for me.
It was a question in general for an idea a client have.
If they want me to realize, I will take a look for someone with professional background.Btw. I saw in the API the values for send_action. But, is there a list of AutomationID available? ( like save 57603 )
Advertisement