It's possible move a position block with tag attribute?

It's possible move a position block with tag attribute?

Anonymous
Not applicable
650 Views
7 Replies
Message 1 of 8

It's possible move a position block with tag attribute?

Anonymous
Not applicable

I'm executing a project where i need add blocks at specific coordinates. These blocks represent the position of lampposts.

I have a spreadsheet with the coordinates of all blocks. Is it possible to add an attribute to move all blocks with one command? Or create a lisp? I know that's possible, but i don't how to do it.

 

Sorry for the English, I'm translating from Portuguese.

0 Likes
Accepted solutions (2)
651 Views
7 Replies
Replies (7)
Message 2 of 8

fkp7057
Advocate
Advocate

Yes, It is possible.

can I have your coordinates list and block name which are going to use as lamp post?

0 Likes
Message 3 of 8

fkp7057
Advocate
Advocate
Accepted solution

fkp7057_0-1636715473607.png

PFA Excel I have prepared for you here you just need to update X-Y coordinates in Column E & F,

Change Block name in Column D (Replace your block name with S1).
Then copy data that are in the I column (Exclude column header).

Then paste in Column J using  " Past as value".

Then again column J data Just paste in your Script file. the sample Script file is attached here for your reference.

Copy below code and past it in notepad and save as Insert.scr file.

 

-INSERT
S1 50,45 1  0 
S1 30,21 1  0 
S1 50,33 1  0 
S1 556,54 1  0 
S1 44,87 1  0 
S1 89,22 1  0 
S1 9,25 1  0 

 

In the above code, I have pasted data which are in column J.

 

after everything is done just drag that Insert.scr file in your AutoCAD window. it will insert block as per your cordinates.

Hope this will help you.

 

Message 4 of 8

Anonymous
Not applicable

My blocks contain attributes, so when the script add a block the "Edit Attribute" box opens and the script doesn't work well.

After I used a script to insert points at defined coordinates (identical to how you did) and a lisp to exchange the points for blocks. This lisp insert blocks without attributes, finally, i sync attribute for all blocks.

This worked, but it's still a bit of work.

0 Likes
Message 5 of 8

fkp7057
Advocate
Advocate

Can I have at least one block or a similar kind of block?

I have tested a block that contains attributes, but it didn't open any edit attributes dialog box.

Maybe a little modification on the script may solve this problem.

0 Likes
Message 6 of 8

Anonymous
Not applicable

I'm using this block. editAttributes.png

 That's the dialog box.

 

0 Likes
Message 7 of 8

fkp7057
Advocate
Advocate
Accepted solution

Set Autocad variable "ATTREQ" as 0.

then this dialog box will not appear.

 

Check Link below

https://knowledge.autodesk.com/support/autocad/troubleshooting/caas/sfdcarticles/sfdcarticles/Enhanc...

Message 8 of 8

Anonymous
Not applicable

Amazing! Thanks to the help!

0 Likes