Kerry,
You're welcome.
Maybe off-topic a bit, but I'm often impressed with how the TransformBy method can be used.
Example, bear wtih me whiile I explain. I was recently given a set of architectural drawings done by another firm. The site plan contained xrefs to multiple buildings. Unlike what you'd expect, the xrefs of the buildings were not inserted at 0,0 and they were rotated. IOW, the site plan looked right, but the data contained in the source building xrefs had not been changed. Basically, someone applied a band-aide. Not the proper fix which involves moving and rotating the data in many xref floor plans. Which also happen to contain nested/attached xrefs.
Given this mess my solution was something like this.
(defun c:GetMatrix ( / elst)
(while
(not (setq elst (nentselp "\nSelect object in primary block: ")))
)
(print (vlax-get (vlax-ename->vla-object (last (last elst))) 'Name))
(vl-bb-set '%matrix% (caddr elst))
(princ)
) ;end
;------------------------------------
;shortcut
(defun c:GM () (c:GetMatrix))
;------------------------------------
(defun c:ApplyMatrixModelSpace ( / matrix tmat)
(if
(and
(setq matrix (vl-bb-ref '%matrix%))
(setq tmat (vlax-tmatrix matrix))
)
(vlax-for x *mspace*
(vla-transformby x tmat)
)
)
(princ)
) ;end
;------------------------------------
;shortcut - apply matrix to model space
(defun c:AMM () (c:ApplyMatrixModelSpace))
;------------------------------------
(defun c:ApplyMatrixSS ( / matrix tmat lst)
(if
(and
(setq matrix (vl-bb-ref '%matrix%))
(setq tmat (vlax-tmatrix matrix))
(setq lst (SSVLAList (ssget)))
)
(foreach x lst
(vla-transformby x tmat)
)
)
(princ)
) ;end
;------------------------------------
;shortcut - apply matrix to selecton set
(defun c:AMS () (c:ApplyMatrixSS))
;------------------------------------
Given those functions, I was able to derive the transformation matrix from the site plan for each building. Then open each of the floor plans and transform the objects with one function, either all in model space, or by selection. That distinction because the sheet files which contained notes and dimensions could also be fixed in a similar fashion using the same matrix.
The alternative, standard methods, would have been time consuming and error prone.
EDIT: Sorry, Joe, just took your trailing comments out of the code tags