Reload or recharge
-
what is the ruby command to execute the command reload or recharge (like the right mouse click).
-
I think you mean Component "Reload..." when right-clicking on an instance.
(1) You might set a keyboard accelerator (shortcut) like "CTRL+R".
(2) There is no persistent automation integer ID for this command (that I can find.) The context menus are created "on-the-fly" as needed, and the menu commands are created just before the menu is displayed, and destroyed soon after the menu disappears. (So the "Reload..." command ID is always changing.)
(3) There is no reload API method. But requests have been filed for one. I think there have been some workaround snippets posted in the forums. (Do a search. This was talked about just in the past week.)
(4) I do not see a
Sketchup::send_action()
string for it listed in this topic:
http://sketchucation.com/forums/viewtopic.php?t=34840 -
yes, it : "Reload..." when right-clicking on an instance
I'll look for workaround snippets posted in the forums.
Thanks -
@dds said:
what is the ruby command to execute the command reload or recharge (like the right mouse click).
What is the context of this question? Wondering is there is an alternative way to solve what you are looking for.
-
@thomthom said:
@dds said:
what is the ruby command to execute the command reload or recharge (like the right mouse click).
What is the context of this question? Wondering is there is an alternative way to solve what you are looking for.
I want to create a button that changes the selected component (+ all similar) by another based on its name.
-
Here is my solution
selectionObjectTemp = Sketchup.active_model.selection.to_a if selectionObjectTemp.length == 0 selectionTemp = nil else selectionTemp = selectionObjectTemp end if @definitions[definitionAImporter] definition = @definitions[definitionAImporter] else composantPath = File.join(@libPath,"#{definitionAImporter}.skp") if File.exist?(composantPath) definition = @definitions.load composantPath else UI.messagebox "le chemin n'existe pas; #{composantPath}" end end if selectionTemp != nil selectionTemp.each{|entitie| if entitie.is_a? Sketchup;;ComponentInstance entitie.definition = definition end } end
Advertisement