Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LISP to change a specific attribute from a specific block to a specific value

24 REPLIES 24
SOLVED
Reply
Message 1 of 25
Anonymous
28118 Views, 24 Replies

LISP to change a specific attribute from a specific block to a specific value

I've had a simple lisp I've been using for years that suddenly disappeared.  It required that you identify a block name, tag name, and the value that you want the tag to be.  All of this is performed via command line, so it is scriptable.  Since I lost it, I've been experimenting with -attedit.  This command comes frustratingly close to what I'm looking for, except it only appends an existing tag, or replaces a specific string within the tag; I can't get it to replace the entire tag, regardless of its value.

 

1> does anyone have a lisp routine that does what I describe?

 

or

 

2> does anyone know how to make -attedit replace a tag value without regard to what the value currently is (like a * wildcard)?

24 REPLIES 24
Message 21 of 25
Anonymous
in reply to: pbejse

Apology. You are right and code is working fine.
Message 22 of 25
Anonymous
in reply to: Hallex

hi

someone can help me with this please?

i tried to mofidy many existing attributes, i want to put every value into ( )

my bloc name is ANCHOR_ANNO and have  6 attributes

 

GUY1

GUY2

GUY3

GROSSEUR

ANCRE

ECRAT

 

some attributes are empty and i want to skip those attributes if posssible

 

thanks a lot

 

 

Message 23 of 25
Anonymous
in reply to: Anonymous

This reply is probably late.

But you can try

(GLBLATTCHG "ANCHOR_ANNO" "GUY1" "TEST")

 

(GLBLATTCHG "ANCHOR_ANNO" "GUY2" "")

and write a script for it...

 

Message 24 of 25
Anonymous
in reply to: Anonymous

Thanks but i finished my lisp already.
Message 25 of 25
Anonymous
in reply to: pbejse

Is it possible to combine this LISP with Width factor of multiline attribute to get a LISP to update the width of specific attribute tag?

 

(setq s (car (nentsel "\nSelect multiline attribute to change width factor: ")))
(setq x (entget s))
(setq x (subst (cons 41 new_width) (assoc 41 x) x ))
(entmod x)

 

 (GLBLATTCHG "Rectangle" "Tag3" "NewWidth")

 

Thanks,

Charlie

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report