Block swap?

#1
I'm working on a drawing I received from another company and there are thousands of blocks that I believe were from Civil 3D point labels. I'd like to replace all of them in one go with the standard block my company uses. Does IntelliCAD have a command that will allow me to easily swap all of those blocks?

Re: Block swap?

#2
Hi,

I'm not aware of anything in Intellicad that will do what you want.
Others may no better.

If I were face with this issue I would create a 'DXF' file of the drawing, then edit that with Notepad using 'Find' & 'Replace'
You will need to do that for each block name, then re-import back into Intellicad.

I'm sure it could be done via Lisp, but beyond my skill set atm.

Re-reading your post, do you want to replace ALL of the blocks in the drawing with just a single block?
Are all of the blocks on one layer? or could they be (easily).
You can delete a layer and ALL objects on that layer, then insert your company block.
That could be done via a simple script/batch file if there are many to do.

Steve.

Re: Block swap?

#3
sln8458 wrote:
Tue Oct 06, 2020 12:46 am
Hi,

I'm not aware of anything in Intellicad that will do what you want.
Others may no better.

If I were face with this issue I would create a 'DXF' file of the drawing, then edit that with Notepad using 'Find' & 'Replace'
You will need to do that for each block name, then re-import back into Intellicad.

I'm sure it could be done via Lisp, but beyond my skill set atm.

Re-reading your post, do you want to replace ALL of the blocks in the drawing with just a single block?
Are all of the blocks on one layer? or could they be (easily).
You can delete a layer and ALL objects on that layer, then insert your company block.
That could be done via a simple script/batch file if there are many to do.

Steve.
Thank you for your reply, it wasn't every block in the drawing, just the ones that are the wrong symbol for spot elevations. I tried to edit the block, but it was an anonymous block or something like that and wouldn't allow me to edit it. I think every one of them had a different name and I know when exploding Civil 3D labels that is what happens. They are all on the same layer, but all have different names. I did find an easy way to do it though. Apparently the company I work for has AutoCAD 2004 on my machine and I was able to use it to replace all of the blocks using a lisp. Unfortunately that same lisp doesn't work in Intellicad for some reason.

Re: Block swap?

#4
Try to use this lisp, please.

Code: Select all

(DEFUN C:ReplaceBlock( / ss ssl new_BlockName index e ass)
 (setq ss (ssget))
 (prompt"\nReplacement block name (block must exist in drawing): ")
 (setq new_BlockName (getstring t))
 (setq ssl(sslength ss))
 (setq index 0)
 (repeat ssl
  (setq e (entget(ssname ss index)))
  (setq ass (assoc 2 e))
  (setq e (subst (cons 2 new_BlockName) ass e))
  (entmod e)
  (setq index (+ 1 index))
 )
 (command "regen" "" )
 (princ)
)
cron