2009-09-30 05:38 UTC
I'm attempting to create a routine with the following functionality :
Main Dialog displays a Child Dialog
.. Main is closed so only the Child Dialog is displayed.
Child Dialog 'hides to allow interaction with AutoCAD.
Child Dialog redisplays when interaction is completed.
///---
This works fine for the first 'hide' of the Child.
AutoCAD freezes on the second 'hide'.
The attached piccy is the freeze point ( running a debug animation )
I'm hoping the problem is something simple I'm not doing, or doing incorrectly.
Attached is the LSP and ODCL code.
I'd appreciate a second or third set of eyes ...
T12 is the Command for the nested attempt.
T12Single for the single dialog.
Regards
Kerry
;|
Test routine for hiding modal form.
|;
(vl-load-com)
(command "OPENDCL")
;;;---------------------------------------------------------------------------
;;;
;;;---------------------------------------------------------------------------
;;;
;|
Main Dialog displays a Child Dialog
.. Main is closed so only a single dialog is displayed.
Child Dialog 'hides to allow interaction with AutoCAD.
Child Dialog redisplays when interaction is completed.
|;
(defun c:t12 (/
mainflag
bflag
;;
c:t12_main_selectstuff_onclicked
c:t12_main_opennew_onclicked
c:t12_child_selectstuff_onclicked
)
;;---------------------------------------------
(defun c:t12_main_selectstuff_onclicked (/)
(setq mainflag t)
(dcl_form_close t12_main)
(_dostuff)
)
;;---------------------------------------------
(defun c:t12_main_opennew_onclicked (/ positionlist main-x main-y)
(if (dcl_form_isactive t12_main)
(progn (setq positionlist (dcl_control_getpos t12_main)
main-x (car positionlist)
main-y (cadr positionlist)
)
(dcl_form_close t12_main)
)
)
(setq bflag t)
(while bflag
(setq bflag nil)
(dcl_form_show t12_child main-x main-y)
;;
)
)
;;---------------------------------------------
(defun c:t12_child_selectstuff_onclicked (/)
(setq bflag t)
(dcl_form_close t12_child)
(_dostuff)
)
;;---------------------------------------------
;;---------------------------------------------
(or (dcl_project_load "T12" t) (exit))
(setq mainflag t)
(while mainflag
(setq mainflag nil)
(dcl_form_show t12_main)
;;
)
(princ)
)
;;;---------------------------------------------------------------------------
;;;
;;;---------------------------------------------------------------------------
;;;
;;;---------------------------------------------------------------------------
;;;
;; Library Code common
;;
(defun _dostuff (/ pt blip)
(setq blip (getvar "BLIPMODE"))
(setvar "BLIPMODE" 1)
;;
(while (setq pt (getpoint "\n Select a Point"))
(prompt (strcat "\n " (vl-prin1-to-string pt)))
)
;;
(setvar "BLIPMODE" blip)
(redraw)
)
;;;---------------------------------------------------------------------------
;;;
;;;---------------------------------------------------------------------------
;;;
;|
Single dialog which 'hides' to allow selection.
Single dialog redisplays when interaction is completed.
|;
(defun c:t12single (/
bflag
;;
c:t12_child_selectstuff_onclicked
)
(defun c:t12_child_selectstuff_onclicked (/)
(setq bflag t)
(dcl_form_close t12_child)
(_dostuff)
)
;;---------------------------------------------
;;---------------------------------------------
(or (dcl_project_load "T12" t) (exit))
(setq bflag t)
(while bflag
(setq bflag nil)
(dcl_form_show t12_child)
;;
)
;;---------------------------------------------
(princ)
)
;;;---------------------------------------------------------------------------
;;;
(prompt "\n T12Single, T12 to run.")
(princ)
Main Dialog displays a Child Dialog
.. Main is closed so only the Child Dialog is displayed.
Child Dialog 'hides to allow interaction with AutoCAD.
Child Dialog redisplays when interaction is completed.
///---
This works fine for the first 'hide' of the Child.
AutoCAD freezes on the second 'hide'.
The attached piccy is the freeze point ( running a debug animation )
I'm hoping the problem is something simple I'm not doing, or doing incorrectly.
Attached is the LSP and ODCL code.
I'd appreciate a second or third set of eyes ...
T12 is the Command for the nested attempt.
T12Single for the single dialog.
Regards
Kerry
;|
Test routine for hiding modal form.
|;
(vl-load-com)
(command "OPENDCL")
;;;---------------------------------------------------------------------------
;;;
;;;---------------------------------------------------------------------------
;;;
;|
Main Dialog displays a Child Dialog
.. Main is closed so only a single dialog is displayed.
Child Dialog 'hides to allow interaction with AutoCAD.
Child Dialog redisplays when interaction is completed.
|;
(defun c:t12 (/
mainflag
bflag
;;
c:t12_main_selectstuff_onclicked
c:t12_main_opennew_onclicked
c:t12_child_selectstuff_onclicked
)
;;---------------------------------------------
(defun c:t12_main_selectstuff_onclicked (/)
(setq mainflag t)
(dcl_form_close t12_main)
(_dostuff)
)
;;---------------------------------------------
(defun c:t12_main_opennew_onclicked (/ positionlist main-x main-y)
(if (dcl_form_isactive t12_main)
(progn (setq positionlist (dcl_control_getpos t12_main)
main-x (car positionlist)
main-y (cadr positionlist)
)
(dcl_form_close t12_main)
)
)
(setq bflag t)
(while bflag
(setq bflag nil)
(dcl_form_show t12_child main-x main-y)
;;
)
)
;;---------------------------------------------
(defun c:t12_child_selectstuff_onclicked (/)
(setq bflag t)
(dcl_form_close t12_child)
(_dostuff)
)
;;---------------------------------------------
;;---------------------------------------------
(or (dcl_project_load "T12" t) (exit))
(setq mainflag t)
(while mainflag
(setq mainflag nil)
(dcl_form_show t12_main)
;;
)
(princ)
)
;;;---------------------------------------------------------------------------
;;;
;;;---------------------------------------------------------------------------
;;;
;;;---------------------------------------------------------------------------
;;;
;; Library Code common
;;
(defun _dostuff (/ pt blip)
(setq blip (getvar "BLIPMODE"))
(setvar "BLIPMODE" 1)
;;
(while (setq pt (getpoint "\n Select a Point"))
(prompt (strcat "\n " (vl-prin1-to-string pt)))
)
;;
(setvar "BLIPMODE" blip)
(redraw)
)
;;;---------------------------------------------------------------------------
;;;
;;;---------------------------------------------------------------------------
;;;
;|
Single dialog which 'hides' to allow selection.
Single dialog redisplays when interaction is completed.
|;
(defun c:t12single (/
bflag
;;
c:t12_child_selectstuff_onclicked
)
(defun c:t12_child_selectstuff_onclicked (/)
(setq bflag t)
(dcl_form_close t12_child)
(_dostuff)
)
;;---------------------------------------------
;;---------------------------------------------
(or (dcl_project_load "T12" t) (exit))
(setq bflag t)
(while bflag
(setq bflag nil)
(dcl_form_show t12_child)
;;
)
;;---------------------------------------------
(princ)
)
;;;---------------------------------------------------------------------------
;;;
(prompt "\n T12Single, T12 to run.")
(princ)

