Convert Circles to Blocks

Discussion in 'AutoCAD' started by lilcowbell, Feb 24, 2005.

  1. lilcowbell

    lilcowbell Guest

    I received a file with thousands of circles to represent hydro poles. Is there a way that I can convert all of these circles, globally, to a standard block? I know with the express tools, I can replace a group of blocks with another block but I don't know how to change a group of circles to a block.

    Thanks in advance,
    Mac

    Running AutoCAD Map 5 with AutoCAD Express Tools 2000
     
    lilcowbell, Feb 24, 2005
    #1
  2. lilcowbell

    Paul Turvill Guest

    A little LISP, perhaps?

    (defun C:C2BLK ( / ss blk 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 pt (cdr (assoc 10 (entget (ssname ss n))))
    n (1- n)
    );; setq
    (command "_.-insert" blk pt "" "" "")
    );;while
    );;progn
    );; if
    (princ)
    )
    ___
     
    Paul Turvill, Feb 24, 2005
    #2
  3. lilcowbell

    Paul Turvill Guest

    Oops ... this one works (also erases the circles):

    (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)
    )
    ___
     
    Paul Turvill, Feb 24, 2005
    #3
  4. lilcowbell

    madcadd Guest

    Hi lil,

    Looks like Paul provided you with a nice lisp function to accomplish your task, but non the less, I will tell you what I did once without any lisp available to me. (actually, I didn't think to ask here)

    But since circles are closed loops, they do not have to be regions or polylines to extrude, so I performed an extrude and windowed the entire area to include all of the circles and gave an extrude depth. Then went to the front view, moved all the solids (all the extruded circles) a known distance (to isolate them), then exploded all the solids and erased the bodies and top circles (now regions converted by the software).

    Now the remaining circles (regions) are still at z=0 and I blocked them (as you want), then moved them back the known distance to return them back to their original positions.

    Sounds long, difficult and convoluted, but actually took less than a minute.
     
    madcadd, Feb 24, 2005
    #4
  5. lilcowbell

    The Real JD Guest

    woah...

    i'm usually pretty good at following directions, but that really messed me
    up!

    why not just use quickfilter to select them?


    task, but non the less, I will tell you what I did once without any lisp
    available to me. (actually, I didn't think to ask here)
    polylines to extrude, so I performed an extrude and windowed the entire area
    to include all of the circles and gave an extrude depth. Then went to the
    front view, moved all the solids (all the extruded circles) a known distance
    (to isolate them), then exploded all the solids and erased the bodies and
    top circles (now regions converted by the software).
    (as you want), then moved them back the known distance to return them back
    to their original positions.
    minute.
     
    The Real JD, Feb 24, 2005
    #5
  6. lilcowbell

    madcadd Guest

    Hi JD,

    Reply From: The Real JD
    Date: Feb/24/05 - 16:10 (CST)

    Re: Convert Circles to Blocks

    Probably because I didn't even know about Quick Select back then or more likely that I was using R14.

    At any rate, it was a work around that I found when I needed it.
     
    madcadd, Feb 24, 2005
    #6
  7. lilcowbell

    Randall Culp Guest

    I think he wants each circle replaced by a block that represents whatever
    the circle was.
     
    Randall Culp, Feb 25, 2005
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.