sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Plugin idea - component axes - button for show on/off

    Scheduled Pinned Locked Moved Plugins
    18 Posts 7 Posters 716 Views 7 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.
    • sdmitchS Offline
      sdmitch
      last edited by

      The if opt=false and if opt=true should have been if opt==false and if opt==true.

      In order to assign a shortcut to it, you need to assign it to a menu ie. Plugins. In the Preferences>Shortcuts, it will be listed as Plugins/DisplayAxes.

      module Toggle
      	def self.dis()
      		opt=Sketchup.active_model.rendering_options["DisplayInstanceAxes"]
      		if opt==false
      			Sketchup.active_model.rendering_options["DisplayInstanceAxes"]=true
      		end
      		if opt==true
      			Sketchup.active_model.rendering_options["DisplayInstanceAxes"]=false
      		end
      	end
      	unless file_loaded?(__FILE__)
      		UI.menu("Plugins").add_item("DisplayAxes") {Toggle.dis}
      		file_loaded(__FILE__)
      	end
      end
      
      

      Nothing is worthless, it can always be used as a bad example.

      http://sdmitch.blogspot.com/

      1 Reply Last reply Reply Quote 0
      • robertWanR Offline
        robertWan
        last edited by

        Now is ok, thank you.

        Robert

        1 Reply Last reply Reply Quote 0
        • mitcorbM Offline
          mitcorb
          last edited by

          @Robert:
          Glad you got it working.
          @sdmitch:
          Thank you for your time to solve Robert's issue.
          @Pilou:
          That is a good alternative.
          @tetrochuan:
          Did you decide on something else?

          I take the slow, deliberate approach in my aimless wandering.

          1 Reply Last reply Reply Quote 0
          • L Offline
            laudhi
            last edited by

            @sdmitch said:

            The if opt=false and if opt=true should have been if opt==false and if opt==true.

            In order to assign a shortcut to it, you need to assign it to a menu ie. Plugins. In the Preferences>Shortcuts, it will be listed as Plugins/DisplayAxes.

            module Toggle
            > 	def self.dis()
            > 		opt=Sketchup.active_model.rendering_options["DisplayInstanceAxes"]
            > 		if opt==false
            > 			Sketchup.active_model.rendering_options["DisplayInstanceAxes"]=true
            > 		end
            > 		if opt==true
            > 			Sketchup.active_model.rendering_options["DisplayInstanceAxes"]=false
            > 		end
            > 	end
            > 	unless file_loaded?(__FILE__)
            > 		UI.menu("Plugins").add_item("DisplayAxes") {Toggle.dis}
            > 		file_loaded(__FILE__)
            > 	end
            > end
            > 
            

            Hi Sdmitch,can you teach me how to add "DisplayInstanceAxes" plugin in "SDM tools" sub menu?

            1 Reply Last reply Reply Quote 0
            • sdmitchS Offline
              sdmitch
              last edited by

              replace

                 unless file_loaded?(__FILE__)
                    UI.menu("Plugins").add_item("DisplayAxes") {Toggle.dis}
                    file_loaded(__FILE__)
                 end
              

              with this

              	unless $sdm_tools_menu
              		$sdm_tools_menu = UI.menu("Plugins").add_submenu("SDM Tools")
              		$sdm_CorG_tools = $sdm_tools_menu.add_submenu("CorG Tool")
              	end
              	unless file_loaded?(__FILE__)
              		$sdm_CorG_tools.add_item("DisplayAxes") { Toggle.dis }
              		file_loaded(__FILE__)
              	end
              
              

              Nothing is worthless, it can always be used as a bad example.

              http://sdmitch.blogspot.com/

              1 Reply Last reply Reply Quote 0
              • L Offline
                laudhi
                last edited by

                module Toggle
                def self.dis()
                opt=Sketchup.active_model.rendering_options["DisplayInstanceAxes"]
                if opt==false
                Sketchup.active_model.rendering_options["DisplayInstanceAxes"]=true
                end
                if opt==true
                Sketchup.active_model.rendering_options["DisplayInstanceAxes"]=false
                end
                end
                unless $sdm_tools_menu
                $sdm_tools_menu = UI.menu("Plugins").add_submenu("SDM Tools")
                $sdm_CorG_tools = $sdm_tools_menu.add_submenu("CorG Tool")
                end
                unless file_loaded?(FILE)
                $sdm_CorG_tools.add_item("DisplayAxes") { Toggle.dis }
                file_loaded(FILE)
                end

                and i found this:

                Error Loading File DisplayInstanceAxes.rb
                Error: #<SyntaxError: C:/Users/Laudhi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/DisplayInstanceAxes.rb:18: syntax error, unexpected end-of-input, expecting keyword_end>

                1 Reply Last reply Reply Quote 0
                • L Offline
                  laudhi
                  last edited by

                  and i found this to :

                  Error Loading File Multiple Offsets.rb
                  Error: #<NoMethodError: undefined method add_item' for nil:NilClass> C:/Users/Laudhi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Multiple Offsets.rb:185:in <top (required)>'
                  Error Loading File Multi_Offset_Tool.rb
                  Error: #<NoMethodError: undefined method add_item' for nil:NilClass> C:/Users/Laudhi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Multi_Offset_Tool.rb:30:in <top (required)>'
                  Error Loading File Rotated Box.rb
                  Error: #<NoMethodError: undefined method add_item' for nil:NilClass> C:/Users/Laudhi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Rotated Box.rb:33:in <top (required)>'
                  Error Loading File Rotated Circle_Cylinder.rb
                  Error: #<NoMethodError: undefined method add_item' for nil:NilClass> C:/Users/Laudhi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Rotated Circle_Cylinder.rb:30:in <top (required)>'
                  Error Loading File Stair Maker.rb
                  Error: #<NoMethodError: undefined method add_item' for nil:NilClass> C:/Users/Laudhi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Stair Maker.rb:33:in <top (required)>'

                  1 Reply Last reply Reply Quote 0
                  • J Offline
                    Jim
                    last edited by

                    This kind of utility is perfect for Custom Toolbars. I have added a toggle_instance_axes command which will be included in the next release. Let me know if you have any more suggestions.

                    2014-03-22_210717.png

                    Hi

                    1 Reply Last reply Reply Quote 0
                    • sdmitchS Offline
                      sdmitch
                      last edited by

                      @laudhi said:

                      module Toggle
                      def self.dis()
                      opt=Sketchup.active_model.rendering_options["DisplayInstanceAxes"]
                      if opt==false
                      Sketchup.active_model.rendering_options["DisplayInstanceAxes"]=true
                      end
                      if opt==true
                      Sketchup.active_model.rendering_options["DisplayInstanceAxes"]=false
                      end
                      end
                      unless $sdm_tools_menu
                      $sdm_tools_menu = UI.menu("Plugins").add_submenu("SDM Tools")
                      $sdm_CorG_tools = $sdm_tools_menu.add_submenu("CorG Tool")
                      end
                      unless file_loaded?(FILE)
                      $sdm_CorG_tools.add_item("DisplayAxes") { Toggle.dis }
                      file_loaded(FILE)
                      end
                      end#<---add this

                      and i found this:

                      Error Loading File DisplayInstanceAxes.rb
                      Error: #<SyntaxError: C:/Users/Laudhi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/DisplayInstanceAxes.rb:18: syntax error, unexpected end-of-input, expecting keyword_end>

                      The end statement for the module is missing.

                      Nothing is worthless, it can always be used as a bad example.

                      http://sdmitch.blogspot.com/

                      1 Reply Last reply Reply Quote 0
                      • sdmitchS Offline
                        sdmitch
                        last edited by

                        @laudhi said:

                        and i found this to :

                        Error Loading File Multiple Offsets.rb
                        Error: #<NoMethodError: undefined method add_item' for nil:NilClass> C:/Users/Laudhi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Multiple Offsets.rb:185:in <top (required)>'
                        Error Loading File Multi_Offset_Tool.rb
                        Error: #<NoMethodError: undefined method add_item' for nil:NilClass> C:/Users/Laudhi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Multi_Offset_Tool.rb:30:in <top (required)>'
                        Error Loading File Rotated Box.rb
                        Error: #<NoMethodError: undefined method add_item' for nil:NilClass> C:/Users/Laudhi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Rotated Box.rb:33:in <top (required)>'
                        Error Loading File Rotated Circle_Cylinder.rb
                        Error: #<NoMethodError: undefined method add_item' for nil:NilClass> C:/Users/Laudhi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Rotated Circle_Cylinder.rb:30:in <top (required)>'
                        Error Loading File Stair Maker.rb
                        Error: #<NoMethodError: undefined method add_item' for nil:NilClass> C:/Users/Laudhi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/Stair Maker.rb:33:in <top (required)>'

                        Most if not all of these plugins had to be updated for SU2014 so start by downloading a new copy.

                        Nothing is worthless, it can always be used as a bad example.

                        http://sdmitch.blogspot.com/

                        1 Reply Last reply Reply Quote 0
                        • L Offline
                          laudhi
                          last edited by

                          ok,thanks for your help Sdmitch....i will update with a new version... 😉

                          1 Reply Last reply Reply Quote 0
                          • L Offline
                            laudhi
                            last edited by

                            i change the name DisplayInstanceAxes.rb to ToggleComAxes.rb and everything works fine now....

                            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