| Author |
Message |
lilcowbell
Guest
|
Posted:
Thu Feb 24, 2005 9:46 pm Post subject:
Convert Circles to Blocks |
|
|
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
|
|
| Back to top |
|
 |
Paul Turvill
Guest
|
Posted:
Thu Feb 24, 2005 10:24 pm Post subject:
Re: Convert Circles to Blocks |
|
|
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)
)
___
"lilcowbell" <nospam@address.withheld> wrote in message
news:24634543.1109263639247.JavaMail.jive@jiveforum1.autodesk.com...
> I don't know how to change a group of circles to a block. |
|
| Back to top |
|
 |
Paul Turvill
Guest
|
Posted:
Thu Feb 24, 2005 10:41 pm Post subject:
Re: Convert Circles to Blocks |
|
|
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" <nospam@turvill.com> wrote in message
news:421e0db7_2@newsprd01...
| Quote: | A little LISP, perhaps?
(defun C:C2BLK ( / ss blk n) |
|
|
| Back to top |
|
 |
madcadd
Guest
|
Posted:
Fri Feb 25, 2005 1:10 am Post subject:
Re: Convert Circles to Blocks |
|
|
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. |
|
| Back to top |
|
 |
The Real JD
Guest
|
Posted:
Fri Feb 25, 2005 3:10 am Post subject:
Re: Convert Circles to Blocks |
|
|
woah...
i'm usually pretty good at following directions, but that really messed me
up!
| Quote: | and I blocked them (as you want)
|
why not just use quickfilter to select them?
"madcadd" <nospam@address.withheld> wrote in message
news:27480273.1109275884880.JavaMail.jive@jiveforum2.autodesk.com...
| Quote: | 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)
| Quote: |
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).
| Quote: |
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.
| Quote: |
Sounds long, difficult and convoluted, but actually took less than a
minute. |
|
|
| Back to top |
|
 |
madcadd
Guest
|
Posted:
Fri Feb 25, 2005 3:53 am Post subject:
Re: Convert Circles to Blocks |
|
|
Hi JD,
Reply From: The Real JD
Date: Feb/24/05 - 16:10 (CST)
Re: Convert Circles to Blocks
| Quote: | why not just use quickfilter to select them?
|
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. |
|
| Back to top |
|
 |
Randall Culp
Guest
|
Posted:
Fri Feb 25, 2005 6:16 am Post subject:
Re: Convert Circles to Blocks |
|
|
I think he wants each circle replaced by a block that represents whatever
the circle was.
"madcadd" <nospam@address.withheld> wrote in message
news:27480273.1109275884880.JavaMail.jive@jiveforum2.autodesk.com...
| Quote: | 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. |
|
|
| Back to top |
|
 |
|
|
|
|