Search the Community
Showing results for tags 'looping'.
-
Routine to read Excel with unknown number of lines
undermustang posted a topic in AutoLISP, Visual LISP & DCL
Hey guys, I am writting a routine to read a excel file that contains a column with the number of the element, a column with the x's coordinate and a column with the y's coordinate. I need a way of making a loop to read whatever elements are filled by the excel's user and get this values in vectors so they can be used after. Is there anyway of doing that? Thank you very much! -
I am new to this forum, looking for some help on a lisp routine been working on. The routine works except. My goal is to execute the routine in a loop, allowing me to continue to pick and change until "enter" key in pressed, without any errors being printed in the command line. Right now if I press the "ECS" key it exits the routine and settings are returned, i.e. osmode reset to previous settings. If I press "ENTER" it exits with an error message. Here is the routine (defun c:bc90 ( / se sp point snap echo olderr) (setq snap (getvar "osmode") echo (getvar "cmdecho") olderr *error* *error* break_error ) (setvar "cmdecho" 0) (progn (setvar "osmode" 32) (while (null (nentselp (setq point (getpoint "\nSelect Breaking Point (or ENTER when done): "))) ) ) (setvar "osmode" 512) (while (not se) (setq sp (cadr (setq se (entsel "\nSelect Line to Change to Hidden: ")))) ) (setvar "osmode" 0) (command "break" se "f" point "@") (command "change" sp "" "p" "c" "9" "lt" "hidden" "") (princ) ) (setvar "osmode" snap) (setvar "cmdecho" echo) (setq *error* olderr) (princ) ) (defun break_error (msg) (princ (strcat "\nError: " msg)) (setvar "osmode" snap) (setvar "cmdecho" echo) (princ ) ) The progn line was added in early failed attempts at looping. I am trying to limit the number of keyboard inputs so I do not want "Press [Y] to continue or [Exit]" type lines in the routine. Just a simple "ENTER" to exit. If possible. any help would be nice, thanks