.des compile file with DCL and another lisp

Hi!

I want to compile 2-lsp file and one dcl file. How to create .des file.

Thanks,

Avinash

Welcome!

It looks like you're new here. Sign in or register to get started.

Comments

  • edited December 2024

    You can use Blade to make a DES file. I would suggest watch a couple of youtubes how to do. Just google.

  • edited February 8

    Hi Avinash,

    Not sure if you are looking for answers on this topic. I just came across this now. You have an interesting question.

    I run a test file and learnt that you can create a DES project, add as many Lisp files as you need and add the DCL file to the compiled .des file. All your Lisp routines will work but the DCL will not. It seems the lisp will go looking for the original DCL file in your support directories.

    So, I would suggest that you create your dialog box on the go, meaning its code is inside your Lisp file and the file is generated on using the Lisp.

    Below is a Lisp routine I created and use. You can study the code there and see how it is done. Hope this helps

    (Defun C:DP(/ names dcl_id smt-dclfilename prev_post SIZ A_dim _dclWrite_dp)
    (Defun _dclWrite_dp (/ dclcode filename filehandle) ;Create dialog file
    (setq dclcode (list
    "dcl_settings : default_dcl_settings { audit_level = 3; }"
    "DMPST : dialog { label = "Dimpost Setup";"
    ": text { key = "in_val"; label = "Current Value :"; alignment = centered; }"
    ": list_box { label = "Select :"; key = "selections"; height = 12; }"
    ": toggle { label = "Along Dimline"; key = "A_dim"; }"
    ": row {"
    ": button { label = "OK"; key = "accept"; width =16; fixed_width = true; }"
    ": button { label = "Cancel"; is_cancel = true; key = "cancel"; width =16; fixed_width = true; }"
    "}"
    "}"
    ))
    (if (and (setq filename (vl-filename-mktemp "DP" nil ".tmp"))(setq filehandle (open filename "w")))
    (progn (foreach line dclcode (write-line line filehandle)) (close filehandle)))
    filename
    )
    (setq names '( "None" "c/c" "o/c" "o/o" "g/c" "g/o" "b/g" "b/s" "o/s" "f/s" "f/FFL" "c/RL" "o/RL" "APPROX." "C.O.S." "DL" "GAP" "MIN." "MAX." "MODULE" "NOM." "TYP." "TBA" "TBC")
    dcl_id (load_dialog (setq smt-dclfilename (_dclWrite_dp))) prev_post (getvar 'Dimpost))
    (if (not (new_dialog "DMPST" dcl_id "" '(-1066 426))) (exit)) ;https://adndevblog.typepad.com/autocad/2012/09/displaying-a-dcl-dialog-at-the-last-location.html
    (start_list "selections")
    (mapcar ' add_list names)
    (end_list)
    (set_tile "in_val" (strcat "Current Value : " prev_post))
    (action_tile "A_dim" "(setq A_dim 1)")
    (action_tile "cancel" "(progn (setq SIZ -1) (done_dialog))")
    (action_tile "accept" (strcat "(progn (setq SIZ (atof (get_tile "selections")))" " (done_dialog))"))
    (start_dialog)
    (unload_dialog dcl_id)
    (vl-file-delete smt-dclfilename)
    (if (= SIZ -1) (setvar 'dimpost prev_post)
    (if (= (setq SIZ (nth (fix SIZ) names)) "None") (setvar 'dimpost "") (setvar 'dimpost (strcat (if A_dim "<> " "<>\X") SIZ))))
    (princ)
    )

    All the best

  • For dcl converted to lisp code use this program.

  • You can include .DCL files as a resource file when compiling to .DES. If you're doing this, then you may need to change your LISP to suit. If the lisp had a check to see whether the .DCL was available, then you would need to change it. e.g.

    (setq dclfile (findfile "CCL-YESNO.dcl")) ; this won't work if you're including the .dcl as a resource in a .des
    (setq dclfile "CCL-YESNO.dcl") ; Instead assign directly.

    Attach a simple project with a .DCL to illustrate.

    If you load the compiled .DES, then making the following function call, it will display the dcl message box below.

    (CCL-YesNoPrmpt "Title" "Message 01" "Message 02" "Message 03" T)

  • Nice one Jason. I learnt something too.

    Much appreciated

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.