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

Search & Replace Name

Scheduled Pinned Locked Moved Developers' Forum
6 Posts 4 Posters 293 Views
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.
  • A Offline
    alz
    last edited by 10 Apr 2009, 17:58

    Has anyone come across a Search & Replace plugin for component/group names?

    I've got a scene with dozens of objects that need to shift from one # to another # -- it's a real bear going in and doing it manually for all the objects.

    1 Reply Last reply Reply Quote 0
    • R Offline
      remus
      last edited by 10 Apr 2009, 19:06

      Im not sure if it's what your looking for, but if you go to the components window and right click a component there is a 'select instances' (find) option and a 'replace selected' (replace) option.

      http://remusrendering.wordpress.com/

      1 Reply Last reply Reply Quote 0
      • A Offline
        alz
        last edited by 13 Apr 2009, 13:10

        Yeah, I knew about how to replace physical components -- I was looking for a way to rename components. So if I have MyComponent_AB YourComponent_AB in the Outliner, I could rename the _AB to _YZ. Now they'd be called MyComponent_YZ and YourComponent_YZ.

        😄

        1 Reply Last reply Reply Quote 0
        • R Offline
          remus
          last edited by 13 Apr 2009, 14:17

          So you did 👊

          http://remusrendering.wordpress.com/

          1 Reply Last reply Reply Quote 0
          • A Offline
            azuby
            last edited by 13 Apr 2009, 16:16

            Are you familiar with regular expressions?

            azuby

            *error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

            Bad English? PM me, correct me. :smile:**

            1 Reply Last reply Reply Quote 0
            • T Offline
              TIG Moderator
              last edited by 13 Apr 2009, 18:10

              Open the Outliner and Entity-Info windows and dock them together.
              Select the Component Instance in question in the Outliner and its Definition-Name AND Instance-Name appear in the Entity-Info window.
              Edit these as desired.
              Changing the Definition-Name will globally rename the Definition. Each Instance can have its own name too...
              However, if you want to replace parts of names within a set of several definitions' names [like "AB" with "XY"], then to do this globally you need something this:

              ### this does all definitions' AND instances' names; edit 'text_go=/text_in=' to suit...
              text_go="AB";text_in="XY";Sketchup.active_model.definitions.each{|defn|defn.name=defn.name.gsub(text_go,text_in);defn.instances.each{|inst|inst.name=inst.name.gsub(text_go,text_in)}}
              ### remove the defn.name... part to leave them alone OR remove the defn.instances... part to leave them alone...
              
              

              I'll leave you to make the app/menu etc...

              TIG

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              1 / 1
              • First post
                3/6
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement