sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    Is there a way to "define the scale" of a group of objectsin SketchUp?

    Scheduled Pinned Locked Moved Unsolved Extensions & Applications Discussions
    5 Posts 2 Posters 57 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.
    • alexpacio2013A Offline
      alexpacio2013
      last edited by Rich O Brien

      Is there a way to "define the scale" of a group of objects or multiple selected components simultaneously, with the option to also scale nested objects and components? For me, it’s a useful command, but I haven’t found a solution.

      1 Reply Last reply Reply Quote 0
      • alexpacio2013A Offline
        alexpacio2013
        last edited by

        I’m not a programmer, and I don’t know Ruby. I tried using artificial intelligence to create a plugin, and it works, but only on main objects and components, not on nested ones.

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

          If your AI is clever enough. you need to ask it how to process the entities inside definitions [i.e. components and groups] using an iteration...

          TIG

          alexpacio2013A 1 Reply Last reply Reply Quote 0
          • alexpacio2013A Offline
            alexpacio2013 @TIG
            last edited by

            @TIG I didn't manage to do it. In your opinion it's not a useful function. I would need it. there is a solution

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

              I'm not AI.
              BUT I'll outline the steps for you...

              Run these snippets in the Ruby Console.

              1. Find all 'containers' [i.e. groups and component-instances].

              2. Decide if you want to process all of them in your model. OR those in a selection. Here are the two ways a and b.

              3a. #code

              model = Sketchup,active_model
              containers = model.definitions.to_a #an array of ALL groups and component definitions, including any nested ones.
              

              OR
              3b. #code

              model = Sketchup,active_model
              selection = model.selection
              containers = [] #an empty array
              selection.each{|e|
                next if ! e.is_a?(Sketchup::Group) || ! e.is_a?(Sketchup::ComponentInstance)
                containers << e.definition
              }
              containers.uniq! #ignore duplicates
              #containers is now an array of selected groups and component-instances' definitions, BUT not any that are nested.
              
              1. #use puts to see the results, e.g.
              puts containers
              

              Process [scale ?] the array of the 'containers' as you desire... one at a time e.g.

              containers.each{|e|
                # whatever...
              }
              

              TIG

              1 Reply Last reply Reply Quote 0
              • Rich O BrienR Rich O Brien marked this topic as a question
              • 1 / 1
              • First post
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement