Is there a way to "define the scale" of a group of objectsin SketchUp?
-
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.
-
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.
-
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 I didn't manage to do it. In your opinion it's not a useful function. I would need it. there is a solution
-
I'm not AI.
BUT I'll outline the steps for you...Run these snippets in the Ruby Console.
-
Find all 'containers' [i.e. groups and component-instances].
-
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. #codemodel = 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.- #use puts to see the results, e.g.
puts containersProcess [scale ?] the array of the 'containers' as you desire... one at a time e.g.
containers.each{|e| # whatever... } -
-
R Rich O Brien marked this topic as a question
Advertisement