Jump to content

This routine is to match attributes how can be changed to match text


narendra

Recommended Posts

some body help me to change this to match text not attibutes

 

;(princ "\nType MTB to Run")

(defun C:MTB (/)

(setq baselist (list))

(setq ename (car (entsel "\nSelect Block:")))

(while (= ename nil)

(princ "\nNothing Picked")

(setq ename (car (entsel "\nSelect Block:")))

);end while

(setq ename1 (car (entsel "\nSelect Block To Apply Changes:")))

(while (= ename1 nil)

(princ "\nNothing Picked")

(setq ename1 (car (entsel "\nSelect Block To Apply Changes:")))

);end while

(setq ename (entnext ename))

(setq elist (entget ename)) ;the entity list of the base border

(setq etype (cdr (assoc 0 elist))) ;should be attrib

(while (= etype "ATTRIB") ;puts all the attribute in a list

(setq tag (cdr (assoc 2 elist))) ;the attribute tag

(setq val (cdr (assoc 1 elist)));the attribute value

(setq baselist (append (list (list tag val)) baselist));put the attribute in list

(setq ename (entnext ename)) ;move onto the next attribute

(setq elist (entget ename))

(setq etype (cdr (assoc 0 elist)))

);end while

(setq ename1 (entnext ename1)) ;get the next entity, should be "ATTRIB"

(setq elist1 (entget ename1)) ;the entity list of the border

(setq etype1 (cdr (assoc 0 elist1))) ;should be attrib

(while (= etype1 "ATTRIB")

(setq attval nil)

(setq tag (cdr (assoc 2 elist1)));the attribute tag

(foreach item baselist

(if (= tag (nth 0 item))

(progn

(setq attval (nth 1 item))

);end then

(progn);else do nothing go to next in list till tag matches

);end if

);end foreach

mtb.lsp

Link to comment
Share on other sites

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...