Component Axes

Component Axes

Postby honkinberry » Tue Sep 10, 2019 10:59 pm

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
0

honkinberry 
 

Re: Component Axes

Postby Dan Rathbun » Fri Sep 13, 2019 7:42 am

FYI, You can change the insertion point insertion_point=.

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

Code: Select all
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)
0
    I'm not here much anymore. But a PM will fire email notifications.
    User avatar
    Dan Rathbun 
    PluginStore Author
    PluginStore Author
     

    Re: Component Axes

    Postby honkinberry » Tue Sep 17, 2019 5:32 pm

    Boom! That worked!
    Thank you sir!

    --J
    0

    honkinberry 
     

    SketchUcation One-Liner Adverts

    by Ad Machine » 5 minutes ago



    Ad Machine 
    Robot
     



     

    Return to Developers' Forum

    Who is online

    Users browsing this forum: No registered users and 4 guests

    Visit our sponsors: