一些猜测:
- (defun c:q1 ( / LeaveNumbersAndDots txt enx n SS )
- (defun LeaveNumbersAndDots (str)
- (if (and (eq 'STR (type str)) (setq str (vl-remove-if-not '(lambda (c) (<= 46 c 57)) (vl-string->list str))) )
- (vl-list->string str)
- )
- ); defun LeaveNumbersAndDots
- (cond
- ( (not (setq txt (car (entsel "\nPick text with numerical content: "))))
- (alert "\nNothing selected.")
- )
- ( (not (wcmatch (cdr (assoc 0 (setq enx (entget txt)))) "*TEXT"))
- (alert "\nThis is not a text.")
- )
- ( (not (numberp (setq n (read (setq txt (cdr (assoc 1 enx)))))))
- (alert
- (strcat "\nThis text has no full numerical content:
- \nCurrently it is: "" txt ""
- \nIt must be in the following format: "" (cond ((LeaveNumbersAndDots txt)) ("123.4")) ""."
- )
- )
- )
- ( (not (and (princ "\nSelect objects to change their elevation: ") (setq SS (ssget "_:L"))))
- (alert "\nNothing selected.")
- )
- (
- (mapcar
- '(lambda (enx)
- (cond
- ( (assoc 38 enx) (entmod (append enx (list (cons 38 n)))) )
- ( (entmod (mapcar '(lambda (x) (if (member (car x) '(10 11)) (reverse (cons n (cdr (reverse x)))) x) ) enx)) )
- )
- )
- (mapcar 'entget (apply 'append (mapcar '(lambda (x) (if (= 3 (car x)) (list (cadr x)))) (ssnamex SS))))
- )
- )
- ); cond
- (princ)
- ); defun
|