Using lisp to insert block with attribute then change the value of the attribute (PROBLEM)

Using lisp to insert block with attribute then change the value of the attribute (PROBLEM)

Kevin.Soares.Coutinho
Participant Participant
2,423 Views
4 Replies
Message 1 of 5

Using lisp to insert block with attribute then change the value of the attribute (PROBLEM)

Kevin.Soares.Coutinho
Participant
Participant

I'm facing a problem with an autolisp code, that used to work just fine before changing my computer, the line of code is the following:

 

(command "-insert" "C:/Users/Kevin/Documents/AutoCAD/block.dwg" "s" "1" "0,0" "0" VARIABLE)

 

This command inserts a specific block from a directory, then set the scale to 1, the position to 0,0, the rotation to 0 and then sets the value of the attribute to the value contained in the variable, the problem is that after changing my computer, i cannot change the value of the attribute like this anymore, everytime i run this line, after placing the block, a window open asking me to input the value of the attribute.

 

This is probably a problem about the configuration, not the code, since it was working just fine after changing my computer.

 

 

0 Likes
Accepted solutions (2)
2,424 Views
4 Replies
Replies (4)
Message 2 of 5

hak_vz
Advisor
Advisor
Accepted solution

 the problem is that after changing my computer, i cannot change the value of the attribute like this anymore, every time I run this line, after placing the block, a window open asking me to input the value of the attribute.


Check this link about variable ATTDIA

Run same name command and set it to 0

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 3 of 5

pbejse
Mentor
Mentor
Accepted solution

@Kevin.Soares.Coutinho wrote:

I'm facing a problem with an autolisp code, that used to work just fine ..


Ensure ATTREQ is 1 and ATTIDA is 0 by including this line on the lisp code

(setq atr (getvar 'Attreq) atd (getvar 'Attdia))
(setvar 'Attreq 1)
(setvar 'Attdia 0)
...
(command "-insert" "block" "s" "1" "0,0" "0" VARIABLE)
...
(setvar 'Attreq atr)
(setvar 'Attdia atd)

HTH

Message 4 of 5

Kevin.Soares.Coutinho
Participant
Participant
Thank you, it worked!
0 Likes
Message 5 of 5

Kevin.Soares.Coutinho
Participant
Participant
Thank you, it worked!