OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Hypersonic on August 06, 2011, 09:18:17 AM

Title: close_all ?? how to activate when exiting drawings?
Post by: Hypersonic on August 06, 2011, 09:18:17 AM
I have a problem withi dialogs remaining open when I open a different drawing or reopen the current drawing, and then the dialogs are not really loaded.
Does anyone have any pointers on how to automatically close out dialog boxes when reopoening a drawing or opening a different drawing?

Thanks!
Title: Re: close_all ?? how to activate when exiting drawings?
Post by: Fred Tomke on August 06, 2011, 02:06:45 PM
Hello, Hypersonic, you have two possibilities: either you define a editor or drawing reactor which closes or update the form when a new drawing will be opened. Otherwise you define a command which will be automatically started when your lisp application will be loaded in each drawing.

Regards, Fred
Title: Re: close_all ?? how to activate when exiting drawings?
Post by: Fred Tomke on August 06, 2011, 02:09:02 PM
Hi, Hypersonic, my answer followed the contents of your topic. When following the title of your topic I'd rather activate the EnteringNoDocState event.

Regards, Fred
Title: Re: close_all ?? how to activate when exiting drawings?
Post by: Hypersonic on August 14, 2011, 08:00:17 AM
Awesome thanks Fred!
Title: Re: close_all ?? how to activate when exiting drawings?
Post by: Hypersonic on August 14, 2011, 08:05:22 AM
I have never done a reactor, but have always thought it would be useful to learn how, would you be able to point me in the right direction as to where to learn about them?

Thanks!
Title: Re: close_all ?? how to activate when exiting drawings?
Post by: Fred Tomke on August 14, 2011, 08:22:39 AM
Hello, Hypersonic, during the AutoCAD installation you can add the VisualLISP tutorium. That includes the garden path sample using reactors.

Regards, Fred
Title: Re: close_all ?? how to activate when exiting drawings?
Post by: Hypersonic on September 25, 2011, 06:56:56 AM
I used this in my startup routine and it works great!  (dcl_Form_CloseAll 0);closes all open dialog boxes

Thanks!
Title: Re: close_all ?? how to activate when exiting drawings?
Post by: vpost on April 19, 2012, 06:33:10 AM
Hello. I have a question on the same subject.
At me in AutoCAD some windows are open. How to execute a command (dcl_Form_CloseAll 0) upon transition from one window in another. I tried EnteringNoDocState but it works only when closing the last window?

Regards
Title: Re: close_all ?? how to activate when exiting drawings?
Post by: Fred Tomke on April 20, 2012, 03:49:46 AM
Hi, EnteringNoDocState is only used for modeless forms (modeless, palette, dockable) when the last drawing ist closed.

(dcl_Form_CloseAll 0) closes all OpenDCL forms. Querying the systemvariable CMDACTIVE tells you, if a modal AutoCAD form is active.

(vl-remove-if-not 'dcl_form_isactive (apply 'append (mapcar 'dcl_project_getforms (dcl_getprojects)))) returns a list of all open forms.

Regards, Fred