Request For a Lisp to Clear Attribute value

Request For a Lisp to Clear Attribute value

timothy_crouse
Collaborator Collaborator
398 Views
1 Reply
Message 1 of 2

Request For a Lisp to Clear Attribute value

timothy_crouse
Collaborator
Collaborator

 

I found this lisp but was not able to get it to run even though it states that it has loaded successfully:

https://forums.augi.com/showthread.php?47024-Clear-All-Attribute-Values-In-a-Block

 

***Abdul Hucks Code from Link ***

(defun clearatts (/ blocks numBlocks counter blkref)
  (setq blocks (ssget "x" '((2 . "MyBlockName"))))
  (if blocks 
	(progn
	  (setq numBlocks (sslength blocks)
	 counter   0
	  )
	  (repeat numBlocks
 (setq blkref (ssname blocks counter ))
 (setq blkref (vlax-ename->vla-object blkref))
 (foreach att (vlax-invoke blkref 'getattributes)
   (vla-put-textstring att "")
 )
 (setq counter (1+ counter))
	  )
	)
	(princ "\nNo specific blocks in the drawing!")
  )
  (princ)
)

 

 

The goal is to have the lisp clear attribute values as the user selects them.

I should note the blocks I use are both standard and dynamic blocks (if that makes a difference).

 

FYI ATTWIPE does not seem to work on dynamic blocks.  And I have had no luck finding a lisp other than ATTWIPE.

 

Thanks for considering helping on this if you have time.

Best Regards

-Tim C.

 

0 Likes
Accepted solutions (1)
399 Views
1 Reply
Reply (1)
Message 2 of 2

timothy_crouse
Collaborator
Collaborator
Accepted solution
0 Likes