Quantcast
Channel: Autodesk India Community aggregator
Viewing all articles
Browse latest Browse all 1680

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: substituting attributes

$
0
0

This is more of a training exercise for me.  I hope to someday use it but for now could someone help with with the following:

 

I isolated 3 attributes as you can see with my code.  My object is too take the value of blkDESC1 and set it as blktag, and then take blkDESC2 and set it as blkDESC1, and erase blkDESC2.  Any ideas?

 

(defun c:aup (/ dxf ent dxf1 ent1) (defun dxf (code ent) (cdr (assoc code (entget ent))))

(progn    (if  (and (setq ent (car (entsel "\nSelect an Attributed Block: ")))     

  (eq "INSERT" (dxf 0 ent))     

  (= 1 (dxf 66 ent)))      

  (while  (not (eq "TAG1" (dxf 2 (setq ent (entnext ent)))))             )          )  

  (setq blktag (dxf 1 ent))  

  (princ "\n")

(princ blktag)

(princ)

(while  (not (eq "DESC1" (dxf 2 (setq ent (entnext ent)))))             )   

 (setq blkDESC1 (dxf 1 ent))

(princ "\n")

(princ blkDESC1)

(princ)   

  (while  (not (eq "DESC2" (dxf 2 (setq ent (entnext ent)))))             )

(setq blkDESC2 (dxf 1 ent))

(princ "\n")

(princ blkDESC2)

(princ)

 

 


Viewing all articles
Browse latest Browse all 1680

Trending Articles