Temporarily close dialog box

Discussion in 'AutoCAD' started by Alan Henderson @ A'cad Solutions, Aug 5, 2004.

  1. I am trying to write a program that allows users to temporarily close the dialog box to select an entity.
    I have tried many methods (most lockup AutoCAD).
    Thanks for your help...

    Here is the dialog box -
    test :dialog{
    label="Test close Dialog Box";
    :button{
    label="Pick button to close dialog box temporarily";
    key="BUTTON";
    }
    ok_cancel;
    }

    Here is the lisp routine -
    (defun TEST_RUN ()
    (setq P0 (getpoint "\nPick Point ? "))
    )
    (defun TEST_ACCEPT ()
    (setq TEST_VALUES_OK T)
    (done_dialog 1)
    )
    (defun TEST_CANCEL ()
    (setq TEST_VALUES_OK T)
    (done_dialog 0)
    )

    (defun C:TEST ()
    (setq TEST_VALUES_OK nil)
    (while (not TEST_VALUES_OK)
    (setq LIT nil)
    (setq DCL_ID (load_dialog "test.dcl"))
    (if (not (new_dialog "test" DCL_ID))
    (progn (alert "\nERROR - Problems opening or reading Dialog Box.")(exit))
    (progn
    (action_tile "BUTTON" "(TEST_RUN)")
    (action_tile "accept" "(TEST_ACCEPT)")
    (action_tile "cancel" "(TEST_CANCEL)")
    (setq DCL_EXIT (start_dialog))
    )
    )
    (unload_dialog DCL_ID)
    )
    (if (= DCL_EXIT 1)
    (princ "\nExit via OK")
    (princ "\nExit via Cancel")
    )
    (princ)
    )
     
    Alan Henderson @ A'cad Solutions, Aug 5, 2004
    #1
  2. Give this a try.

    (defun C:TEST ()
    (setq DCL_ID (load_dialog "test.dcl"))
    (setq DCL_EXIT 2)
    (while (>= DCL_EXIT 2)
    (if (not (new_dialog "test" DCL_ID))
    (progn (alert "\nERROR - Problems opening or reading Dialog
    Box.")(exit))
    (progn
    (action_tile "BUTTON" "(done_dialog 2)")
    (action_tile "accept" "(done_dialog)")
    (action_tile "cancel" "(done_dialog)")
    (setq DCL_EXIT (start_dialog))
    )
    )
    (cond
    ((= DCL_EXIT 0)
    (TEST_ACCEPT)
    )
    ((= DCL_EXIT 1)
    (TEST_CANCEL)
    )
    ((= DCL_EXIT 2)
    (TEST_RUN)
    )
    )
    )
    (unload_dialog DCL_ID)
    (princ)
    )

    --
    Ken Alexander
    Acad2004
    Windows XP

    "We can't solve problems by using the same kind
    of thinking we used when we created them."
    --Albert Einstein

    "Alan Henderson @ A'cad Solutions" <>
    wrote in message I am trying to write a program that allows users to temporarily close
    the dialog box to select an entity.
    I have tried many methods (most lockup AutoCAD).
    Thanks for your help...

    Here is the dialog box -
    test :dialog{
    label="Test close Dialog Box";
    :button{
    label="Pick button to close dialog box temporarily";
    key="BUTTON";
    }
    ok_cancel;
    }

    Here is the lisp routine -
    (defun TEST_RUN ()
    (setq P0 (getpoint "\nPick Point ? "))
    )
    (defun TEST_ACCEPT ()
    (setq TEST_VALUES_OK T)
    (done_dialog 1)
    )
    (defun TEST_CANCEL ()
    (setq TEST_VALUES_OK T)
    (done_dialog 0)
    )

    (defun C:TEST ()
    (setq TEST_VALUES_OK nil)
    (while (not TEST_VALUES_OK)
    (setq LIT nil)
    (setq DCL_ID (load_dialog "test.dcl"))
    (if (not (new_dialog "test" DCL_ID))
    (progn (alert "\nERROR - Problems opening or reading Dialog
    Box.")(exit))
    (progn
    (action_tile "BUTTON" "(TEST_RUN)")
    (action_tile "accept" "(TEST_ACCEPT)")
    (action_tile "cancel" "(TEST_CANCEL)")
    (setq DCL_EXIT (start_dialog))
    )
    )
    (unload_dialog DCL_ID)
    )
    (if (= DCL_EXIT 1)
    (princ "\nExit via OK")
    (princ "\nExit via Cancel")
    )
    (princ)
    )
     
    Ken Alexander, Aug 5, 2004
    #2
  3. Alan Henderson @ A'cad Solutions

    ECCAD Guest

    Alan,
    Slip something like this into the (cond
    section...

    ( (= DCL_exit 8)
    (initget 1)
    (setq pt (getpoint "\nPick Line Number Center-Line
    : ")
    LN_CL_L (rtos (car pt))
    )
    (new_dialog "pick_title" dcl_id)(get_new_set)(refresh)
    )

    Key trick is the (initget 1)...

    Bob​
     
    ECCAD, Aug 6, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.