Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/25/2020 in all areas

  1. As dlanorh correctly suggests, trans is the key function here - perhaps consider something along the lines of the following: (defun c:drl ( / *error* ang dis ent enx ins lvl ocs osm pt1 pt2 slp ) (defun *error* ( msg ) (if (= 'int (type osm)) (setvar 'osmode osm)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (princ) ) (setq osm (getvar 'osmode) ocs (trans '(0.0 0.0 1.0) 1 0 t) ang (angle '(0.0 0.0) (trans (getvar 'ucsxdir) 0 ocs t)) dis (lambda ( a b ) (distance (list (car a) (cadr a)) (list (car b) (cadr b)))) ) (while (progn (setvar 'errno 0) (setq ent (car (entsel "\nSelect starting level text: "))) (cond ( (= 7 (getvar 'errno)) (princ "\nMissed, try again.") ) ( (null ent) nil ) ( (/= "TEXT" (cdr (assoc 0 (setq enx (entget ent))))) (princ "\nThe selected object is not text.") ) ( (not (setq lvl (distof (cdr (assoc 1 enx)) 2))) (princ "\nThe selected text does not have numerical content.") ) ( (progn (initget 6) (setq slp (cond ((getreal "\nSpecify slope in decimal <0.01>: ")) (0.01)) lvl (* 1000.0 lvl) ) (setvar 'osmode 695) (setq pt1 (getpoint "\nSpecify first point: ")) ) (while (and (setq pt2 (getpoint "\nSpecify next point <exit>: " pt1)) (setq ins (getpoint "\nSpecify text insertion <exit>: ")) ) (setq lvl (- lvl (* (dis pt1 pt2) slp))) (entmake (list '(000 . "TEXT") (cons 010 (trans ins 1 ocs)) (cons 001 (strcat "IL " (rtos (/ lvl 1000.0) 2 3) "M")) (assoc 40 enx) (cons 050 ang) (cons 210 ocs) ) ) (setq pt1 pt2) ) nil ) ) ) ) (setvar 'osmode osm) (princ) )
    1 point
×
×
  • Create New...