BLOCKREPLACE command problems

BLOCKREPLACE command problems

gccdaemon
Collaborator Collaborator
592 Views
4 Replies
Message 1 of 5

BLOCKREPLACE command problems

gccdaemon
Collaborator
Collaborator

So I'm working in Civil 3D 2021 and we often have to clean up surveys from several different companies. Some of them use add-on civil3D software and others use something completely different. We have to change out the symbol blocks on all of these with our own. The problem I'm running into is the BLOCKREPLACE command only changes out the block definition which leaves all kinds of corruption embedded into the blocks. A couple examples of these remnants are attributed block text, and other coding those add-ons attach to the block definition. Redefining the blocks doesn't remove these remnants.

 

What I'm looking for is a routine that is block version of the LAYTRANS command. I can't tell you how many times I've wasted hours having to place new blocks inside old blocks and burst/explode them. I would like it to be block name based like LAYTRANS, put the new blocks in the same spot as the old ones, and matching the previous blocks layers/linetypes/size(x,y,z)/rotation would be helpful. Big thanks to anyone who can help!

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
0 Likes
593 Views
4 Replies
Replies (4)
Message 2 of 5

randyspear6624
Collaborator
Collaborator

I see the same sort of stuff as well from surveyors. Absolute crap! I wise man once told me that a good template should be able to be exported to AutoCAD easily without introducing too much additional cleanup.

 

I'm following this thread for a solution as well but I'm doubtful as most of the issues I see are a result of "unnamed blocks" which are either nested inside or worse, they're the top level of a series of nested blocks.

0 Likes
Message 3 of 5

3wood
Advisor
Advisor

My approach:

Step 1. Set up a folder and copy your standard blocks into it. For example "Block A".

Step 2. Find out name of the block you would like to replace in the received drawing, for example "Block B", comparing the scale, rotation etc against "Block A".

Step 3, Copy Block A into the same folder and rename the new block as "Block B", same name as the block you would like to replace in the received drawing, open Block B and scale / rotate it to match the Block B in the received file.

Step 4, Download BLOCKUPDATE, add it to your Startup Suite.

Step 5, Add following code into your acad.lsp or acaddoc.lsp,

(defun s::startup () (BLOCKUPDATE Path Blklist))

Path is the your block library folder in Step 1, put a pair of double quotes and change backslash to backslash x 2, for example: "C:\\Autodesk\\".

Blklist is in this format: (list "Block A" "Block C"), use a pair of bracket and use double quote for each block name.

Then restart your AutoCAD and every time opening a received drawing, it will replace the blocks automatically.

 

 

 

0 Likes
Message 4 of 5

gccdaemon
Collaborator
Collaborator

That's one way to do it, but sometimes our surveys are all civil 3d points so I have to export to AutoCAD. Then I run a simple routine to explode all unnamed blocks leaving me with the surveyors symbols. I'm sure there is a way to pick an block/insert object, pull the block name and run a "foreach", but i'm terrible a list handling and knowing all the bitcodes and properties to apply to the new block. VLA scares me, lol.

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
0 Likes
Message 5 of 5

Sea-Haven
Mentor
Mentor

The CIV3d block is tied to the description of the cogo point, as we just used CIV3D all the block set up was correct, 1 replacement was for trees where we removed the CIV3d block and replaced with a Dynamic block that modified spread and trunk based on description TR6x3 was 6m tree with 300mm trunk.

 

Its buried in the description key sets, but some good news, you can export the description key sets to excel so expose some of the rules. 

 

Need say a dwg with some Civ3d cogo points and the new block say insert next to the point just need 3-4. 

0 Likes