Visual LISP, AutoLISP and General Customization

Distinguished Contributor
Posts: 164
Registered: ‎04-09-2008
Message 1 of 2 (251 Views)

Rotating a table to current UCS

251 Views, 1 Replies
09-12-2012 11:50 AM

Tables do no have a rotation angle. I can find the insert point, but there is no other point to make an angle calculation with. 


(setq objTable (vlax-ename->vla-object (car (entsel))))

(vlax-dump-object objTable T)

Valued Contributor
Posts: 84
Registered: ‎02-07-2001
Message 2 of 2 (237 Views)

Re: Rotating a table to current UCS

09-13-2012 02:34 AM in reply to: Redraiderr2009

You may use vla-TransformBy with the UCS's transformation matrix.

To get the UCS transformation matrix it mus be a NAMED UCS.

This is a very simple example, it supposes your UCS is named previously:

(defun align-table  (/ table mtrans)
  (setq table (vlax-ename->vla-object
                (car (entsel "\nSelect Table:"))))
  (setq mtrans
             (vla-get-activedocument (vlax-get-acad-object)))))
  (vla-TransformBy table mtrans))


You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community