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

    [Request] Dimension and Leader Text - Toggle Visibility

    Scheduled Pinned Locked Moved Plugins
    5 Posts 3 Posters 846 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.
    • JClementsJ Offline
      JClements
      last edited by

      I realize scripts have been written to find, select, and segregate certian types of entities; however, they usually resort to creating Layers to isolated them.

      Is there an alternative method to toggle the visibility of Dimensions or Leader Text for an entire file, similar to what SU natively does with contruction points and guides (without relying on Layers)? If so then, a menu item for each in the View menu would meet my needs (a toolbar or context menu wouldn't be necessary).

      I use dimensioning primarily as an auditing/verification process for my "Final" drafts and Leader Text for denoting modeling/reference notes. They save a lot of time, but make "viewability" UGLY and it would be very helpful to toggle them off when not needed.

      John | Illustrator | Beaverton, Oregon

      1 Reply Last reply Reply Quote 0
      • R Offline
        remus
        last edited by

        Would grouping then hiding them be a suitable solution? I think this could be done through ruby...

        http://remusrendering.wordpress.com/

        1 Reply Last reply Reply Quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          def dimsvis()
            if $dims_visible
              Sketchup.active_model.entities.each{|e|e.hidden=true if e.typename=="DimensionLinear"}
              $dims_visible=false
            else
              Sketchup.active_model.entities.each{|e|e.hidden=false if e.typename=="DimensionLinear"}
              $dims_visible=true
            end#if
          end#def
          if not file_loaded?(__FILE__)
            UI.menu("Plugins").add_item("Dimension Visibility Toggle"){dimsvis()}
          end#if
          file_loaded(__FILE__)
          

          This is the basis of what you want...
          Copy and paste this code into a new file called say dimsvis.rb in your plugins folder...
          Then typing dimsvis in the Ruby Console should do what you want...
          Also the menu item "Dimension Visibility Toggle" does the same...
          You can shortcut to this menu item - so say pressing F12 would toggle the dimensions' visibility.
          When it's first run it currently always shows the dimensions, so if they are already showing they will remain shown and you need to re-run it will hide then, however, after that it toggles visibility on/off for that session.
          You could improve it by adding an attribute to the model to show if dims are visible; it could then read that and reverse the settings and re-saved attribute to use later - that will last across sessions... I'll leave that up to you...

          TIG

          1 Reply Last reply Reply Quote 0
          • JClementsJ Offline
            JClements
            last edited by

            Thank you much.

            [Edit] Any chance it can be tweeked to toggle dimensions for the ENTIRE Model (in all sublevels)?

            John | Illustrator | Beaverton, Oregon

            1 Reply Last reply Reply Quote 0
            • JClementsJ Offline
              JClements
              last edited by

              TIG:

              I did a real quick test and the data mining functions seems to work great. I'll be using it extensively during the next week or two. If anything comes up I will post here.

              Thanks again!
              "You're a gentlemen and a scholar." ... W.C. Fields

              John | Illustrator | Beaverton, Oregon

              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