Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;|------------------------------|;
- ;| AG Room Dimensions |;
- ;| www.ArthurGanem.com |;
- ;|------------------------------|;
- ; Command: RMDIM
- (defun c:rmdim (/ pt1, pt2, pt3, txtpt, horizdist, vertdist, fthorizdist, inhorizdist, ftvertdist, invertdist, txtstr)
- (setq pt1 (getpoint "\nClick on the corner of the room -->"))
- (setq pt2 (getpoint "\nClick on the diagonally opposite corner of the room -->"))
- (setq pt3 (list (car pt1) (cadr pt2) 0.0))
- (setq txtpt (getpoint "\nClick where you want to place the label -->"))
- (setq horizdist (distance pt3 pt2))
- (setq vertdist (distance pt1 pt3))
- (setq fthorizdist (fix (/ horizdist 12)))
- (setq inhorizdist (fix (rem horizdist 12)))
- (setq ftvertdist (fix (/ vertdist 12)))
- (setq invertdist (fix (rem vertdist 12)))
- (setq txtstr (strcat (itoa fthorizdist) "'-" (itoa inhorizdist) "\"x" (itoa ftvertdist) "'-" (itoa invertdist) "\"" ))
- (vl-load-com)
- (setq mspace (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))
- (setq txtobj (vla-addtext mspace txtstr (vlax-3d-point txtpt) 4.5))
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement