jr.roberto.santos Posted June 13, 2022 Author Posted June 13, 2022 @ronjonp Hi, I would like to select multiple attributes in one area (example ssget :L) and automatically select all duplicate tags based on the selected attributes. can you give me some help? Reference: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selecting-a-block-by-its-attribute-value/td-p/2195298 (defun c:ssatt (/ att elst tag val ss1 ss2 n ent) (and (setq att (car (nentsel "\nSelect source attribute: "))) (setq elst (entget att)) (setq tag (cdr (assoc 2 elst)) val (cdr (assoc 1 elst)) ss2 (ssadd) ) (setq ss1 (ssget "_X" (list '(0 . "INSERT") (assoc 2 (entget (cdr (assoc 330 elst)))) ) ) ) (repeat (setq n (sslength ss1)) (setq ent (ssname ss1 (setq n (1- n))) att (entnext ent) ) (while (= (cdr (assoc 0 (setq elst (entget att)))) "ATTRIB") (if (and (= (cdr (assoc 2 elst)) tag) (= (cdr (assoc 1 elst)) val) ) (ssadd ent ss2) ) (setq att (entnext att)) ) ) (sssetfirst nil ss2) ) (princ) ) ;; Expected outcome. Select more than one attribute. ;;Compare selected and duplicate attributes. DUPLICATED_SELECT.avi 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.