Small question about rescaling components
-
Hello fellow scripters,
I found this script called: 'scale_reinit.rb'.
The script reinitializes the scale of scaled components.Download: http://forums.sketchucation.com/download/file.php?id=12605
Discussion: http://forums.sketchucation.com/viewtopic.php?f=323&t=11552&hilit=reset+scale,
edit : picture updated
I'm not sure how the script works, but the components are placed in the wrong manner (see image)..
I suppose it's a small effort to correct this..Any help is appreciated..
-
liquid, You might give my Resize and Rename plugin a try.
-
Yes it works! Thanks, Sam.
The only thing is that I have to adapt the plugin to work with more components at once!
-
What are you trying to do. Scale up all component definitions in a model? if so
mod = Sketchup.active_model ent = mod.entities sel = mod.selection defs = mod.definitions defs.each{|d| tr=Geom;;Transformation.scaling(2.0)#2X scale factor d.entities.transform_entities(tr,d.entities.to_a) }
Of course scaling any one instance scales all instances of the the same component.
-
Sam,
Yeah that's also a nice solution to my problem.
But then I have to work with certain scale-factors...
'scale_reinit.rb' is more hassle free. I updated the image above to make my question more clear. Hope you understand .
-
You just want the native "Reset Scale" feature to work with more than one component at a time, right?
-
That seems to be goal Chris as I understand the problem. I have been looking at scale_reinit and there are two problems with it as I see. First, you have to have all the components selected before loading the script other wise it is not added to the context menu. Second, the scaled components aren't rescaled, they are replaced with an insertion point of corner(0) or lower left of the bounding box which is exactly where the demo model shows it.
-
@ Chris,
@chris fullmer said:
You just want the native "Reset Scale" feature to work with more than one component at a time, right?
Yep that's right!
edit
So is it possible to call the native "Reset Scale" command from a script, and apply it to component_1.. component_i in the model? -
did this ever got resolved?
-
@guntis.rat said:
did this ever got resolved?
Apparently not, at least as far as the free version of Sketchup is concerned. The Reset Scale option is available in the context menu if only one component is selected.
You are welcome to try my plugin, Scale Reset, which seems to have been the solution for the problem liquid98 had.
Advertisement