0 Members and 1 Guest are viewing this topic.
(defun c:DIL ()(prompt "\npick line for length inquiry ")(setq e1 (car (entsel)))(setq e2 (cdr (assoc 10 (entget e1))))(setq e3 (cdr (assoc 11 (entget e1))))(princ "\nLine length is: ")(setq d1 (rtos (distance e2 e3))))(princ)
(defun c:dil (/ e1 d1) (prompt "\npick line for length inquiry ") (if (setq e1 (entsel)); if something selected (progn (setq e1 (entget(car e1))) (if (= (cdr (assoc 0 e1)) "LINE") (progn (setq d1 (rtos (distance (cdr (assoc 10 e1)) (cdr (assoc 11 e1))))) (prompt (strcat "\nLine length is: " d1) d1 ; return value ) (prompt "\nSelected was not a Line."); returns nil ) ) (prompt "\nNothing selected."); returns nil ) ;;(princ) ;use this if you don't want to return a value) ; end defun(princ)
Command: dilpick line for length inquirySelect object:[b]Line length is: "10'-6\""[/b] this is what I dont understand
this did it thanks all