Launch Layer dialog box while my dialog is open

Discussion in 'AutoCAD' started by lucic, May 28, 2004.

  1. lucic

    lucic Guest

    In AutoCAD 2000, is it possible to invoke AutoCAD's layer dialog box (LayerProperties Manager) from within AutoLISP while in same time there is another dialog box open. I wrote a little application with DCL interface and i have a button (add a layer) to give user possibility to create a layer. But to define all characteristics of that layer i need to launch Layer dialog box.

    In the follow rows there it's a part of my code (for better explanation):

    .....
    (progn
    (command "._LAYER" "M" layer_autocad "")
    (initdia)
    (command "._LAYER")
    (initdia 0)
    (vlax-ldata-put "AUTOLAY" layer_autocad '())
    (arrange_lists)
    (layerlist_action)
    )
    .....
    When I try it AutoCAD crash.

    Can anyone help me with a suggestion.

    Thanks in advance,
    Lucian Crisan :eek:)

    P.S.
    Please, Jason....:eek:)
    Thanks :eek:)
     
    lucic, May 28, 2004
    #1
  2. lucic

    ECCAD Guest

    Sampler:
    ;; call_layer.lsp
    ;; Shows how to call up Layer Manager, with active Dialog..

    ; Dialog for testing..
    ; saveas filename 'layer_call.dcl'

    ;dcl_settings : default_dcl_settings { audit_level = 0; }
    ;
    ;do_layer : dialog {
    ;
    ; label = " Call Layer Manager ";
    ; : column {
    ; : text { label = "Layer Name ?"; }
    ; : edit_box {
    ; key = "lname";
    ; edit_width = 20;
    ; fixed_width = true;
    ; }
    ; }
    ; ok_cancel;
    ; }
    ;;
    ;; Lisp / Dialog control
    ;;
    (defun do_layers ( str_lname )
    (if (not (tblsearch "layer" str_lname))
    (progn
    (command "_Layer" "_M" str_lname "")
    (initdia)
    (command "_Layer"); call up Layer Manager
    (initdia 0)
    ); end progn
    (alert (strcat "Layer Name " str_lname " already Exists.."))
    ); end if
    ); end function
    ;;
    (defun do_dialog ()
    (setq dcl_id (load_dialog (strcat ec_drv "/acad/layer_call.dcl")))
    (if (not (new_dialog "do_layer" dcl_id)) (exit))
    (mode_tile "lname" 2)
    ;;
    (setq what_next 7 lname nil)
    (while (/= 4 what_next)
    (action_tile "lname" "(setq lname $value)")
    (action_tile "accept" "(done_dialog 4)")
    (action_tile "cancel" "(done_dialog 4)")
    (setq what_next (start_dialog))
    ); end while what_next
    (unload_dialog dcl_id)
    ;;
    ;; Check actions
    ;;
    (if (/= lname nil)
    (do_layers lname)
    ); end if
    (princ)
    ); end function

    ;;
    ;; Fire it up
    (do_dialog)
    (princ)
     
    ECCAD, May 28, 2004
    #2
  3. lucic

    lucic Guest

    Dear Bob,

    firtst of all thanks for your reply, thanks for your time dedicated to my problem. But problem persist, yet...
    Because I want to recall my dialog box after the Layer Manager dialog box was closed.
    So I want to open my dialog box; from within my dialog I want to open Layer Manager, and after I close Layer Manager, i want to recall my dialog box.
    Have u any ideea?

    Thanks in advance,
    Lucian :eek:)
     
    lucic, May 31, 2004
    #3
  4. lucic

    zeha Guest

    place them in teh while loop
    see below
    (defun do_layers ( str_lname )
    (if (not (tblsearch "layer" str_lname))
    (progn
    (command "_Layer" "_M" str_lname "")
    (initdia)
    (command "_Layer"); call up Layer Manager
    (initdia 0)
    ); end progn
    (alert (strcat "Layer Name " str_lname " already Exists.."))
    ); end if
    ); end function
    ;;
    (defun do_dialog ()
    (setq dcl_id (load_dialog (strcat ec_drv "/acad/layer_call.dcl")))
    (if (not (new_dialog "do_layer" dcl_id)) (exit))
    (mode_tile "lname" 2)
    ;;
    (setq what_next 7 lname nil)
    (while (/= 4 what_next)
    (action_tile "lname" "(setq lname $value)(done_dialog 2)")
    (action_tile "accept" "(done_dialog 1)")
    (action_tile "cancel" "(done_dialog 0)")
    (setq what_next (start_dialog))
    (if (= what_next 2)(do_layers lname))
    ); end while what_next
    (unload_dialog dcl_id)
    ;;
    ;; Check actions
    ;;
    (princ)
    ); end function

    ;;
    ;; Fire it up
    (do_dialog)
    (princ)
     
    zeha, May 31, 2004
    #4
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.