+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 40
  1. #1
    Full Member
    Using
    AutoCAD 2015
    Join Date
    Aug 2013
    Posts
    89

    Default Print selected views from model space

    Registered forum members do not see this ad.

    Hello,
    I have a LISP that used to work perfect until I switched to Acad2017.
    I installed the new Dos_lib for Acad2017 and I still get the same error: "error: no function definitionos_Multilist.
    Is there a way to achieve the same result without using Dos_lib or fixing this code to work with Acad2017?
    This is the code(created by Stefan BMR):
    Code:
    (defun c:plotview ( / acobj acdoc views view_list)
      (setq acobj (vlax-get-acad-object)
            acdoc (vla-get-activedocument acobj)
            views (vla-get-views acdoc)
            )
      (vlax-for view views
        (setq view_list (cons (vla-get-name view) view_list))
        )
      (foreach view (dos_multilist "PLOT SELECTED VIEWS" "Select views to plot" view_list)
        (command
          "_plot"
          "_y"
          "Model"
          "DWG To PDF.pc3"
          "ANSI A (11.00 x 8.50 Inches)"
          "Inches"
          "Landscape"
          "No"
          "View"
          view
          "Fit"
          "Center"
          "Yes"
          "ICP.ctb"
          "Yes"
          "A"
          (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) " - " view ".pdf")
          "No"
          "Yes"
          )
        )
      (princ)
      )
    Thank you

  2. #2
    Senior Member
    Discipline
    Civil
    Hippe013's Discipline Details
    Occupation
    Survey Crew Chief / Civil Designer
    Discipline
    Civil
    Details
    Land Survey / Civil Engineering
    Using
    Civil 3D 2017
    Join Date
    Feb 2010
    Location
    North Dakota
    Posts
    385

    Default

    Dos_Mulitlist still works in Acad2017.

    Two things that you will want to check. Is doslib loaded? Are you using the correct arx?

    For 2017 on a 64 bit machine it should be DOSLib21x64.arx

    I am currently using DosLib21x64 on Acad 2017 and it is working just fine.

    regards,

    Hippe013

  3. #3
    Full Member
    Using
    AutoCAD 2015
    Join Date
    Aug 2013
    Posts
    89

    Default

    Dos_lib is loaded and I use DOSLib21x64.arx on a 64 bit machine.
    Perhaps it's an issue with the lisp?
    Any ideas how to make this work are appreciated.
    Thank you

  4. #4
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,792

    Default

    Removed wrong idea
    A man who never made mistakes never made anything

  5. #5
    Full Member
    Using
    AutoCAD 2015
    Join Date
    Aug 2013
    Posts
    89

    Default

    Do you have a lisp(you can share)capable of doing the same thing ?:
    -showing views in model space
    -let you select the views that you want to plot

  6. #6
    Super Member rlx's Avatar
    Computer Details
    rlx's Computer Details
    Operating System:
    W10
    Computer:
    i74ghz/ssd500/2tbhdd
    Discipline
    Electrical
    rlx's Discipline Details
    Occupation
    electrical designer dragon
    Discipline
    Electrical
    Details
    I dont excel in anything but I rearly give up
    Using
    AutoCAD 2016
    Join Date
    Nov 2014
    Location
    Bergen op Zoom , Netherlands
    Posts
    1,106

    Default

    I did write a plot lisp that also can plot views but it's relatively old and I'm not sure if all options work. Never quite finished it and probably could write some parts of the code much better by now , just not enough hours in a day...


    Anywayz , maybe it's usefull , at least the view part I hope. Once dialog has started (I hope) , go to advanced options and select view in the plot range section.


    gr. Rlx
    Attached Images
    Attached Files
    Last edited by rlx; 3rd Aug 2016 at 09:02 am.

  7. #7
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,792

    Default

    Nice one RLX need extra to "Plot all tabs" "Plot range"

    Tazzz http://www.lee-mac.com/listbox.html this should replace the DOSLIB function.
    A man who never made mistakes never made anything

  8. #8
    Super Member rlx's Avatar
    Computer Details
    rlx's Computer Details
    Operating System:
    W10
    Computer:
    i74ghz/ssd500/2tbhdd
    Discipline
    Electrical
    rlx's Discipline Details
    Occupation
    electrical designer dragon
    Discipline
    Electrical
    Details
    I dont excel in anything but I rearly give up
    Using
    AutoCAD 2016
    Join Date
    Nov 2014
    Location
    Bergen op Zoom , Netherlands
    Posts
    1,106

    Default

    Quote Originally Posted by BIGAL View Post
    Nice one RLX need extra to "Plot all tabs" "Plot range"

    Tazzz http://www.lee-mac.com/listbox.html this should replace the DOSLIB function.


    Thanx Bigal... I really should finish it (one day) but looking on the bright side , company I'm working at moment has decided there's no more room for an engineerings department so end of this year I just might have all the time I need :-)


    gr.R.

  9. #9
    Full Member
    Using
    AutoCAD 2015
    Join Date
    Aug 2013
    Posts
    89

    Default

    BIGAL, rlx thank you for your postings.
    Since I am still learning LISP , at this point I find it difficult to call Lee's function (and to replace dos_multilist).
    These are both programs and the small change I did:
    Code:
    ;; created by Stefan BMR
    (defun c:plotview ( / acobj acdoc views view_list LISTBOX)
      (setq acobj (vlax-get-acad-object)
            acdoc (vla-get-activedocument acobj)
            views (vla-get-views acdoc)
            )
      (vlax-for view views
        (setq view_list (cons (vla-get-name view) view_list))
        )
      (foreach view (LISTBOX "PLOT SELECTED VIEWS" "Select views to plot" view_list)
        (command
          "_plot"
          "_y"
          "Model"
          "DWG To PDF.pc3"
          "ARCH C (24.00 x 18.00 Inches)"
          "Inches"
          "Landscape"
          "No"
          "View"
          view
          "Fit"
          "Center"
          "Yes"
          "ICP.ctb"
          "Yes"
          "A"
          (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) " - " view ".pdf")
          "No"
          "Yes"
          )
        )
      (princ)
      )
    
    
    ;;Created by Lee Mac
    ;; bit - [int] 1=allow multiple; 2=return indexes
    ;; Returns: [lst] List of selected items/indexes, else nil
    
    (defun LM:listbox ( msg lst bit / dch des tmp rtn )
        (cond
            (   (not
                    (and
                        (setq tmp (vl-filename-mktemp nil nil ".dcl"))
                        (setq des (open tmp "w"))
                        (write-line
                            (strcat "listbox:dialog{label=\"" msg "\";spacer;:list_box{key=\"list\";multiple_select="
                                (if (= 1 (logand 1 bit)) "true" "false") ";width=50;height=15;}spacer;ok_cancel;}"
                            )
                            des
                        )
                        (not (close des))
                        (< 0 (setq dch (load_dialog tmp)))
                        (new_dialog "listbox" dch)
                    )
                )
                (prompt "\nError Loading List Box Dialog.")
            )
            (   t     
                (start_list "list")
                (foreach itm lst (add_list itm))
                (end_list)
                (setq rtn (set_tile "list" "0"))
                (action_tile "list" "(setq rtn $value)")
                (setq rtn
                    (if (= 1 (start_dialog))
                        (if (= 2 (logand 2 bit))
                            (read (strcat "(" rtn ")"))
                            (mapcar '(lambda ( x ) (nth x lst)) (read (strcat "(" rtn ")")))
                        )
                    )
                )
            )
        )
        (if (< 0 dch)
            (unload_dialog dch)
        )
        (if (and tmp (setq tmp (findfile tmp)))
            (vl-file-delete tmp)
        )
        rtn
    )
    Hope someone will help me with this task
    Thank you

  10. #10
    Super Member rlx's Avatar
    Computer Details
    rlx's Computer Details
    Operating System:
    W10
    Computer:
    i74ghz/ssd500/2tbhdd
    Discipline
    Electrical
    rlx's Discipline Details
    Occupation
    electrical designer dragon
    Discipline
    Electrical
    Details
    I dont excel in anything but I rearly give up
    Using
    AutoCAD 2016
    Join Date
    Nov 2014
    Location
    Bergen op Zoom , Netherlands
    Posts
    1,106

    Default

    Registered forum members do not see this ad.

    try this :

    Code:
    ;; created by Stefan BMR
    (defun c:plotview ( / acobj acdoc views view_list LISTBOX)
      (vl-load-com)
      (setq acobj (vlax-get-acad-object)
            acdoc (vla-get-activedocument acobj)
            views (vla-get-views acdoc)
            )
      (vlax-for view views
        (setq view_list (cons (vla-get-name view) view_list))
        )
      (foreach view (LM:listbox "Select views to plot" view_list 1)
        (command
          "_plot"
          "_y"
          "Model"
          "DWG To PDF.pc3"
          "ARCH C (24.00 x 18.00 Inches)"
          "Inches"
          "Landscape"
          "No"
          "View"
          view
          "Fit"
          "Center"
          "Yes"
          "ICP.ctb"
          "Yes"
          "A"
          (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) " - " view ".pdf")
          "No"
          "Yes"
          )
        )
      (princ)
      )
    
    
    ;;Created by Lee Mac
    ;; bit - [int] 1=allow multiple; 2=return indexes
    ;; Returns: [lst] List of selected items/indexes, else nil
    
    (defun LM:listbox ( msg lst bit / dch des tmp rtn )
        (cond
            (   (not
                    (and
                        (setq tmp (vl-filename-mktemp nil nil ".dcl"))
                        (setq des (open tmp "w"))
                        (write-line
                            (strcat "listbox:dialog{label=\"" msg "\";spacer;:list_box{key=\"list\";multiple_select="
                                (if (= 1 (logand 1 bit)) "true" "false") ";width=50;height=15;}spacer;ok_cancel;}"
                            )
                            des
                        )
                        (not (close des))
                        (< 0 (setq dch (load_dialog tmp)))
                        (new_dialog "listbox" dch)
                    )
                )
                (prompt "\nError Loading List Box Dialog.")
            )
            (   t     
                (start_list "list")
                (foreach itm lst (add_list itm))
                (end_list)
                (setq rtn (set_tile "list" "0"))
                (action_tile "list" "(setq rtn $value)")
                (setq rtn
                    (if (= 1 (start_dialog))
                        (if (= 2 (logand 2 bit))
                            (read (strcat "(" rtn ")"))
                            (mapcar '(lambda ( x ) (nth x lst)) (read (strcat "(" rtn ")")))
                        )
                    )
                )
            )
        )
        (if (< 0 dch)
            (unload_dialog dch)
        )
        (if (and tmp (setq tmp (findfile tmp)))
            (vl-file-delete tmp)
        )
        rtn
    )
    gr. Rlx

Similar Threads

  1. No objects visible in model space/3d views
    By PACKRAT69 in forum AutoCAD 3D Modelling & Rendering
    Replies: 3
    Last Post: 6th Mar 2016, 01:28 pm
  2. Plot Views, sheets at the same Model Space.
    By CafeJr in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 19th Oct 2015, 12:41 pm
  3. I have 2 views showing in model space...
    By kippax in forum AutoCAD Beginners' Area
    Replies: 4
    Last Post: 3rd Sep 2015, 04:02 pm
  4. No objects in Model space, But View ports has dwg views
    By RRS1987 in forum AutoCAD Drawing Management & Output
    Replies: 5
    Last Post: 4th Aug 2015, 01:48 pm
  5. Model Space Views ??
    By 4:3 in wide in forum AutoCAD General
    Replies: 4
    Last Post: 26th Aug 2009, 07:39 am

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