Autocad Auto replace

Autocad Auto replace

l.rundlof
Participant Participant
923 Views
5 Replies
Message 1 of 6

Autocad Auto replace

l.rundlof
Participant
Participant

Hello!

 

I was wondering if someone knows how to code a fix for my problem.

 

I would like to have a lisp, script or similar that would do something like this.

 

If I have a block, I would like to be able to switch it out for another block from lets say a list of blocks that's able to replace the one i have.

 

Lets have an example. I'm working in they playground industry.

 

Lets say I have screens, three heights, 300(1) 700(1) 900(1). All of them are red. Then I would like to have a button wich i could change colours, my idea was that i could make a list or something that says if there is a block called 300(1) replace it with 300(2) and you push the blue screen button, it would change my screens to lets say that (2) is blue.

 

Is this a possible thing to do? It goes the same with some of the side equipment, lets have another example, I have a slide, that can have 3 different foundations, If the idea with a list is a good choice (I guess it needs to read from something what to replace with) Then i would like to have a button for each of the different foundations. 

 

I guess, it would work like, I have a list, 3 categorys (Lets say screens) (BLUE) (RED) (GREEN). 

 

It would read the "article number" 300(1) find what article number (depending on button) it should replace with. Get that DWGfile from a folder or similar and replace it.

 

Is this possible? Or is it veeery hard to do?

 

Thanks /Ludvig

 

0 Likes
924 Views
5 Replies
Replies (5)
Message 2 of 6

christopher.l.evans
Advocate
Advocate

If you have express tools installed you can use the "replace block with another block" function.

 

You might consider implementing dynamic blocks.  In the case of your slide example you would create a visibility parameter with 3 visibility states for your different foundations.  When finished your slide block would have a grip that opens a context menu listing your different foundations you can select from.

Message 3 of 6

l.rundlof
Participant
Participant

Thank you I will look into dynamic blocks! Didnt know it existed!

 

Right now i need to change 55 units, it has 3 different colours, 3 different foundations and 3 different posts. that is alooot of dwgs! Thats why im looking for a shortcut!

0 Likes
Message 4 of 6

l.rundlof
Participant
Participant

I did look into dynamic blocks, it's really nice, though I get a problem, ive added my screens to a visibility list, but I have to be able to get a BOM(Build of material) out of the scene, seemingly visibility doesnt really change the block name, I use a VBA script to get the blocknames and quantity out of the DWG into Excel. 

 

Any thoughts how I can manage this? 

 

/L

0 Likes
Message 5 of 6

DannyNL
Advisor
Advisor

If you use the built-in Data Extraction to create your BOM, it would be able to extract the block names including the visibility parameter and quantify it for you and output directly to Excel. See Insert Ribbon --> Insert Tab --> Linking & Extraction Panel --> Extract Data.

0 Likes
Message 6 of 6

roland.r71
Collaborator
Collaborator

@l.rundlof wrote:

I did look into dynamic blocks, it's really nice, though I get a problem, ive added my screens to a visibility list, but I have to be able to get a BOM(Build of material) out of the scene, seemingly visibility doesnt really change the block name, I use a VBA script to get the blocknames and quantity out of the DWG into Excel. 

 

Any thoughts how I can manage this? 

 

/L


A BOMB is "Build of Material" (usually the explosive kind :P) but a BOM is a list or "Bill Of Material". (at least, it is in English. In Dutch a Bom actually IS a BomB 😛 )

 

Anyway, your method of creating a BOM doesn't account for dynamic blocks, et all. As you might notice, they get anonimous names when inserted (& changed from default)

 

so, in addition to what DannyNL just said, you need to retrieve each (dynamic) blocks original name, as well.

0 Likes