sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Component Axis Display Option

    Scheduled Pinned Locked Moved Developers' Forum
    9 Posts 3 Posters 203 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.
    • K Offline
      ktkoh
      last edited by

      I tried this code from the API in an attempt to find the Option name for controlling the component axis visibility but it does not run. There is a optionsmanager but the options.name line fails.

       model = Sketchup.active_model
       optionsmanager = model.options
       if (optionsmanager)
         # If an options manager is returned, iterate through each option
         # provider within the options manager and display its name.
         for option in optionsmanager
           name = options.name
           UI.messagebox name
         end
       else
         UI.messagebox "Failure"
       end
      

      Is there a code method for controlling the component axis visibility?

      Keith

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

        It is not in the options manager / provider hierarchy.

        It is in the model or scene page rendering_options hierarchy.

        object.rendering_options["DisplaySketchAxes"]= false
        

        The object can be a Sketchup::Model or a Sketchup::Page instance.

        πŸ’­

        I'm not here much anymore.

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

          OR...

          object.rendering_options["DisplayInstanceAxes"]= false
          

          I'm not here much anymore.

          1 Reply Last reply Reply Quote 0
          • K Offline
            ktkoh
            last edited by

            Dan that code controls the global axis. I am trying to control the individual component axis visibility.

            Keith

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

              Sketchup.active_model.rendering_options['DisplayInstanceAxes'] = true

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

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

                Instead of using messageboxes to inspect the possible options I use these snippets:

                Sketchup.active_model.rendering_options.each { |k,v| puts "#{k} - #{v}" }

                Sketchup.active_model.options.each { |op| puts op.name; op.each { |k,v| puts "> #{k} - #{v}" } }

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

                1 Reply Last reply Reply Quote 0
                • K Offline
                  ktkoh
                  last edited by

                  Thanks that's what I needed. I am always amazed at how quick I get answers on this forum. I would never be able to find these on my own.

                  Wouldn't it be nice if the examples in the Sketchup Documentation actually worked.

                  Keith

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

                    @ktkoh said:

                    Wouldn't it be nice if the examples in the Sketchup Documentation actually worked.

                    +1

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

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

                      @ktkoh said:

                      Dan that code controls the global axis. I am trying to control the individual component axis visibility.

                      And if you had read the NEXT post after THAT, before posting you would have seen I gave you the instance key as well.

                      Lesson: Read the whole thread before posting.

                      I'm not here much anymore.

                      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