Try this Andy and let me know .
UNTESTED .
- (defun c:Test (/ ss) ;; Tharwat 09.July.2014 ;; (if (setq ss (ssget "_X" '((0 . "INSERT") (2 . "C1-PNT5") (66 . 1)))) ((lambda (i / sn o z p e) (while (setq sn (ssname ss (setq i (1+ i)))) (foreach x (vlax-invoke (setq o (vlax-ename->vla-object sn)) 'GetAttributes) (if (and (eq (strcase (vla-get-tagstring x)) "Z") (numberp (read (setq z (vla-get-textstring x)))) (vlax-write-enabled-p o) ) (entmod (subst (cons 10 (list (car (setq p (cdr (assoc 10 (setq e (entget sn)))))) (cadr p) (atof z))) (assoc 10 e) e ) ) ) ) ) ) -1 ) ) (princ))(vl-load-com)
Note: I assumed that the name of the block is marker , so if it is not correct , just change the name that is at the top of the routine . |