OpenDCL Forums

OpenDCL => Studio/Dialog Editor => Topic started by: leo9 on September 19, 2016, 05:55:34 AM

Title: Crashing after closing form
Post by: leo9 on September 19, 2016, 05:55:34 AM
Hi,

Am trying to run some simple code when user clicks OK but it crashes AutoCAD.  The OK button should run some code and close the form:

(defun c:CM_Admin/frmCMAdmin/txtButton_OK#OnClicked (/)
  (dcl-Form-Close CM_Admin/frmCMAdmin)
    (if logo_name
    (progn
      (insert_logo logo_name)
    )
  )
)

Sorry for these very basic questions but not getting very far.
Title: Re: Crashing after closing form
Post by: leo9 on September 19, 2016, 07:07:07 AM
I have go it working by setting the OK button return value to 3:

(dcl-Form-Close CM_Admin/frmCMAdmin 3)

Then check the return value when showing the form:

(setq return (dcl_Form_Show CM_Admin_frmCMAdmin))

(if (= return 3) (etc...
Title: Re: Crashing after closing form
Post by: Fred Tomke on October 28, 2016, 02:53:57 AM
Hi, yes you are right: it's similar to the faq: http://www.opendcl.com/forum/index.php?topic=1080.0.
Regards, Fred