i wrote this routine that will prompt the user for a starting elevation and then it will let you select a series of polylines and it will set the first selected with an elevation equal to the starting elevation the user entered (default is 1) and the everything after that sequentially increases by 1. right now, i have 2 problems...
1. after i select the first pline (it will be set with an elev. of 1), i selected the second pline (but instead of setting it as 2, it sets it as three). for some reason, it skips the following number after the starting number.
2. if i accidentially miss a pick on a pline (or just right click/enter to end the routine), i would like to to NOT add the next number, but instead stop adding (if the last pline i edit is with an elevation of 20, then i want when i execute teh command again, it will be be at 21 for the default, not 22.
any help would be greatly appreciated. eventually, if i can tackle these 2 issues, i would like to be able to give the option to set the increment (ie: 1, 1.5, -1, -1.5, etc.) and be able to change the increment mid picking if possible. these are things that are not as important and are far on the back burner.
here is what i have so far...
(defun C:ec()
(if (not *SEQ-NUM) (setq *SEQ-NUM 1)) ;set default
(setvar "cmdecho" 0)
(princ "\nStarting Number <")
(princ *SEQ-NUM)
(setq SEQ-NUM (getint ">: "))
(if (not SEQ-NUM)
(setq SEQ-NUM *SEQ-NUM)
(setq *SEQ-NUM SEQ-NUM)
);if
(graphscr)
(setq ENT (entsel "\nSelect Polyline to Sequentially Elevate: "))
(while ENT
(progn
(command "change" ENT "" "p" "e" *SEQ-NUM "")
(setq SEQ-NUM (1+ SEQ-NUM)) ;advance default
(princ "\n")(princ SEQ-NUM)
(setq ENT (entsel " - Select Next Polyline: "))
);progn
(setq *SEQ-NUM (1+ SEQ-NUM)) ;set for next use
);while
(princ))