;;; Measure LINEs, SPLINEs, LWPOLYLINEs and POLYLINEs by user selected aligned Block
;;; Saved from: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-routine-using-the-measure-command/td-p/5562007

(defun c:meb (/ blk ss l name)
; TharwaT 04. 04. 2011
(if
(and (setq blk (entsel "\nSelect Block:"))
(princ "\nSelect Objects to Measure: ")
(setq ss (ssget "_:L" '((0 . "LINE,SPLINE,LWPOLYLINE,POLYLINE"))))
(setq l (getdist "\nDistance between Blocks :"))
)
(progn
(setq name (cdr (assoc 2 (entget (car blk)))))
((lambda (i / ss1)
(while
(setq ss1 (ssname ss (setq i (1+ i))))
(command "_.measure" ss1 "Block" name "_Y" l)
)
)
-1
)
)
(princ)
)
(princ)
)
(c:meb)

Advertisements