+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Full Member
    Using
    AutoCAD 2012
    Join Date
    Feb 2009
    Posts
    30

    Default Plot named views

    Registered forum members do not see this ad.

    Hi all

    Looking for some quick help, I am trying to plot all named views in Model Space via Lisp but im running into a few problems at the moment

    the number of views in each drawing varies, i can get the lisp to view each individual view on screen but when printing it only prints the first view multiple times

    i.e 8 views total, onscreen it goes to each of the 8 individual views but prints 8 copies of the first view

    any ideas?


    Code:
    (defun c:testplot (/ view)
      (while (setq view (tblnext "view" (null 
    view)))
        (command "_.-view" "_restore" (cdr (assoc 2 
    view)))
        (command "_.plot" "y" "" "" "A3" "" "" "" "view" 
    "" "" "" "" "standard.ctb" "" "" "" "y" "")
      ) ;_ while
     
    (princ)
    ) ;_ defun
    Last edited by migs; 11th Apr 2012 at 10:45 am.

  2. #2
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,640

    Default

    Instead of "_.view "_restore"

    Code:
    Enter drawing orientation [Portrait/Landscape] <Landscape>: L
    Plot upside down? [Yes/No] <No>: N
    Enter plot area [Display/Extents/Limits/View/Window] <Window>: V
    Enter view name <>: [supply View Name Here]
    I just tried it.. it works here.

    Code:
    (defun c:testplot (/ view)
      (while (setq view (tblnext
                              "view"
                              (null
                                    view)))
            (command  "_.plot" "Yes"  "Model" "YourPrinter"
                  "A3" "Inches" "Landscape"  "No"
                  "View" (cdr (assoc 2 view)) "Fit"
                  "Center" "Yes" "standard.ctb"
                  "Yes"  "Wireframe" "No" "No" "Yes")
            ) ;_ while
     (princ)
    )
    Last edited by pBe; 11th Apr 2012 at 12:11 pm.

  3. #3
    Full Member
    Using
    AutoCAD 2012
    Join Date
    Feb 2009
    Posts
    30

    Default

    pBe

    i guess my question is:

    is there a way to automatically add in the view names rather than specifying each one individually as like i said there could be 3 sheets or 50 sheets on the drawing

    thats why i was getting confused as i can get the screen to view each individual sheet automatically but it will only print the first sheet by the number of sheets it finds on screen

    Ive never had to deal with this before as id normally use the layout for each sheet however the company has setup the drawings in this way, hopefully i can convince them to change methods but for now im just trying to save some time

  4. #4
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,640

    Default

    Quote Originally Posted by migs View Post
    pBe
    i guess my question is:
    is there a way to automatically add in the view names rather than specifying each one individually as like i said there could be 3 sheets or 50 sheets on the drawing
    You will need to loop thru tblnext to make a list of "view", i not sure if theres any other way
    What you can do is compile the list then print, but that wouldnt be any better that printing while on the loop

    Quote Originally Posted by migs View Post
    thats why i was getting confused as i can get the screen to view each individual sheet automatically but it will only print the first sheet by the number of sheets it finds on screen
    Code:
    (command "_.plot" "y" "" "" "A3" "" "" "" "view" 
    "" ;<--- first "view" name will remain as you are accepting the previous view name
    "" "" "" "standard.ctb" "" "" "" "y" "")
      ) ;_
    that is why i suggest passing the view name after "View"

  5. #5
    Full Member
    Using
    AutoCAD 2012
    Join Date
    Feb 2009
    Posts
    30

    Default

    Quote Originally Posted by pBe View Post
    Instead of "_.view "_restore"

    Code:
    Enter drawing orientation [Portrait/Landscape] <Landscape>: L
    Plot upside down? [Yes/No] <No>: N
    Enter plot area [Display/Extents/Limits/View/Window] <Window>: V
    Enter view name <>: [supply View Name Here]
    I just tried it.. it works here.

    Code:
    (defun c:testplot (/ view)
      (while (setq view (tblnext
                              "view"
                              (null
                                    view)))
            (command  "_.plot" "Yes"  "Model" "YourPrinter"
                  "A3" "Inches" "Landscape"  "No"
                  "View" (cdr (assoc 2 view)) "Fit"
                  "Center" "Yes" "standard.ctb"
                  "Yes"  "Wireframe" "No" "No" "Yes")
            ) ;_ while
     (princ)
    )
    Bingo!

    never even thought of adding in (cdr (assoc 2 view)) there

    just running through some checks on it but so far it seems to be exactly what im looking for!

    cheers pBe

  6. #6
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,640

    Default

    Good for you. Glad it helps.


    BTW: if you want to stick with the way you had it before, use "Display" instead of "view"

  7. #7
    Luminous Being
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    5,363

    Default

    Registered forum members do not see this ad.

    Interesting how the same questions keep being asked http://www.cadtutor.net/forum/showth...ighlight=views
    A man who never made mistakes never made anything

Similar Threads

  1. script to plot all (named)views
    By pmxcad in forum The CUI, Hatches, Linetypes, Scripts & Macros
    Replies: 14
    Last Post: 30th Mar 2012, 02:42 am
  2. Copy Named Views
    By MKearney028 in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 2nd Mar 2012, 06:06 pm
  3. Named Views
    By Miro in forum AutoCAD General
    Replies: 2
    Last Post: 20th Jul 2010, 12:46 am
  4. UCS named views
    By Miro in forum AutoCAD General
    Replies: 2
    Last Post: 19th Jul 2010, 04:13 am
  5. Named Views in 2007
    By CADTutor in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 17th Dec 2006, 07:17 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