• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

Assign Tag in Context Menu - Update to PutOnLayer.rb

Scheduled Pinned Locked Moved SketchUp Discussions
sketchup
3 Posts 3 Posters 2.6k 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.
  • G Offline
    gamber
    last edited by 12 May 2021, 18:55

    Looking for an update to the "PutOnLayer.rb" extension which applies to Tags vs Layers.

    I have found this plugin works fine, but defaults to Layer0 vs Untagged. Unfortunately, though well versed in the tech world, Ruby is not an area where I have any expertise whatsoever.

    Is there anyone within the forums who can take a quick look and offer some assistance?

    Thanks in advance.


    PutOnLayer.rb

    1 Reply Last reply Reply Quote 0
    • S Offline
      slbaumgartner
      last edited by 15 May 2021, 14:56

      There are several issues with that old Ruby plugin. I would advise against using it without thinking carefully about what it does and reworking it. In particular:

      • It does not comply with the current practice of never assigning tags/layers to edges or faces (unless you are really expert and understand the risk you are taking). Only assign tags/layers to Groups, ComponentInstances, and non-geometric objects such as dimensions, texts, and images. Tagging edges and faces creates the mistaken impression that they are isolated against interaction, whereas in SketchUp the tags/layers have no effect on interaction. This is a cause of many errors and frustration as naive users edit their models. Layers in many 2D drawing and photo editing apps do isolate geometry, and there is a myth that layers in CAD also isolate geometry, but this is not true: edges never intersect in CAD unless you tell them to do so. SketchUp is different!
      • In keeping with the previous, current advice is that you should very rarely make any tag/layer active besides "untagged"/"Layer0"
      • The code should be wrapped in modules with distinctive (hence likely unique) names so that it can't clash with other code.
      • The name change from layers to tags in SketchUp is purely a GUI thing to help avoid confusion, especially since LayOut has layers that behave the same as in many other 2D drawing apps. As a result, to avoid breaking many extensions, the name was left as "layers" and "Layer0" in the Ruby API. It is up to Ruby code to substitute "untagged" for "Layer0" if you want consistency with the GUI.
      1 Reply Last reply Reply Quote 0
      • O Offline
        orbital
        last edited by 27 May 2021, 23:15

        Naturally I agree with everything slbaumgartner says about assigning tags to edges and faces.

        I had disabled the recursive part of the plugin as I did not need that.

        I've been using this successfully over the years.

        Following recent helpful discussions with slbaumgartner and anotheron the other forum regarding ruby coding, for my personal use, I have reworked the code and wrapped it in modules.

        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