Problems with Snaps
Posted: Wed Oct 08, 2003 8:42 am
Hi,
I'm developing a new application for IntelliCAD based on VBA routines. But I have some external routines built in LISP. Precisely one of those, which returns the point selected by the user (PEDIRPUNTO routine), is causing some troubles. I have two different states, normal state, and insert process state. While I'm inserting a process, I need to pick up a point in ICAD where the process will be applied. For to get the point I call via a external call, the routine built in LISP that returns the point selected with the mouse. If I'm in the middle of the process of picking up a point, and using the snap Intersection, as soon as I pass the mouse over an intersection it brings up a message error, Operation Cancelled. Any idea? Any help will be much appreciated.
Thanks,
Mario.
Snippet of the routine PEDIRPUNTO code:
(defun C:PEDIRPUNTO (/ temperror ptIns)
(setq temperror *error*)
(setq *error* myerror)
(setvar "cmdecho" 0)
(setvar "USERI2" 1)
(setq ptIns nil)
(while (= ptIns nil) (setq ptIns (getpoint (strcat "\n" (getvar "USERS4")))))
(if (not (= ptIns nil)) (progn (setvar "USERR1" (nth 0 ptIns)) (setvar "USERR2" (nth 1 ptIns)) (setvar "USERI2" 0)))
(setvar "USERS4" "")
(setq *error* temperror)
(princ)
(princ)
(princ)
(princ)
(princ)
)
(defun myerror (msg)
(setvar "USERS4" "")
(setq *error* temperror)
(princ)
(princ)
(princ)
(princ)
(princ)
)
I'm developing a new application for IntelliCAD based on VBA routines. But I have some external routines built in LISP. Precisely one of those, which returns the point selected by the user (PEDIRPUNTO routine), is causing some troubles. I have two different states, normal state, and insert process state. While I'm inserting a process, I need to pick up a point in ICAD where the process will be applied. For to get the point I call via a external call, the routine built in LISP that returns the point selected with the mouse. If I'm in the middle of the process of picking up a point, and using the snap Intersection, as soon as I pass the mouse over an intersection it brings up a message error, Operation Cancelled. Any idea? Any help will be much appreciated.
Thanks,
Mario.
Snippet of the routine PEDIRPUNTO code:
(defun C:PEDIRPUNTO (/ temperror ptIns)
(setq temperror *error*)
(setq *error* myerror)
(setvar "cmdecho" 0)
(setvar "USERI2" 1)
(setq ptIns nil)
(while (= ptIns nil) (setq ptIns (getpoint (strcat "\n" (getvar "USERS4")))))
(if (not (= ptIns nil)) (progn (setvar "USERR1" (nth 0 ptIns)) (setvar "USERR2" (nth 1 ptIns)) (setvar "USERI2" 0)))
(setvar "USERS4" "")
(setq *error* temperror)
(princ)
(princ)
(princ)
(princ)
(princ)
)
(defun myerror (msg)
(setvar "USERS4" "")
(setq *error* temperror)
(princ)
(princ)
(princ)
(princ)
(princ)
)