>I am trying to make a lisp that cound the about of circles found in a
>drawing with a certain radius (variable). Can someone help me get started
>on such a lisp. Thanks.
nope ... but if it's not intended to form part of a longer lisp program ... you
can simply use the filter and list commands to count them ...
colinfindlay
(ssget "X" '((0 . "CIRCLE") (40 . 5))) ;;; (DXF code for radius is 40,
isn't it?)
Tom Berger
--
ArchTools: Software-Werkzeuge für die Architektur
ArchDIM - architekturgerechte Bemaßung für AutoCAD (TM)
ArchAREA - Flächenermittlung und Raumbuch nach DIN 277
Info und Demo unter http://www.archtools.de
"Tom Berger" <ber...@archtools.de> wrote in message
news:3C4C3B2D...@archtools.de...
I need a list for a repetitive task that I often do. I need to make a
lisp that will allow me to pick a variable radius.
"Dave Jones" <da...@ddptrinidad.com> wrote in message
news:u4oeodn...@corp.supernews.com...
"shish" <shish_does...@hotmail.com> wrote in message
news:ciX28.704$6D1....@newscontent-01.sprint.ca...
(setq radius 5.0)
(ssget "X" (list
'(0 . "CIRCLE")
(cons 40 radius)
))
You can even filter for radiusses greater than A and smaller than B with
special boolean filter-dxf-codes. Your online help will tell you more
...
"shish" <shish_does...@hotmail.com> wrote in message
news:TzX28.711$6D1....@newscontent-01.sprint.ca...
"Tom Berger" <ber...@archtools.de> wrote in message
news:3C4C46DD...@archtools.de...
> Would it be a lot harder to make this lisp select these circles in a
> selected area of a drawing.
Simply remove "X" from the code. Then you get the famous "select
objects: " prompt which allows you to select via window, crossing,
previous etc ...
(defun C:ttff (/ )
(while (not (setq frst (entsel "\nPick a First circle: "))))
(setq radc (cdr (assoc 40 (entget (entlast)))))
(setq ss (ssget "C" (list '(0 . "CIRCLE")(cons 40 radc)))
count (sslength ss)
)(setq diac (* 2 radc))
(alert (strcat (itoa count) " Circles found @ " (rtos diac) "Dia"))
(princ)
)
"Paul Turvill" <nos...@turvill.com> wrote in message
news:u4ohrob...@corp.supernews.com...
SSGET is missing the coordinates of your crossing window.
Try: (ssget "c" pt1 pt2 '((0 . "CIRCLE")))
If you specify the Crossing "C", you have to specify the corner points of
the crossing window. If you want the user to pick them, then just leave it
out.
You also need to use the circle you picked in your code, not the last one
drawn. You should also localize variables, and check your input.
Here's some updated code:
(defun C:ttff ( / frst radc ss diac)
(while (not (setq frst (entsel "\nPick a First circle: "))))
(if frst
(setq radc (cdr (assoc 40 (car frst)))) ; USE THE RAD OF THE SELECTED
CIRCLE
(setq ss (ssget (list '(0 . "CIRCLE")(cons 40 radc)))
count (sslength ss)
)
(setq diac (* 2.0 radc))
(alert (strcat (itoa count) " Circles found at " (rtos diac) "
Dia"))
) )
(princ)
)
There are a few other errors, for example, it will crash if someone picks a
line or block. I'll leave those as an exercise for the student...
- Aaron
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----