• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

[Plugin] Text Tools

Scheduled Pinned Locked Moved Plugins
5 Posts 2 Posters 13.6k 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.
  • T Offline
    thomthom
    last edited by thomthom 9 Jul 2009, 12:43

    By request of a colleague of mine - he needed to do a search and replace on all Text entities in a model. He had found a plugin that did a search and replace and some more functions - but I only searched the selection or active entities.

    This was a quick bash-up of a script to do the job.

    Plugins -> Text Tools -> Search and Replace…

    Link Preview Image
    SketchUp Plugins | PluginStore | SketchUcation

    SketchUp Plugin and Extension Store by SketchUcation provides free downloads of hundreds of SketchUp extensions and plugins

    favicon

    (sketchucation.com)

    Thomas Thomassen — SketchUp Monkey & Coding addict
    List of my plugins and link to the CookieWare fund

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 9 Jul 2009, 22:06

      Didier Bur did a similar tool some time ago... find_and_replace_text.rb ? In a selection or globally in model...

      TIG

      1 Reply Last reply Reply Quote 0
      • T Offline
        thomthom
        last edited by 9 Jul 2009, 22:25

        @tig said:

        Didier Bur did a similar tool some time ago... find_and_replace_text.rb ? In a selection or globally in model...

        That might have been the script my colleague tried to use.., but it only searched active_entities.

        Thomas Thomassen — SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • T Offline
          TIG Moderator
          last edited by 9 Jul 2009, 23:04

          active_entities are the entities in the current edit of the model, group or definition, so that's equivalent to model.entities if it's in the model. It didn't mine into definitions...

          That gets me thinking of another method - see below... simply filter the array of entities returned for text and change each bit of text to suit - works in the model, inside groups and components etc... useful for any methods where global change of some types of entities is needed - like layer and material manipulation when model is heavily grouped or componentized ?

          =begin
          (c) TIG 2009
          'all_entities.rb' adds a new Method to Sketchup's Model Class - 
          "model.all_entities" - it returns an array of all entities in the model
          i.e. model.entities.to_a + definintion.entities [groups and components]...
          =end
          class Sketchup;;Model
            def all_entities
              model=Sketchup.active_model
              all_entities=model.entities.to_a
              model.definitions.each{|d|d.entities.each{|e|all_entities.push(e)}}
              return all_entities
            end#def
          end#class
          ###
          
          

          TIG

          1 Reply Last reply Reply Quote 0
          • T Offline
            thomthom
            last edited by 10 Jul 2009, 06:11

            We've got such a method in the SKX library.
            That reminds me; I've been meaning to get a first release for SKX out for the stable methods we got.

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

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

            Advertisement