Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

plot-cancel attribute

0 views
Skip to first unread message

Nick Long

unread,
Nov 25, 1998, 3:00:00 AM11/25/98
to
I need to be able to tell if the plot command was canceled in order to
know if info should be written to file or if the lisp should quit. how
is this possible. My version does not work. I have also sustituted ^c^c
for "cancel" and that did not work. What is the best way of going about
this

the code section is as follows: ?
/
(if (= (command ".plot") ("cancel")) ---?
(quit)) \
(else ?
(setq dcl_id (load_dialog "bill.dcl"))
(if (not (new_dialog "bill" dcl_id)) (exit))

(set_tile "oh_yes" "yes")
(set_tile "oh_no" "no")
(action_tile "oh_yes" "(setq ANS 1)(done_dialog)")
(action_tile "oh_no" "(setq ANS 2)(done_dialog)")

(start_dialog)
(unload_dialog dcl_id)
(if (= ANS 1)
(setq ANS2 (strcat "Yes")))
(if (= ANS 2)
(setq ANS2 (strcat "No")))

(setvar "filedia" 1)
(setq lspdir "c:\\r13\\lsp\\") ;; set to directory of default txt file

(setq txtfile (strcat lspdir "pltlog.txt")) ;;default txt file
(setq filenm (open "K:\\Plotlog\\pltlog.txt" "a"))
(setq txt (strcat DPATH " " DNAME " " date-string " " NAME " "
PLT " " ANS2))
(write-line txt filenm)
(close filenm))


Stephen Tate

unread,
Nov 26, 1998, 3:00:00 AM11/26/98
to
Nick

Firstly, you will probably need to run a while loop, in case the user needs
to pick a window for plotting.
You can determine if the plot was cancelled with the DIASTAT variable.

(initdia)
(command "._PLOT")
(while (eq 1 (logand 1 (getvar "CMDACTIVE")))
(command PAUSE)
) ;_ WHILE
(if (zerop (getvar "DIASTAT"))
(prompt "\nPlot cancelled.")
(RUN_MY_FUNCTION)
) ;_ if

--
Stephen Tate
Stephen Tate CAD, UK
Anti-SPAM - For E-mail please use:
stephe...@stcad.co.uk

Nick Long wrote in message <365C9095...@architects-ca.com>...

0 new messages