sketchucation logo sketchucation
    • Login
    šŸ¤‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Entity.transform!

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 4 Posters 481 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.
    • Al HartA Offline
      Al Hart
      last edited by

      I have some code which used to use entity.transform!(transformation)

      But this no longer works for faces or edges in SU 2014 and SU 2015. I see that I should probably be using

      entities.transform_entities(transform, ent1, ent2, ent3)

      But, this must have worked once. Did this change in SU 2014?

      Al Hart

      http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
      IRender nXt from Render Plus

      1 Reply Last reply Reply Quote 0
      • S Offline
        slbaumgartner
        last edited by

        Point3d and Vector3d still have #transform! methods. I don't remember ever finding these for Edges or other Entities, though (and I looked while trying to write my plugins back as far as SU 8).

        1 Reply Last reply Reply Quote 0
        • Al HartA Offline
          Al Hart
          last edited by

          Thanks.

          I'll find an old version of SketchUp somewhere and see if it used to work for faces and edges one at a time.

          Al Hart

          http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
          IRender nXt from Render Plus

          1 Reply Last reply Reply Quote 0
          • Dan RathbunD Offline
            Dan Rathbun
            last edited by

            @al hart said:

            I have some code which used to use entity.transform!(transformation)

            No you don't. šŸ˜›

            Sketchup::Entity class is rather high level that contains things like Sketchup::Page and Sketchup::Layer, which cannot be transformed.

            The transform!() immediate instance method has only ever applied to collections of entities, ie Sketchup::Group and Sketchup::ComponentInstance, Array or array-like classes (such as certain virtual object classes in the Geom module.)

            The confusion likely comes from the fact that often people think of Sketchup::Group and Sketchup::ComponentInstance instances as entities, because they are descended from Sketchup::Entity, through Sketchup::Drawingelement.

            It helps to think of them more as a "wrapper" class, that contains an entities collection, and other properties, including the all important transformation.

            I'm not here much anymore.

            1 Reply Last reply Reply Quote 0
            • tt_suT Offline
              tt_su
              last edited by

              @al hart said:

              I have some code which used to use entity.transform!(transformation)
              But this no longer works for faces or edges in SU 2014 and SU 2015.
              But, this must have worked once. Did this change in SU 2014?

              No - Entity.transform! has never been part of the API. If you ever used this you where using some custom method someone modified the API namespace with.

              We've not removed methods from the API and the API docs is the one you should go by in terms of looking up what is part of the API. Anything else is stuff that has been injected. There are the occational debug helper methods that we hooked up, but they are not supported as part of the API.

              1 Reply Last reply Reply Quote 0
              • Al HartA Offline
                Al Hart
                last edited by

                Thanks all.

                I guess my routine must have only been applying .transform! to component instances and groups, and somehow faces and edges slipped in.

                I was reading a .SKP from the disk and scaling thing in different layers differently, and the disk .skp must have changed so that there was a face at the top level of entities.

                Al Hart

                http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
                IRender nXt from Render Plus

                1 Reply Last reply Reply Quote 0
                • tt_suT Offline
                  tt_su
                  last edited by

                  By the way, if you transform multiple entities it's faster to do it in bulk with Entities.transform_entities or Entities.transform_by_vector. Ditto for erasing and selecting - the performance differences between doing this in bulk is significant.
                  Whenever you use erase! or transform! etc or any other single entity action within a loop consider the bulk alternatives.

                  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