+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19
  1. #1
    Forum Newbie
    Using
    AutoCAD 2013
    Join Date
    Mar 2015
    Posts
    9

    Default Dynamically Generated .DCL file issues

    Registered forum members do not see this ad.

    Hi Everyone,

    I've been lurking here for over a year now and have found lots of useful information (thanks!), but I've finally done something that doesn't seem to have been solved before, and that there may be no easy answer to.

    We use a complicated system of layer states, views, and freezing and unfreezing layers to set up different print states to create a package of drawings. It is sort of a wacky use of AutoCAD, but this is due to the necessity of showing an opera as it progresses through time (Act 1, Act 2, etc.). We have hundreds of operas in our repertory and this won't be changing anytime soon.

    Anyway, as it stands now, there is a .txt file that lives in the same directory as the file containing the scenery that is manually created so that print scripts can work. I am attempting to turn that .txt file into something that lives in a dialog box for ease of use and cleanliness. The data will be stored in a mulitline attribute in a block.

    I've spent a fair amount of time creating a dialog box that changes size dynamically, allows for reordering of printouts and having multiple scenery layers appear on the same printout. My only real issue (which is of course a big one) is that if you add too many rows, the dialog box becomes too big to fit on the screen. What I would love to be able to do is to make the whole box (except the buttons at the bottom) scroll up and down so that the height of the dialog box is fixed to the smallest screen we use here (~800 pixels). I've spent a little time with OpenDCL but find it a bit byzantine, and I don't know any .NET or VBA so either of those solutions will involve me learning some new programming languages--not necessarily a deal breaker but not ideal either.

    I'm attaching a .dwg with the attributed block and the .lsp file for anyone who wants to take a look. The command c:met_plot_2015 will create and open the dialog box, which you can then manipulate.

    I appreciate anyone who read to the end of this post, and any help you can provide.

    Thanks,
    Eric

    P.S. The printing function doesn't actually work yet; that's next on the list once I solve this.

    specialblock.dwg

    BETTERPRINTING 5.LSP

  2. #2
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,901

    Default

    Did not look at code but you can have a list box and it can have as many lines as you like, scroll up and down. It would work with reading a text file to say put a short version for what you want to pick.

    Code:
    ; very much thanks to Alan J T for original code
     
      ;; List Select Dialog (Temp DCL list box selection, based on provided list)
      ;; title - list box title
      ;; label - label for list box
      ;; height - height of box
      ;; width - width of box
      ;; multi - selection method ["true": multiple, "false": single]
      ;; lst - list of strings to place in list box
      ;; Alan J. Thompson, 09.23.08 / 05.17.10 (rewrite)
    (defun AT:ListSelect (title label height width multi lst / fn fo d item f)
      (setq fo (open (setq fn (vl-filename-mktemp "" "" ".dcl")) "w"))
      (foreach x (list (strcat "list_select : dialog { label = \"" title "\"; spacer;")
                       (strcat ": list_box { label = \"" label "\";" "key = \"lst\";")
                       (strcat "allow_accept = true; height = " (vl-princ-to-string height) ";")
                       (strcat "width = " (vl-princ-to-string width) ";")
                       (strcat "multiple_select = " multi "; } spacer; ok_cancel; }")
                 )
        (write-line x fo)
      )
      (close fo)
      (new_dialog "list_select" (setq d (load_dialog fn)))
      (start_list "lst")
      (mapcar (function add_list) lst)
      (end_list)
      (setq item (set_tile "lst" "0"))
      (action_tile "lst" "(setq item $value)")
      (setq f (start_dialog))
      (unload_dialog d)
      (vl-file-delete fn)
      (if (= f 1)
        ((lambda (s / i s l)
           (while (setq i (vl-string-search " " s))
             (setq l (cons (nth (atoi (substr s 1 i)) lst) l))
             (setq s (substr s (+ 2 i)))
           )
           (reverse (cons (nth (atoi s) lst) l))
         )
          item
        )
      )
    )
     
    ; basicly make a list LST of the lines to be displayed then call it
     
    (setq surface (car (AT:ListSelect
                                        "Set new surface style"
                                        "Select style"
                                        10
                                        10
                                        "false"
                                        (vl-sort (mapcar (function car) lst) '<)
                                      ) )
         )   ; end setq
    Listselect.jpg
    A man who never made mistakes never made anything

  3. #3
    Forum Newbie
    Using
    AutoCAD 2013
    Join Date
    Mar 2015
    Posts
    9

    Default

    Thanks for the response, but if you actually look at the code, what I am doing is significantly more complicated. For each line (each line is a different sheet for the print), there is the option to select one or more layers, and whether you want a ground plan or a section. You can also change the order in which the sheets are listed.

  4. #4
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,901

    Default

    Again I have not run code I think a couple of screen images would have helped us to comment, are you using sub dialouge boxes ie pick properties "Section" then pop sheet number close pick something else.
    A man who never made mistakes never made anything

  5. #5
    Forum Newbie
    Using
    AutoCAD 2013
    Join Date
    Mar 2015
    Posts
    9

    Default

    Here are some screen shots. Each boxed row is a different print sheet; you can add additional layers to each print with the plus button, or add an additional print sheet with the plus button at the bottom. The arrows reorder the list and the delete buttons work as you'd expect. The only issue is that if you add too many rows the dialog box gets too big. I'd rather not have to split things across multiple dialog boxes because being able to see everything at once is very helpful.


    screenshot 1.jpg
    screenshot 2.jpgscreenshot3.jpg

  6. #6
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,368

    Default

    Nice buttons Eric
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  7. #7
    Forum Newbie
    Using
    AutoCAD 2013
    Join Date
    Mar 2015
    Posts
    9

    Default

    I definitely have you to thank for those (and some other stuff in there...)

  8. #8
    Senior Member LibertyOne's Avatar
    Using
    AutoCAD 2010
    Join Date
    Apr 2011
    Location
    Germany
    Posts
    194

    Default

    What about adding a vertical slider to contain the list of print sheets? Or maybe showing the information a bit differently? Perhaps in a tree list or table. I think the functionality would still work.
    If you ever feel like you are in the need of help, make use of the dot-dot-dot-dash-dash-dash-dot-dot-dot linetype.

  9. #9
    Forum Newbie
    Using
    AutoCAD 2013
    Join Date
    Mar 2015
    Posts
    9

    Default

    A vertical slider is exactly what I'm looking for, but I don't know how to implement it. Can you give me some more information?

  10. #10
    Senior Member LibertyOne's Avatar
    Using
    AutoCAD 2010
    Join Date
    Apr 2011
    Location
    Germany
    Posts
    194

    Default

    Registered forum members do not see this ad.

    I'm not really that good with DCL, but I've looked in on it thoroughly. The only problem I have is testing a few things out. Some of my questions are:
    Can you use a slider to move all those tiles up and down together?
    I would test moving some sets of radio row tiles first just to see if that works.
    Can you set a slider on a frame to move contents within that frame?
    That would be interesting to know.
    If you ever feel like you are in the need of help, make use of the dot-dot-dot-dash-dash-dash-dot-dot-dot linetype.

Similar Threads

  1. list box generated from text file
    By dan_g8 in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 22nd Sep 2014, 04:19 am
  2. display the distance dynamically
    By vivekgrs in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 20th Nov 2009, 07:08 am
  3. Dynamically updating titleblocks
    By cadsultant in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 27th Jan 2009, 02:43 am
  4. Dynamically linking Text
    By keng000 in forum AutoCAD Drawing Management & Output
    Replies: 9
    Last Post: 10th Nov 2008, 07:18 pm
  5. Error when opening DXF file generated by another program
    By Kirill2005 in forum AutoCAD Drawing Management & Output
    Replies: 6
    Last Post: 24th Oct 2005, 06:23 pm

Tags for this Thread

Bookmarks

Posting Permissions

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