Hi Jamie,
Good question. I don't have time for a decent reply right now. Maybe these functions
by Doug will shed some light.
I'm not sure if you mean transform points or objects. But a 4x4 matrix can be used to
transform either one.
Joe Burke
;; by Doug C. Broad, Jr.
;; can be used with vla-transformby to
;; transform objects from the UCS to the WCS
(defun UCS2WCSMatrix ()
(vlax-tmatrix
(append
(mapcar
'(lambda (vector origin)
(append (trans vector 1 0 t) (list origin))
)
(list '(1 0 0) '(0 1 0) '(0 0 1))
(trans '(0 0 0) 0 1)
)
(list '(0 0 0 1))
)
)
)
;; transform objects from the WCS to the UCS
(defun WCS2UCSMatrix ()
(vlax-tmatrix
(append
(mapcar
'(lambda (vector origin)
(append (trans vector 0 1 t) (list origin))
)
(list '(1 0 0) '(0 1 0) '(0 0 1))
(trans '(0 0 0) 1 0)
)
(list '(0 0 0 1))
)
)
)
;; Example: transform an object from the current UCS to
;; WCS. Note, the UCS that the object is drawn in must
;; be current for this to work as expected.
; (defun c:test (/ ent obj)
; (setq ent (car (entsel))
; obj (vlax-ename->vla-object ent))
; (vla-transformby obj (UCS2WCSmatrix))
; (vla-update obj)
; )
wrote in message news:5388910@discussion.autodesk.com...
I currently use an entmake call to make simple blocks
I take of the ucs issue as follows:
(trans pt 10)
(steq angb (angle '( 0.0 0.0 0.0) (getvar "UCSXDIR")))
this works fine if the ucs is a simple rotation around the z axis - the most common
use. How do I change the entmake so that it can accommodate UCS's that are not
parallel to the ucs world plane?
PJ