Jump to content

Select Similar multileader contents


rcb007
 Share

Recommended Posts

I found a routine that can select similar multileaders that have the same attributed block values.

 

I am having a hard time changing it from recognizing the block to just the mtext contents.

 

It would be neat if it could do both (When selecting any help leader with an attribute or just the mtext).

 

Thank you for the help.

(defun c:Test ( / ent enx val )
   (while
       (progn
           (setvar 'errno 0)
           (setq ent (car (entsel "\nSelect mleader: ")))
           (/= 52 (getvar 'errno))
       )
       (cond
           (   (null ent)
               (princ "\nMissed, try again.")
           )
           (   (/= "MULTILEADER" (cdr (assoc 0 (setq enx (entget ent)))))
               (princ "\nSelected object is not a multileader.")
           )
          ; (   (/= acblockcontent (cdr (assoc 172 (reverse enx)))) ;;;;;<<<<<--------- Original Code
          ;     (princ "\nSelected multileader does not contain an attributed block.")
          ; )
          (   (/= acmtextcontent (cdr (assoc 172 (reverse enx))))
              (princ "\nSelected multileader does not contain any values.")
          )
           (   (null (setq val (vl-remove-if-not '(lambda ( x ) (and (= 302 (car x)) (wcmatch (cdr x) "~*[~0-9]*"))) (member '(301 . "}") enx)))) ;;;;;<<<<<--------- Not sure how to change this to look for the mtext values
               (princ "\nMultileader attributes do not contain integer values.") ;;;;;<<<<<--------- Not sure how to change this to look for the mtext values
           )
           (   (null (sssetfirst nil (ssget "_A" (list '(0 . "MULTILEADER") (assoc 8 enx) (car val))))))
       )
   )
   (princ)
)

 

 

 

Edited by rcb007
Link to comment
Share on other sites

  • 8 months later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...