mikeosborne
2009-07-09, 10:07 PM
Hello,
this is my first lisp and I am trying to do something simple, create pond contours from a polyline. The idea is to give the routine the pond side slope(offset distance), a depth, and pick the top of bank(closed polyline). here is my code;
(defun c:PCA ()
(setq osd (getreal "\nPond Side Slope (H:1):")) ;Specify the side slope of the pond
(setq depth (getreal "\nPond Depth:")) ;Specify the depth of the pond
(setq pndtob (entsel "\nSelect Top of Bank")) ;Select a closed polyline
(setq pndcnt (getpoint "\nSelect Approxiamte Center of Pond:")) ;designates which side to make offset
(setq rerun 1)
(while (= rerun depth)
(setq pndcnt (getpoint pndcnt))
(command "offset" osd pndtob pndcnt)
(command "e")
(setq pndtob (entsel(entget(entlast))))
(setq rerun (1+ rerun))
)
)
If I remove the while statement it will offset the polyline one time if I leave the while statement in then I get "nil" and and the routine quits. what am I doing wrong?
this is my first lisp and I am trying to do something simple, create pond contours from a polyline. The idea is to give the routine the pond side slope(offset distance), a depth, and pick the top of bank(closed polyline). here is my code;
(defun c:PCA ()
(setq osd (getreal "\nPond Side Slope (H:1):")) ;Specify the side slope of the pond
(setq depth (getreal "\nPond Depth:")) ;Specify the depth of the pond
(setq pndtob (entsel "\nSelect Top of Bank")) ;Select a closed polyline
(setq pndcnt (getpoint "\nSelect Approxiamte Center of Pond:")) ;designates which side to make offset
(setq rerun 1)
(while (= rerun depth)
(setq pndcnt (getpoint pndcnt))
(command "offset" osd pndtob pndcnt)
(command "e")
(setq pndtob (entsel(entget(entlast))))
(setq rerun (1+ rerun))
)
)
If I remove the while statement it will offset the polyline one time if I leave the while statement in then I get "nil" and and the routine quits. what am I doing wrong?