If the return value from the call is a valid string (boolean true in Ruby) then make a call to the dialog sending over the path string to the path edit box by ID.
def send_path_to_dialog(path)
@dialog.execute_script("path_edit_ID.value='#{path}';")
end
… or …
def send_path_to_dialog(path)
@dialog.execute_script("document.getElementByID('path_edit_ID').value='#{path}';")
end
This really helps a lot.
I have a question about Ruby API: after i install Thea for SketchUp, can i get it in my Ruby plugin to ‘Click’ the final submenu ‘Export Model as Thea Scene’.
Could I get the extension API to ‘Click’ the desired submenu?
Maybe it’s like simulate the mouse click, maybe not. I don’t know if i can implement via .rb.
No way to drive menu clicks from the Ruby API. Instead you’d invoke the ruby methods the menu would invoke. When it’s not your own extension you try to invoke you can try to reach out to the developer and ask for details.
The easiest thing to do (if the Thea extension does not expose commands to other coders,) is to assign a shortcut keychord to the export menu item, and then use WIN32OLE and the SendKeys method call. (But this only MS Windows.)
Wow, i can’t believe you can see that. After i posted that when i realized that it was posted ONE YEAR AGO in the first place! Thans you very much for your wonderful answer.