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.
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.
startedshish schrieb:
>
> 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
> on such a lisp. Thanks.
(ssget "X" '((0 . "CIRCLE") (40 . 5))) ;;; (DXF code for radius is 40, isn't it?)
Tom Berger
startedIt's already done for you...just use a FILTER
> on such a lisp. Thanks.
>
>
Thanks that almost what I wanted. This will help me get started. Now I just have to figure out how to this with a variable radius, that would be inputted by the user.
wouldThanks that almost what I wanted. This will help me get started. Now I just have to figure out how to this with a variable radius, that
be inputted by the user.
Filer command works good but too slow, for what I am doing.
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" wrote:
> It's already done for you...just use a FILTER
> --
> Dave
> "shish" wrote:
>
> > I am trying to make a lisp that cound the about of circles found in a ...
wouldshish schrieb:
>
> Thanks that almost what I wanted. This will help me get started.
> Now I just have to figure out how to this with a variable radius, that
> be inputted by the user.
(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 ...
...
Would it be a lot harder to make this lisp select these circles in a selected area of a drawing.
shish schrieb:
> 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 ...
Tom Berger
(setq rad (getdist "\Radius to find: ")
ss (ssget "X" (list '(0 . "CIRCLE")(cons 40 rad))) )
___
"shish" wrote:
> Thanks that almost what I wanted. This will help me get started.
> Now I just have to figure out how to this with a variable radius, that would
> be inputted by the user.
Why does this lisp work great with (ssget "X" )
but if I try to use crossing (ssget "C") it gives me an error?
"Dia"))Why does this lisp work great with (ssget "X" )
but if I try to use crossing (ssget "C") it gives me an error?
(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)
(princ)
)
"Paul Turvill" wrote:
> (setq rad (getdist "\Radius to find: ")
> ss (ssget "X" (list '(0 . "CIRCLE")(cons 40 rad)))
> )
> ___
>
> "shish" wrote:
...