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

    Component Axes

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 7.6k Views 2 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.
    • H Offline
      honkinberry
      last edited by

      When I create a component via .add_group and then .to_component, the component axes are set to the lower left extremities. Meanwhile, making a component via the Edit menu, I can specify the Component Axes in the dialog.
      How can I set or move the component axes when I create the definition via Ruby?

      Many thanks for any assistance!

      --J

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

        FYI, You can change the insertion point insertion_point=.

        You can also apply a transform to the entire entities of the definition ...

        
        ctr = cdef.bounds.center # Center of untransformed bounds
        # Arrays are compatible with translational transformations;
        xform = [ctr.x, ctr.y, 0].vector_to(ORIGIN)
        cdef_ents = cdef.entities
        # Move all the entities so that the axis is in the bottom center;
        cdef_ents.transfrom_entities(xform, cdef_ents.to_a)
        
        

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • H Offline
          honkinberry
          last edited by

          Boom! That worked!
          Thank you sir!

          --J

          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