atb1984 Posted August 6, 2018 Author Posted August 6, 2018 Try something like this: (defun c:foo (/ _foo a b s) ;; RJP » 2018-08-02 (defun _foo (b tag f) (vl-some '(lambda (x) (cond ((= (strcase tag) (strcase (vla-get-tagstring x))) (if f (not (vla-put-textstring x f)) (vla-get-textstring x) ) ) ) ) (vlax-invoke b 'getattributes) ) ) (cond ((and (setq s (ssget ":L" '((0 . "insert") (66 . 1)))) (setq s (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))))) ) ;; Enter your tagnames here (foreach tag [color="red"]'(("LINE-ID" "LINE_NO") ("TAGTOGETVALUE" "TAGTOPUTVALUE") ("SERVICE" "SERVICE"))[/color] (if (setq a (vl-some '(lambda (x) (cond ((= "PID-LINE-ID" (strcase (vla-get-effectivename x))) (_foo x (car tag) nil)) ) ) s ) ) (setq b (cons (list a (cadr tag)) b)) ) ) (foreach x s (foreach v b (_foo x (cadr v) (car v)))) ) ) (princ) ) Works perfectly. Once again, thanks for the help! Quote
ronjonp Posted August 6, 2018 Posted August 6, 2018 Works perfectly. Once again, thanks for the help! Glad to help Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.