Results 1 to 10 of 10

Thread: DCL's for dummy

  1. #1
    All AUGI, all the time gfreddog's Avatar
    Join Date
    2003-07
    Location
    Pequannock NJ US of A
    Posts
    641
    Login to Give a bone
    0

    Default DCL's for dummy

    I noticed some LISP's on this forum that also require a DCL file.

    In previous threads I have also seen what DCL's do explained.

    But my question is how do I load them or where do I save them?

    (Be gentle I'm a mediocre LISPer)

  2. #2
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: DCL's for dummy

    The dcl file just has to be in the search path. The code will try and load the file from the search path, and it it's found it will try and load the dialog box from said file.

    (setq DiaLoad (load_dialog "MyDialogs.dcl"))
    (new_dialog "MultiSelect" DiaLOad)

    This loads the dialog called ' MultiSelect ' from the dialog file ' MyDialogs.dcl '. It is in the search path, therefore I don't need a fully qualified path to it. You might want to look at what those two dialog functions do ( load_dialog new_dialog ) as it has been a long time since I looked at them in the help.

  3. #3
    All AUGI, all the time gfreddog's Avatar
    Join Date
    2003-07
    Location
    Pequannock NJ US of A
    Posts
    641
    Login to Give a bone
    0

    Thumbs up Re: DCL's for dummy

    Ah okay. So I have a folder for my LISPs and as long as the DCL is in the same folder AND that folder is in the AutoCAD Search Path it will see it.

    Thanks for the clarifications

  4. #4
    I could stop if I wanted to
    Join Date
    2005-09
    Location
    Canada
    Posts
    214
    Login to Give a bone
    0

    Default Re: DCL's for dummy

    you can also specify the path...

    (setq DiaLoad (load_dialog "x:\\my dialogs\\MyDialogs.dcl"))

  5. #5
    All AUGI, all the time gfreddog's Avatar
    Join Date
    2003-07
    Location
    Pequannock NJ US of A
    Posts
    641
    Login to Give a bone
    0

    Default Re: DCL's for dummy

    Quote Originally Posted by andrea.andreetti View Post
    you can also specify the path...

    (setq DiaLoad (load_dialog "x:\\my dialogs\\MyDialogs.dcl"))
    Merci mon ami utiles, Ma famille est originaire de Québec (and my french is very limited living in Joisey! )
    Last edited by gfreddog; 2009-02-04 at 09:28 PM. Reason: Edit the Edit

  6. #6
    I could stop if I wanted to
    Join Date
    2005-09
    Location
    Canada
    Posts
    214
    Login to Give a bone
    0

    Default Re: DCL's for dummy

    Quote Originally Posted by gfreddog View Post
    Merci mon ami utiles, Ma famille est originaire de Québec (and my french is very limited living in Joisey! )
    i was born in Italy....but I live in Quebec. enchanté !

  7. #7
    I could stop if I wanted to CadDog's Avatar
    Join Date
    2005-06
    Location
    So Ca
    Posts
    439
    Login to Give a bone
    0

    Default Re: DCL's for dummy

    Quote Originally Posted by gfreddog View Post
    Merci mon ami utiles, Ma famille est originaire de Québec (and my french is very limited living in Joisey! )

    That shows you can't judge a person my his/her icon, location, etc...



    I thought he was a wonder kid...
    So young and yet able to type so nicely...


  8. #8
    I could stop if I wanted to
    Join Date
    2005-09
    Location
    Canada
    Posts
    214
    Login to Give a bone
    0

    Default Re: DCL's for dummy


  9. #9
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: DCL's for dummy

    Another thing you could do is to combine the LSP & DCL files into a VLX file (using VLISP). Then simply loading the VLX loads both the LSP & DCL ... no need for paths. Easy way of running some special code that you don't want to have cluttering the rest of your lisp paths.

  10. #10
    I could stop if I wanted to
    Join Date
    2007-08
    Posts
    202
    Login to Give a bone
    0

    Default Re: DCL's for dummy

    Hi,

    Another way is to write the DCL from the LISP in a temporary file.
    Here's a little example:

    Code:
    ;; ListBox (gile)
    ;; Dialog box which allows a single or multple choice
    ;;
    ;; Arguments:
    ;; title : dialog title (string)
    ;; msg ; message (string), "" or nil for none
    ;; keylab : assoc list which type is ((key1 . label1) (key2 . label2) ...)
    ;; flag : 0 = popup list
    ;;        1 = single choice list
    ;;        2 = multiple choice list
    ;;
    ;; Return : the key of the choosen option (flag = 0 or 1) or the key list (flag = 2)
    ;;
    ;; Example:
    ;; (listbox "Layout" "Choose a layout" (mapcar 'cons (layoutlist) (layoutlist)) 1)
    
    (defun ListBox (title msg keylab flag / tmp file dcl_id choice)
      (setq	tmp  (vl-filename-mktemp "tmp.dcl")
    	file (open tmp "w")
      )
      (write-line
        (strcat "ListBox:dialog{label=\"" title "\";")
        file
      )
      (if (and msg (/= msg ""))
        (write-line (strcat ":text{label=\"" msg "\";}") file)
      )
      (write-line
        (cond
          ((= 0 flag) "spacer;:popup_list{key=\"lst\";")
          ((= 1 flag) "spacer;:list_box{key=\"lst\";")
          (T "spacer;:list_box{key=\"lst\";multiple_select=true;")
        )
        file
      )
      (write-line "}spacer;ok_cancel;}" file)
      (close file)
      (setq dcl_id (load_dialog tmp))
      (if (not (new_dialog "ListBox" dcl_id))
        (exit)
      )
      (start_list "lst")
      (mapcar 'add_list (mapcar 'cdr keylab))
      (end_list)
      (action_tile
        "accept"
        "(or (= (get_tile \"lst\") \"\")
        (if (= 2 flag) (progn
        (foreach n (str2lst (get_tile \"lst\") \" \")
        (setq choice (cons (nth (atoi n) (mapcar 'car keylab)) choice)))
        (setq choice (reverse choice)))
        (setq choice (nth (atoi (get_tile \"lst\")) (mapcar 'car keylab)))))
        (done_dialog)"
      )
      (start_dialog)
      (unload_dialog dcl_id)
      (vl-file-delete tmp)
      choice
    )
    
    ;; STR2LST
    ;; Transforms a string with separator into a list of strings
    ;;
    ;; Arguments
    ;; str = the string
    ;; sep = the separator pattern
    (defun str2lst (str sep / pos)
      (if (setq pos (vl-string-search sep str))
        (cons (substr str 1 pos)
    	  (str2lst (substr str (+ (strlen sep) pos 1)) sep)
        )
        (list str)
      )
    )
    This way, allows to create the dialog box differently according to parameters got by the LISP before writing the file.
    In the attached file, SSD is used to make a dynamic blocks selection filtered by their dynamic properties. The dialog box to choose the properties is created after the choice of a target block and matches its dynamic properties.
    Attached Files Attached Files
    Last edited by 'gile'; 2009-02-06 at 05:06 PM.

Similar Threads

  1. Where is the dummy forum?
    By jmdraft0 in forum New Forum Users (Non technical)
    Replies: 12
    Last Post: 2012-02-28, 05:59 PM
  2. dummy people pass
    By batproj in forum 3ds Max - General
    Replies: 4
    Last Post: 2010-11-22, 01:33 PM
  3. Standard details - best in dummy project or template?
    By fernandez in forum Revit Architecture - General
    Replies: 1
    Last Post: 2009-04-23, 05:06 PM
  4. How do I make a dummy schedule?
    By whatisrice in forum Revit - Platform
    Replies: 3
    Last Post: 2008-03-25, 03:47 PM
  5. Dummy Dimension family
    By ron.sanpedro in forum Revit Architecture - Families
    Replies: 7
    Last Post: 2006-11-21, 03:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •