Results 1 to 2 of 2

Thread: Auto assign a named view (model) to a viewport in a layout (LISP)

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    2012-04
    Posts
    1
    Login to Give a bone
    0

    Default Auto assign a named view (model) to a viewport in a layout (LISP)

    Hi everybody.

    Scenario:

    I use "multi pages" drawings where each page is on a different
    area in model space and on a different layer too.
    When I create a new drawing I choose how many pages
    I want and the LISP routine I wrote (ages ago) creates
    as many named views and layers as pages, each one with just
    the page number as name ("1", "2", etc).

    Till now I've been using another LISP self made routine
    to batch print but now I would like to take advantage
    of the publish printing to easily get a multipage PDF.

    But this needs layouts to use them as sheets so I modified
    my old routine and now it creates as many layouts as pages too.

    Now I'm looking for a way to automatically assign the named view "1"
    to the single viewport in (or of?) the layout "1"; the named view "2"
    to the vieport of the layout "2" and so on.

    But, having never used paper space and vieports before I'm a bit lost.

    I hope somebody will point me to the right direction.

    I searched the forums but I didn't find an answer.

    Thanks for your attention.

    fabio

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

    Default Re: Auto assign a named view (model) to a viewport in a layout (LISP)

    Loop through your tabs by setting the CTab variable to each (you can get a list of tab names with the layoutlist function). Then in each isse the command MSpace to ensure you're inside the viewport. If you've got more than one viewport on any one tab, the CVport sysvar is 1 for the paper space itself, 2 through N for the rest. Then use the command view and its command-line Restore option to restore the saved view. Issue the PSpace command to return out of the viewport's model space, then setvar CTab to the next layout tab name.

    There are probably ways of doing it without calling commands, but that would be quite a lot of hacking

Similar Threads

  1. Replies: 5
    Last Post: 2013-12-20, 04:54 PM
  2. Sorting named model views in view manager
    By Jonathan Pitt in forum AutoCAD General
    Replies: 5
    Last Post: 2010-09-09, 11:13 AM
  3. TIFs in Layout Viewport shifted not in Model
    By Spokes in forum Raster Design - General
    Replies: 3
    Last Post: 2010-06-28, 05:47 PM
  4. Associate viewport to a named custom view
    By aarkeykamal in forum AutoCAD General
    Replies: 7
    Last Post: 2009-05-29, 11:31 AM
  5. Replies: 3
    Last Post: 2008-01-17, 01:08 PM

Posting Permissions

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