Good evening,
Could someone point me in the direction of getting a boundingbox for some attributed text in a block
It's been a while since I last wrote a lithp and I've forgotten a lot. Jeff helped me put something together several months ago for a different project, so I've been doing some cut-n-paste actions to get this started, but I can't do lithp anymore. Gotta start all over.
So anyways, this is what I have so far:
(defun c:km (/ )
(vl-load-com)
(setq cdwg (vla-get-activedocument (vlax-get-acad-object));get the drawing
mspace (vla-get-modelspace cdwg);get modelspace
blks (vla-get-blocks cdwg);get the blocks collection
)
(setq blok (nentsel))
;;;;; I know I need to convert something here
;;;;; and if the block is rotated 45 or 60 degrees, there's another action needed.
(vla-getboundingbox blok 'll 'ur);get the block's physical limits
(setq ll (vlax-safearray->list ll ));convert lower left corner to a list
(setq ur (vlax-safearray->list ur ));convert upper right corner to a list
;create a point list a little lower & longer than the actual text position
(setq pt1 (list (- (car ll) 0.0625) (- (cadr ll) 0.0625) (caddr ll)))
(setq pt2 (list (+ (car ur) 0.0625) (- (cadr ll) 0.0625) (caddr ur)))
(command "rectang" pt1 pt2)
)
thanks,