Plug In - Copy to Path troubles
-
Hi
Everytime I scale a component down, and then try use Copy to Path > Copy to Spacing, what get's copied is the component at its original insertion size, and the scaled down version remains untouched. Is there something I am doing wrong?
Thanks -
the copy to path doesn't take into account the scale. Scale Definition before you Copy to Path.
(I'm moving his to the Developer section)
-
... so, Scale the contents [i.e. during an Edit of an Instance] of a 'made_unique' version of that Component before using that with
Copy to Path- then it'll work as wanted... -
@tig said:
... so, Scale the contents [i.e. during an Edit of an Instance] of a 'made_unique' version of that Component before using that with
Copy to Path- then it'll work as wanted...If you edit the content of the component you'll affect all other instances. What if you have instances of different scvale?
If you Right-Click and choose Scale Definition then it won't affect the rest of your component - it just redefines the default size. -
@thomthom said:
@tig said:
... so, Scale the contents [i.e. during an Edit of an Instance] of a 'made_unique' version of that Component before using that with
Copy to Path- then it'll work as wanted...If you edit the content of the component you'll affect all other instances. What if you have instances of different scvale?
If you Right-Click and choose Scale Definition then it won't affect the rest of your component - it just redefines the default size.That's why I suggested using
make_uniqueon a version so that the original is unchanged by any Scaling you do to that... -
Is it possible to do the "right-click scale definition" with Sketchup api?
-
@nikusknx said:
Is it possible to do the "right-click scale definition" with Sketchup api?
Take the scale of the instance, scale the definition by this scale - then scale the instances by the inverse scaling transformation.
-
@thomthom said:
@nikusknx said:
Is it possible to do the "right-click scale definition" with Sketchup api?
Take the scale of the instance, scale the definition by this scale - then scale the instances by the inverse scaling transformation.
Ok its seems to work but the position of instances are not good : I do this to scale the instances by the inverse scaling transformation :
definition.entities.transform_entities(t,self.entities.to_a) inv = t.inverse definition.instances.each do |instance| instance.transform! inv endAny idea?
-
Ok I get the good position with a translate:
definition.instances.each do |instance| originBefore = instance.transformation.origin instance.transform! inv tr = instance.transformation vectorTranslate = originBefore - instance.transformation.origin translate = Geom::Transformation.translation(vectorTranslate) instance.transform!(translate) endbut when the axes changes (y axes become z axis for exemple) the scale are not good and switch...
I try to get the model.edit_transform , manualy I can get it but with the API it's always the same problem : I can't do the right click Component edit...
Any Idea to get the local axes?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement