• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

Plug In - Copy to Path troubles

Scheduled Pinned Locked Moved Developers' Forum
9 Posts 4 Posters 373 Views 4 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.
  • A Offline
    arcaterra
    last edited by 6 Jan 2010, 02:34

    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

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 6 Jan 2010, 07:04

      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)

      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 6 Jan 2010, 10:42

        ... 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

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 6 Jan 2010, 11:16

          @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.

          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 6 Jan 2010, 11:18

            @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_unique on a version so that the original is unchanged by any Scaling you do to that...

            TIG

            1 Reply Last reply Reply Quote 0
            • N Offline
              nikusknx
              last edited by 24 Oct 2012, 09:38

              Is it possible to do the "right-click scale definition" with Sketchup api?

              1 Reply Last reply Reply Quote 0
              • T Offline
                thomthom
                last edited by 24 Oct 2012, 10:23

                @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.

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

                1 Reply Last reply Reply Quote 0
                • N Offline
                  nikusknx
                  last edited by 24 Oct 2012, 12:22

                  @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
                        end
                  
                  

                  Any idea?

                  1 Reply Last reply Reply Quote 0
                  • N Offline
                    nikusknx
                    last edited by 26 Oct 2012, 08:57

                    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) end

                    but 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?

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

                    Advertisement