TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: viva on September 18, 2006, 02:10:44 AM
-
hi to all,
iam having polylines. in the starting point point of the polyline , i had the circle. now i want 2 capture the circle. can anyone help me reagrding this issue
by using these, i had capture the starting point of the polyline.
(setq stp (vlax-curve-getstartpoint (vlax-ename->vla-object rname)))
then
for capturing the circle, i had tried this code, but it is not working,
(setq mdn(ssget "c" stp stp(list(cons 0 "circle"))) )
thanks in advance
regards
vivek
-
A circle does not have a start and end point. It has a centerpoint, diameter, radius, circumference,... which will allow you obtain the length if that is what is desired.
-
If the center point of the circle & the start point of the plines are the same this will get them.
(setq mdn (ssget "x" (list '(0 . "circle") (append '(10) stp))) )
-
If you need some wiggle room try this: [ignoring the z]
(setq wiggle 0.05)
(setq mdn (ssget "x" (list '(0 . "circle")
'(-4 . ">,*,*") (list 10 (- (car stp) wiggle) 0 0)
'(-4 . "<,*,*") (list 10 (+ (car stp) wiggle) 0 0)
'(-4 . "*,>,*") (list 10 0 (- (cadr stp) wiggle) 0)
'(-4 . "*,<,*") (list 10 0 (+ (cadr stp) wiggle) 0)
) )
)
Reads like this:
(if (and (> (center x) (- (pt x) wiggle))
(< (center x) (+ (pt x) wiggle))
(> (center y) (- (pt y) wiggle))
(< (center y) (+ (pt y) wiggle))
)
;; We have a match
)
-
hi whdjr & cab,
thanks for ur reply. i got the solution by using
(ssget "_x"(list(cons 0 "circle")(cons 10 stp)
here stp is the starting poing of polyline
regards
vivek