5
956
963
初来乍到
[color="green"];; Make Angle Readable by: ymg [/color](defun MakeReadable (a) (setq a (rem (+ a pi pi) (+ pi pi))) (rem (if (< (* pi 0.5) a (* pi 1.5)) (+ a pi) a ) (+ pi pi) ) ) (defun _mirror (x / en ie)[color="green"] ;*global variable= s & ip[/color] [color="green"] ;simply calling standard command "mirror" to manipulate or flip the reference annotation[/color] (cons 'progn (list (cons 'setq '(ie 0)) (cons 'repeat (list (sslength s) (cons 'vl-cmdf (list "_.mirror" '(setq en (ssname s ie)) "" (cons 'list ip) (cons 'polar (list (cons 'list ip) x 1.0)) "Y" ) ) (cons 'setq '(ie (1+ ie))) ) ) ) ) ) ;_ end of defun(defun delta (p1 p2 ip / xy id dxy s i a l e);hanhphuc (setq xy '((p) (list (car p) (cadr p))) id (mapcar ''((x) (equal x (apply 'mapcar (cons '>= (mapcar 'xy (list p2 p1)))))) '((T T) (nil T) (nil nil) (T nil)) ) dxy (mapcar '- p1 p2) s (apply ''((txh pt dX dY / ss next ro yd p) (setvar 'osmode 0) (setq yd (getvar 'ucsydir) ro (MakeReadable (if (equal (car yd) 0.0 1e-10) 0.0 (atan (/ (car yd) (cadr yd))) ) ) ) [color="green"] ; Draw arrow by standard command: PLINE [/color] (vl-cmdf "_PLINE" (list (car pt) (+ (cadr pt) (* 2. txh))) "w" 0.0 (* 0.3 txh) (list (car pt) (+ (cadr pt) txh)) "w" 0.0 0.0 pt "w" 0.0 0.0 (list (+ (car pt) txh) (cadr pt)) "w" (* 0.3 txh) 0.0 (list (+ (car pt) (* 2. txh)) (cadr pt)) "" ) ; command (setq next (ssadd)) (foreach ss (vl-list* (entlast) (mapcar ''((a b c d) (entmakex (mapcar 'cons '(0 1 8 10 11 40 50 62 72 73) (list "TEXT" a "DIFF" (setq p (polar (trans pt 1 0) (- b ro) c)) p txh (- d ro) 256 1 2) ) ) ) (list dY dX) (list (* pi 0.5) 0.) (list (* 4.0 txh) (* 4.0 txh)) (list (* pi 0.5) 0.0) ) ; mapcar ) ; vl-list* (ssadd ss next) ) next ) (vl-list* (getvar 'textsize) ip (mapcar ''((f) (rtos (abs (* (f dxy) 1000.)) 2 0)) (list car cadr)) ) ) ) (eval (cons 'cond (vl-list* (list (nth 0 id) T) (mapcar ''((a b)