DCL Programming Problem

Discussion in 'AutoCAD' started by Mr. B, Dec 31, 2004.

  1. Mr. B

    Mr. B Guest

    I've an Old DCL/Lisp application that I've had for a long time now. It was
    originally written probably around Acad r12 time. There is a 'needed' LISP
    file called "ai_utils.lsp" that has to be in the path in order for this DCL to
    work. This currently works okay, except my 'cancel' button is screwed up
    (probably code issue here).

    I've been trying to recreate it in ACAD 2002 LT (with DRCAuto). But I'm
    running in a problem. The reason why I want to redo this, is to get the Code
    up to modern times and not have to have the old ai_utils.lsp file needed
    (cause it's the only routine that does need it and newer versions of Acad
    doesn't appear to have it).

    Firstly, this DCL has the main pop-up (and I can get that working no sweat).
    Where I am having the difficulty is that my main Popup has 9 Buttons, a Cancel
    and an OK button. My 9 buttons bring up a separate new pop-up to allow me to
    select a bunch of items.

    The problem is that I cannot get the 2nd Popup to work. Some of my Code is as
    follows - the LTG_DLG is the 2nd Popup I'm trying to get to work - and that
    fails... Any help greatly appreciated:

    LSP File (Sched1.lsp) is as follows:

    (defun c:Sched1 ( )
    (setq testdcl (load_dialog "Sched1.dcl"))
    (if (not (new_dialog "Sched1" testdcl) ) (exit))
    (action_tile "accept" "(done_dialog)")

    (action_tile "Ltg_set" "(c:Ltg_dlg)")

    (start_dialog)
    (unload_dialog testdcl)
    (princ)
    ) ;defun

    (defun c:Ltg_dlg ( )
    (if (not (new_dialog "Ltg_dlg" testdcl) ) (exit))
    (action_tile "accept" "(ldone_dialog)")
    (start_dialog)

    (action_tile "accept" "(done_dialog 4)")
    (action_tile "cancel" "(done_dialog 0)")

    ) ; defun Ltg_dlg




    The DCL file (Sched1.dcl) as it stands is:

    Sched1 : dialog {
    alignment = centered;
    label = "Electrical Symbol Schedule";
    : cluster {
    : cluster {
    layout = vertical;

    //----------------------------------------------------------------
    : boxed_column {
    : toggle {
    key = "Hdr_main";
    label = "Main Schedule Header";
    fixed_width = 20;
    alignment = centered;
    }
    }
    //----------------------------------------------------------------
    : button {
    label = "Lighting";
    fixed_width = 20;
    alignment = centered;
    key = "Ltg_set";
    }
    : button {
    label = "Power";
    fixed_width = 20;
    alignment = centered;
    key = "Pwr_set";
    }
    : button {
    label = "Receptacles";
    fixed_width = 20;
    alignment = centered;
    key = "Rec_set";
    }
    : button {
    label = "Communications";
    fixed_width = 20;
    alignment = centered;
    key = "Com_set";
    }
    : button {
    label = "Fire Alarm";
    fixed_width = 20;
    alignment = centered;
    key = "Fir_set";
    }
    : button {
    label = "Motors";
    fixed_width = 20;
    alignment = centered;
    key = "Mtr_set";
    }
    : button {
    label = "Nurse Call";
    fixed_width = 20;
    alignment = centered;
    key = "Nur_set";
    }
    : button {
    label = "Security";
    fixed_width = 20;
    alignment = centered;
    key = "Sec_set";
    }
    : button {
    label = "Others/Misc";
    fixed_width = 20;
    alignment = centered;
    key = "Mis_set";
    }
    //----------------------------------------------------------------
    : boxed_column {
    : button {
    label = "DeSelect All";
    fixed_width = 20;
    alignment = centered;
    key = "Mis_Off";
    }
    }
    //----------------------------------------------------------------
    }
    }
    ok_cancel;
    }

    //----------------------------------------------------------------
    // Lighting Pop Up
    Ltg_pop : dialog {
    : boxed_radio_column {
    label = "Lighting Symbols";
    alignment = centered;

    : toggle {
    label = "Luminaires";
    key = "Ltg_01";
    alignment = centered;
    }
    }
    : boxed_radio_column {
    : toggle {
    label = "Select All";
    key = "Ltg_On";
    alignment = centered;
    }
    : toggle {
    label = "Deselect All";
    key = "Ltg_Off";
    alignment = centered;
    }
    }
    ok_cancel;
    }
     
    Mr. B, Dec 31, 2004
    #1
  2. ai_utils.lsp was included in both AutoCAD R2004 and R2005. Here is the
    function list in the R2005 version.

    ---------------
    (defun ai_abort (app msg)
    (defun ai_return (value) value)
    (defun ai_beep ( / f)
    (defun ai_alert (msg)
    (defun ai_acadapp ( / fname)
    (defun ai_table (table_name bit / tbldata table_list just_name)
    (defun ai_strtrim (s)
    (defun ai_num (value error_msg range / good_value)
    (defun ai_angle(value error_msg / good_value)
    (defun ai_error (s)
    (defun ai_trans ()
    (defun ai_transd ()
    (defun ai_notrans ()
    (defun ai_aselect ( / ss)
    (defun ai_aselect1 (msg / ent)
    (defun ai_autossget1 (msg / ent ss)
    (defun ai_undo_on ()
    (defun ai_undo_off ()
    (defun ai_undo_push()
    (defun ai_undo_pop()
    (defun ai_dcl (dcl_file / dcl_handle)
    (defun ai_common_state (ss_ename / bit_value)
    (defun ai_helpfile ( / platform)
    (defun ai_rtos(val / a b units old_dimzin)
    (defun ai_angtos(val / a b old_dimzin)
    (defun ai_ssget(ss / start_size end_size a diff)
    (defun ai_entity_locked (ename message)
    (defun ai_sslength (ss)
    (defun ai_setCmdEcho ( newVal / _oldEnvVal)
    ---------------

    I assume there's more to your code than you posted since I don't see any
    calls to a function starting with 'ai_'.

    Have you tried a google search for the file? I found an R12 version at
    http://www.et.utt.ro/public/CAD/ACAD12/SUPPORT/ I didn't spend the time
    to go through all of the hits, so there may be more modern versions
    available.

    Martin
     
    Martin Shoemaker, Dec 31, 2004
    #2
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.