Hi everyone,
I just wrote a lisp routine which is calculating and marking Y values (2D elevations, if I can say so), based on a reference point.
The lisp is actually working, but I am having two problems.
1st. The values of elevation which are in block attributes are whit precision whit 15 decimal places (something like this 0.0000000000000),
I would like precision whit only two places (like this 0.00).
2nd. Like I sad the lisp is working but I am sure that there is more elegant solution whit this repeat part,
what I want is to repeat that part until user cancel it, maybe to put something like "pick another point, or exit".
P.S I am in process of learning AutoLisp, so I would be wery thankful for any suggestions, corrections etc.
At advance thanks for the answers
@dicra wrote:....
2nd. Like I sad the lisp is working but I am sure that there is more elegant solution whit this repeat part,
what I want is to repeat that part until user cancel it, maybe to put something like "pick another point, or exit".
....
(repeat 100
(progn(setq PT (getpoint "\nChoose point: "))....
One way to do a repeat for as long as the User wants to keep repeating is to replace the above-quoted lines with
....
(while (setq PT (getpoint "\nChoose point: "))
....
[omitting the unnecessary (progn) as stevor mentioned]. As long as the User picks another point, it will go on and do what it should with it, but when they hit Escape or Enter or Space, the (getpoint) function will return nil, and it will stop.
@Kent1Cooper wrote:One way to do a repeat for as long as the User wants to keep repeating is to replace the above-quoted lines with
....
(while (setq PT (getpoint "\nChoose point: "))
....
[omitting the unnecessary (progn) as stevor mentioned]. As long as the User picks another point, it will go on and do what it should with it, but when they hit Escape or Enter or Space, the (getpoint) function will return nil, and it will stop.
Thanks again Kent, whit "while" it looks lot more beater.
@stevor wrote:
1. Check out the terms 'LUNITS, LUPREC, UNITS, and RTOS
Thanks stevor, I will try those functions.