Dynamic Block Attribute Value to string and insertion of new block at dynamic block insertion point

Dynamic Block Attribute Value to string and insertion of new block at dynamic block insertion point

CDeSoto_783Q5NH6S8XS
Explorer Explorer
601 Views
11 Replies
Message 1 of 12

Dynamic Block Attribute Value to string and insertion of new block at dynamic block insertion point

CDeSoto_783Q5NH6S8XS
Explorer
Explorer

Please help, I am wanting a lisp routine that can do the following through a separate script without user input. 

 

1) Check for name of Dynamic block in drawing (could be one of many names, all block names will have a state in the name)

2) Set a (setq) based on the state in the above block

3) Get the value of the attribute "Licensee" of the above dynamic block

4) Insert new block based on the state from (2) and the value of (3) at the insertion point of the dynamic block.

 

I have some lisp ability, so if you can give me a basic lisp or one with descriptions, I can fill in information as required. 

 

Thanks in advance for any help on this. 

 

0 Likes
602 Views
11 Replies
Replies (11)
Message 2 of 12

CDeSoto_783Q5NH6S8XS
Explorer
Explorer

Should have put in here that I will work on the script separately. I am currently only seeking the lisp routine. 

0 Likes
Message 3 of 12

ВeekeeCZ
Consultant
Consultant

Post some dwg sample and explain what you mean by "state in the name"

0 Likes
Message 4 of 12

CDeSoto_783Q5NH6S8XS
Explorer
Explorer

I have attached the current routine that I created. This routine takes user input to select the seal block to be inserted. I want to remove the user input and use the information provided in the attributes of the dynamic block.

CDeSoto_783Q_0-1677092710162.png

 

Name Examples:

Dynamic Block:

PE Block Stamp 2021 - Louisiana

PE Block Stamp 2021 - Texas

 

Insertion Blocks

 

0 Likes
Message 5 of 12

ВeekeeCZ
Consultant
Consultant

OK, then you need no help.

 

Just a tip for you. If you learn to use (dumpallproperties (car (entsel))) and get/setpropertyvalue functions HERE you can simplify your code tremendously.

0 Likes
Message 6 of 12

CDeSoto_783Q5NH6S8XS
Explorer
Explorer

I do need help. I am not sure how to query the dynamic block for attribute values to take the place of the user input variables. What I am trying to accomplish is for the dynamic block to change visibility, which is does with the routine, then insert the new block at the insertion point of the dynamic block (PE BLOCK STAMP *). I can input the values and variables as required in the routine. I just can't write the routine itself to accomplish those things. 

0 Likes
Message 7 of 12

ВeekeeCZ
Consultant
Consultant

Told you, with (getpropertyvalue ename "Licensee") it's that simple. 

0 Likes
Message 8 of 12

CDeSoto_783Q5NH6S8XS
Explorer
Explorer

Okay, I will make that change. Thanks for the help.

0 Likes
Message 9 of 12

CDeSoto_783Q5NH6S8XS
Explorer
Explorer

CDeSoto_783Q_0-1677095125227.png

I input the code as shown, but I am getting "error: ADS request error"

0 Likes
Message 10 of 12

ВeekeeCZ
Consultant
Consultant

Just wondering whether you actually saved the entity name of your block in that ename variable.

Anyways, pretty sure that you'll figure it out.

Good luck.

0 Likes
Message 11 of 12

CDeSoto_783Q5NH6S8XS
Explorer
Explorer

I thought I got an email asking if I haad figured this out. I have not, and not had much time to look at it honestly. I would greatly appreciate some more help on how to call this exactly. 

0 Likes
Message 12 of 12

Sea-Haven
Mentor
Mentor

Get a copy of Lee-mac dynamic block properties lisp. It does not use get & set property, rather VL to get properties etc. Visibilty is one of the functions.

0 Likes