A friend ask me if there is a quicker way to insert Autocad blocks in replacement to the circles in his drawing instead of inserting the block one by one manually. I answered him, “Yes, there is.”
Instead of inserting the new block one at a time, why don’t we create a lisp and automate the tedious block insertion process. By using the center point of the circles, we can create a lisp routine that will make a block and insert it in the specific center point of the circle auto-magically! This will save you many hours of drafting time compare to doing it the traditional way. If you have 3-4 circles to be replaced by block then that is tolerable but what if you have thousands of circles – that will surely be a tough job.
Here let me share you how to shortcut this long traditional method of inserting block on the centerpoint of each circle.
First, we have to create a lisp routine that is capable of converting multiple circles to block and insert it in the circle’s centerpoint automatically. Then, we will load that lisp to your autocad drawing and with a single command ^puff^ your circles will become blocks. You may use this block later so you can convert this to Electrical Device, change the symbology or whatever autocad mep 2008 manipulation you want to do.
Create the Circle-to-Block Autolisp:
- Open notepad.exe
- Copy and paste this code.
- In the notepad, saveas the file inside the folder where you want the lisp to be stored.
- Specify filename, e.g. RepCir2Blk.lsp (Don’t forget the “.lsp” extension”
- Click saveas type, choose “All files”.
- Hit the save button.
The Replace Circle to Block (RerCir2Blk) in action
- Open the autocad file that contains the circles you want to convert to blocks.
- In the command box, type “appload”
- Browse and load the RepCir2Blk lisp you created in step 4 above. (here is my lsp, in case you want to use this. Just right click, “save target as”)
- Once the lisp is loaded, close the Load/Upload application dialog box
- You can now use convert circles to block simultaneously, by running the command: RepCir2Blk.
If in your first attempt the steps here didn’t work, I suggest you repeat step one and follow the procedure carefully.
This technique is very useful specially if you are working in Autocad MEP 2008. Most of the time you’ll receive drawings from consultant or from third party for MEP detailed drawings. There are those who provide the drawing in plain autocad with the drawing blocks intact, but there are cases where you’ll receive drawings with exploded content. Electrical symbols, upright and downright sprinklers might be represented with plain circles. In this case converting those circles to Autocad MEP device or mvpart will be forever, as you are going to insert the device or mvpart one by one . But if they are in block then there is a simple procedures that will easily convert these Autocad blocks into device or sprinkler mvparts with less hassle.
You’ll know how to do it in my coming post. so Stay tuned.
If you think this tip is useful then don’t be shy to share it to others. You might as well subscribe our feed via email so you’ll receive the latest Autocad MEP tips and tricks to your inbox, or subscribe via your favorite feedreader.
How can I convert multiple points to blocks via lisp or vba?
Thanks – Ray
with a little lisp modification we can do it with the same process as above..
i’m going to post the exact routine soon.
see you around.
I have tried this lisp for replacing circles with block but it doesn,t work in any of the autocad versions higher than 2000 t=which i have,,, can you help?
I used autocad 2008 for this lisp and it works for me..
I tried it in AutoCAD 2008 and recieved
Command: _appload repcir2blk.lsp successfully loaded.
Command: ; error: bad argument type: consp “CIRCLE”
Could help – I am not master in lisp.
don’t work for me too (Autocad 2006), but I found working lisp:
(defun C:C2BLK ( / ss blk ent pt n)
(prompt “\nSelect Circles to replace: “)
(setq ss (ssget ‘((0 . “CIRCLE”)))
blk (getstring “\nName of Block: “)
);;setq
(if (and ss (tblsearch “block” blk))
(progn
(setq n (1- (sslength ss)))
(while (>= n 0)
(setq ent (ssname ss n)
pt (cdr (assoc 10 (entget ent)))
n (1- n)
);; setq
(command “_.-insert” blk pt “” “” “”)
);;while
(command “_.erase” ss “”)
);;progn
);; if
(princ)
)
The error is not an AutoCAD error – it is an html error.
After you cut-and-past the text, replace all the colon (“) and semi-colon (‘) symbols as the one’s shown are html characters.
This worked for me so should work for everyone.
Thanks, this is great tool/comand for Acad.
But i think this notwork for me and others users who have Autocad_LT.
Not work on Autocad LT 2011
Hi.
Good program.
Its a bit advanced for me though.
I have a drawing which has just over a thousand circles drawn.
I need to change all the circles to a point. Can your program do this?
Thanks.
Using your program, all it seams to do on my drawing is increase the size of the circle?