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

    Showing edges in color according to the main axes

    Scheduled Pinned Locked Moved Plugins
    3 Posts 2 Posters 186 Views 2 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.
    • G Offline
      glro
      last edited by

      Insert a component far from the origin 0 0 0, and give it the right orientation, is difficult because the global axis are not visible in the window

      you have to memorize where they are, or zoom out to see it, and then zoom in again to insert the component precisely

      Sketchup gives the possibility to color the objects edges according to their direction, which is great because this way, you always know where the main axes are, even if you are far from the origin

      Would it be possible to write a plugin that would toggle the edges color to the main axes, just by pressing a key on the keyboard?


      edges color acccording to main axes

      1 Reply Last reply Reply Quote 0
      • GaieusG Offline
        Gaieus
        last edited by

        Jim's custom toolbar plugin has such a button.

        CustomToolbar.png
        The one right to it will toggle endpoints - also a good thing when trouble shooting or connecting mesh.

        Gai...

        1 Reply Last reply Reply Quote 0
        • G Offline
          glro
          last edited by

          @gaieus said:

          Jim's custom toolbar plugin has such a button.

          [attachment=0:381h7ksq]<!-- ia0 -->CustomToolbar.png<!-- ia0 -->[/attachment:381h7ksq]
          The one right to it will toggle endpoints - also a good thing when trouble shooting or connecting mesh.

          thank you

          yes, i realized it later, and that i could do it myself...

          As an alternative to buttons, i like to use keyboard shortcuts; so i slightly modified Jim's plugin to assign a key to it

          Here is the code, without any garantee; it works with me, but i only copied and pasted, cannot explain what i did in detail ...

          require 'sketchup.rb'
          
          # Add a menu item to launch our plugin.
          UI.menu("PlugIns").add_item("colored_edges") { colored_edges }
          # -----------------------------------------------------------------------------
          
          def colored_edges
          
          mod = Sketchup.active_model # Open model
          ent = mod.entities # All entities in model
          sel = mod.selection # Current selection
           
          ro = Sketchup.active_model.rendering_options
            ecm = ro["EdgeColorMode"]
            if ecm != 2
              ecm = 2
              Sketchup.set_status_text "Egde Color Mode; by Axis"
            else
              ecm = 1
              Sketchup.set_status_text "Egde Color Mode; Default"
            end
            ro["EdgeColorMode"] = ecm
          
            end
            
          def axisedge_validation_proc
            if Sketchup.active_model.rendering_options["EdgeColorMode"] == 2
              return MF_CHECKED
            else
              return MF_UNCHECKED
            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