How To keep GUI hidden with LAYISO COMMAND

Started by jrupert, February 14, 2014, 07:17:53 AM

Previous topic - Next topic

jrupert

I have the following function...note that the GUI is modeless.

(DEFUN c:GBSCC_FormGBSCC_BTNIsolateLayers_OnClicked (/)
    (DCL_FORM_HIDE GBSCC_FormGBSCC T)
    (alert "Select Layers to Isolate and press {ENTER}")
    (COMMAND "layiso")
    (DCL_FORM_SHOW GBSCC_FormGBSCC)
)

What is happening is that the user has to either drag the GUI out of the way, or close it, to execute the  selection process from COMMAND "layiso".

What I want to happen is that the GUI remains hidden until the COMMAND "layiso" has been completed.

Anyone have any suggestions?

Fred Tomke

Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

This looks like a case of execution continuing before the command is finished. Try this:
Code (autolisp) Select

(DEFUN c:GBSCC_FormGBSCC_BTNIsolateLayers_OnClicked (/)
    (DCL_FORM_HIDE GBSCC_FormGBSCC T)
    (alert "Select Layers to Isolate and press {ENTER}")
    (COMMAND "layiso")
    (while (not (zerop (getvar "CMDACTIVE"))) (command pause))
    (DCL_FORM_SHOW GBSCC_FormGBSCC)
)
Owen Wengerd (Outside The Box) / ManuSoft

Fred Tomke

Hello, sorry, I have ignored that your form is modeless, but nevertheless you have to start layiso asynchronounsly. Please switch the control's EventInvoke property to Asynchronous instead of KeepFocus.
Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]