- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
HI,
I have a function that draws a bunch of lines and hatch based on what the user inputs. I am having issues with the points for the lines being inaccurate kinda randomly. It seems like the points will occasionally attach to other points or something and arithmetic functions don't always work.
For example, I have lines drawn using "pt5" and "pt8", which work correctly. But when it gets down to the while statement, "(car pt5)" & "(car pt8)" return the correct x-value, yet the y-values are all wrong. The y-values end up matching the y-value from other points not shown.
(setq pt5 (list (- (car pt3) FtgHeel) (cadr pt3)) ; left side of heel
pt8 (list (car pt7) (cadr pt4))) ; top right of toe
(command "line" pt5 pt8 ""); Works correctly
(setq cnt 1
maxcnt (fix (/ (+ StemHeight CurbHeight) 8)))
(while (<= cnt maxcnt)
(command "line" (list (car pt5) (+ (cadr pt5) (* 8 cnt)))
(list (car pt8) (+ (cadr pt8) (* 8 cnt))) "")
(setq cnt (1+ cnt))
) ; while
The above while statement draws the red lines below which should be 8" apart. For some reason it skips over the green lines (I added manually), one of the red lines isn't even an 8" increment, and it is drawing multiple red lines over top of each other.
If I switch pt5 and pt8, which should be the same line, just drawn backwards, it draws the lines even crazier.
(command "line" (list (car pt8) (+ (cadr pt8) (* 8 cnt)))
(list (car pt5) (+ (cadr pt5) (* 8 cnt))) "")
I can provide the whole thing, but I am hoping its just an issue with how I am setting the pt variables?
I have been dealing with this over and over again as I go through this script. Its like there is some crazy order of operations I am just not getting.
Thank you
Solved! Go to Solution.