sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    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

      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
      • thomthomT Offline
        thomthom
        last edited by

        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
        • TIGT Offline
          TIG Moderator
          last edited by

          ... 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
          • thomthomT Offline
            thomthom
            last edited by

            @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
            • TIGT Offline
              TIG Moderator
              last edited by

              @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
              • nikusknxN Offline
                nikusknx
                last edited by

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

                1 Reply Last reply Reply Quote 0
                • thomthomT Offline
                  thomthom
                  last edited by

                  @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
                  • nikusknxN Offline
                    nikusknx
                    last edited by

                    @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
                    • nikusknxN Offline
                      nikusknx
                      last edited by

                      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