PDA

View Full Version : Something is wrong with my polar function



harrison-matt
16th Apr 2011, 02:36 pm
All,

I am having some issues with my polar function:



(setq pre_ang 0)
(setq ang (/ (* 3 pi) 2))
(setq int '(46.8854 43.1495 0.0))
(setq apt_int '(52.8854 49.1495 0.0))
(setq width 6)
(setq ptLst
(mapcar
'(lambda(x)(trans x 0 1))
(list
(setq eli int)
(setq el1 (polar eli (+ pi pre_ang) (/ width 3.)))
(setq el2 (polar el1 (+ (/ pi 2) pre_ang) width))
(setq el3 (polar eli ang (/ width 3.)))
(setq el4 (polar el3 (+ (/ pi 2) ang) width))
(setq ela apt_int)
)
)
)
(mapcar '(lambda (x)(command "point" x)) ptlst)


el1 and el3 are not going in correctly...


_$
(polar '(46.8854 43.1495 0.0) 3.14159 2.0) ;entered in console [el1]
(44.8854 43.1495 0.0) ; return

Any thoughts why this is not working for me?

Kind Regards,

Matt

harrison-matt
16th Apr 2011, 02:52 pm
(setq ptLst (mapcar
'(lambda(x)(trans x 0 1))
(list
int
(polar int (+ pi pre_ang) (/ width 3.))
(polar apt_int (+ pi pre_ang) (+ (/ width 3) width))
apt_int
(polar int ang (/ width 3.))
(polar apt_int ang (+ (/ width 3) width))
apt_int )))
(mapcar '(lambda (x)(command "point" x)) ptlst))


I simplified my code.... Still is not working as it should...

harrison-matt
16th Apr 2011, 03:04 pm
Well... it works when i draw a polyline, but not when i am using points to show them.... any thoughts why?

Lee Mac
16th Apr 2011, 03:46 pm
Consider OSnap perhaps - change:


(mapcar '(lambda (x)(command "point" x)) ptlst))

to:


(mapcar '(lambda (x)(command "_.point" "_non" x)) ptlst))

David Bethel
16th Apr 2011, 05:10 pm
Well... it works when i draw a polyline, but not when i am using points to show them.... any thoughts why?

Points are alway WCS.