Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
IF SLOPE_LEFT < SLOPE_RIGHT THEN
SLOPE = SLOPE_LEFT
ELSE
SLOPE = SLOPE_RIGHT
END IF
Solved! Go to Solution.
IF SLOPE_LEFT < SLOPE_RIGHT THEN
SLOPE = SLOPE_LEFT
ELSE
SLOPE = SLOPE_RIGHT
END IF
Solved! Go to Solution.
@jinkinglee wrote:
IF SLOPE_LEFT < SLOPE_RIGHT THEN
SLOPE = SLOPE_LEFT
ELSE
SLOPE = SLOPE_RIGHT
END IF
If SLOPE_LEFT and SLOPE_RIGHT are AutoLisp variables containing numbers [whether percentages of slope, or degrees or radians or something], you could do it with the same kind of "structure":
(if (< SLOPE_LEFT SLOPE_RIGHT)
(setq SLOPE SLOPE_LEFT); then
(setq SLOPE SLOPE_RIGHT); else
)
But it can be done more concisely:
(setq SLOPE (min SLOPE_LEFT SLOPE_RIGHT))
Or more verbosely...
(setq slope (car (vl-sort '< (list slope_left slope_right))))
Of course the programmer must be aware of negative slopes due to what point was picked before the other. He may want to consider comparing the absolute values.
John F. Uhden