Crashing after closing form

Started by leo9, September 19, 2016, 05:55:34 AM

Previous topic - Next topic

leo9

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.

leo9

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...

Fred Tomke

Fred Tomke
Dipl.-Ing. (FH) Landespflege

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