sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Reload or recharge

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 3 Posters 820 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      DDS
      last edited by

      what is the ruby command to execute the command reload or recharge (like the right mouse click).

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        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

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • D Offline
          DDS
          last edited by

          yes, it : "Reload..." when right-clicking on an instance
          I'll look for workaround snippets posted in the forums.
          Thanks

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            @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.

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • D Offline
              DDS
              last edited by

              @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.

              1 Reply Last reply Reply Quote 0
              • D Offline
                DDS
                last edited by

                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 
                				
                
                
                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Buy SketchPlus
                Buy SUbD
                Buy WrapR
                Buy eBook
                Buy Modelur
                Buy Vertex Tools
                Buy SketchCuisine
                Buy FormFonts

                Advertisement