(and (setq s (ssget '((0 . "TEXT"))))
(foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
(setq ee (entget e)
ss ((lambda(s / e s1 ss)
(setq s (vl-string->list s))
(setq ss "")
(foreach e s
(setq ss (strcat ss (if (<= 48 e 57)(chr e)" ")))
)
(strcat "周长="(rtos (* 1e-3 (* 2.0 (apply '+ (read (strcat "("ss")")))))2 2)"米")
)
(cdr (assoc 1 ee))
)
p (polar (cdr (assoc 10 ee))(- (cdr (assoc 50 ee)) (* pi 0.5))(* 1.2 (cdr (assoc 40 ee))))
)
(entmakex
(progn
(setq ee (subst (cons 1 ss)(assoc 1 ee)ee))
(subst (cons 10 p)(assoc 10 ee)ee)
)
)
(vla-put-Color (vlax-ename->vla-object (entlast))1)
)
)
)波总代码
页:
1
[2]