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

    Name a Group after its Layer

    Scheduled Pinned Locked Moved Plugins
    3 Posts 2 Posters 121 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.
    • R Offline
      rossthompson
      last edited by

      Hi,

      Is it possible to automatically name a group (or a component) after the layer it is on?

      I understand this should be possible with a fairly simple ruby script. Has anyone come across one?

      Any help would be greatly appreciated.

      Ross

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

        ross, like bmike, all you need is a single statement entered into the Ruby Console.

        Sketchup.active_model.entities.each{|e| e.name=e.layer.name if e.is_a?(Sketchup;;ComponentInstance) || e.is_a?(Sketchup;;Group)}
        
        

        This will give any component instance or group the name of the layer it is on.

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

        http://sdmitch.blogspot.com/

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

          Thanks Sam

          That works a treat. Your help is much appreciated.

          Ross

          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