Author Topic: regarding capturing circle  (Read 2542 times)

0 Members and 1 Guest are viewing this topic.

viva

  • Guest
regarding capturing circle
« 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

whdjr

  • Guest
Re: regarding capturing circle
« Reply #1 on: September 18, 2006, 08:23:33 AM »
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.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: regarding capturing circle
« Reply #2 on: September 18, 2006, 12:42:57 PM »
If the center point of the circle & the start point of the plines are the same this will get them.
Code: [Select]
(setq mdn (ssget "x" (list '(0 . "circle") (append '(10) stp))) )
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: regarding capturing circle
« Reply #3 on: September 18, 2006, 01:05:48 PM »
If you need some wiggle room try this: [ignoring the z]
Code: [Select]
(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:
Code: [Select]
(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
 )
« Last Edit: September 18, 2006, 01:18:06 PM by CAB »
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

viva

  • Guest
Re: regarding capturing circle
« Reply #4 on: September 19, 2006, 01:56:44 AM »
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