OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: jrupert on February 14, 2014, 07:17:53 AM

Title: How To keep GUI hidden with LAYISO COMMAND
Post by: jrupert on February 14, 2014, 07:17:53 AM
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?
Title: Re: How To keep GUI hidden with LAYISO COMMAND
Post by: Fred Tomke on February 14, 2014, 07:44:21 AM
Hi, have a look here: http://www.opendcl.com/forum/index.php?topic=947.msg4759#msg4759
Regards, Fred
Title: Re: How To keep GUI hidden with LAYISO COMMAND
Post by: owenwengerd on February 14, 2014, 10:56:48 AM
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)
)
Title: Re: How To keep GUI hidden with LAYISO COMMAND
Post by: Fred Tomke on February 14, 2014, 01:28:53 PM
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