+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Junior Member
    Using
    AutoCAD 2012
    Join Date
    May 2012
    Posts
    16

    Default Create viewport boundary from model space polyline

    Registered forum members do not see this ad.

    Hi All.

    Im assuming this could be done via a lisp but not entirely sure.

    Im wondering if there is a way to create a layout with border plus a viewport that uses a polyline/block set in model space as its reference for its limits. Almost the opposite way that the change space command works but creating a viewport in the process.

    I basically have some polylines setup in a drawing that essentially ring around certain areas and would like to create layouts from these polylines and use them for the boundaries. Im wondering if there is also a possiblity that if i create a block or something, it could use the block name to create a tab also.

    Thank you in advance.

  2. #2
    Senior Member zaphod's Avatar
    Using
    AutoCAD 2017
    Join Date
    Sep 2013
    Location
    Houston, TX
    Posts
    174

    Default

    There is a lsp called vp-outline which does just the opposite, I got if off of www.jtbworld.com. it might be of some help.

  3. #3
    Junior Member
    Using
    AutoCAD 2012
    Join Date
    May 2012
    Posts
    16

    Default

    Yeah that is similar to the Change Space express tool. im hoping for something thats the reverse with tab creation from the polyline/block. some other quite good lisps on that site though thank you

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

    Default

    Maybe something like use chspace and bring to paperspace create bounding box and rescale object to fit your titleblock, mview ob pick (entlast) mspace zoom xp so as to set scale. I would probably get centre point in model space as first step so can centre the mview at a scale.

    There is a few un answered questions such as does the shape have a scale for plotting.

    Post a dwg with object in mspace a layout with object in pspace at desired scale
    A man who never made mistakes never made anything

  5. #5
    Junior Member
    Using
    AutoCAD 2012
    Join Date
    May 2012
    Posts
    16

    Default

    There will be no scale for the boundary in model space, and the scaling in the layout will not be important either.

    I imagine the tool would find a specific block in model space (for arguements sake called - Arch) and create a viewport on a tab that has the same name, using that block as the boundary of the viewport. IE the reverse of Change Space, going from model to layout with reference of block name and layout name so it knows where it will be sent to. A block in the border could be the reference for it to copy to the center point and scale inside so the viewport does not exceed the blocks boundaries.

    Does that make sense?

  6. #6
    Junior Member
    Using
    AutoCAD 2012
    Join Date
    May 2012
    Posts
    16

    Default

    or....

    With all the layouts set up, a lisp could open the tab, and have the viewport do a zoom/window around a block that has a specific name attached to that layout? Is that something thats possible? That would most likely be easier to achieve i imagine?

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

    Default

    Reading another post today you can zoom Object so create a mview go to mspace Z O, you could probably join all the steps into a lisp create layout make a mview mspace pick obj1 repeat.

    Using measure Block you could create a simple rectang block on one layer you can then get all these blocks and they will be in correct order of creation, you can then Zoom O obj1 Zoom O obj2 etc.

    It needs 2 or 3 bits of code to be joined together You need to post a dwg

    Code:
    ;simple example draw a rectang in "Model" go to a layout Mview then Mspace
    (setq obj (entsel "\npick rectang"))
    (command "Zoom" "O" obj "")
    A man who never made mistakes never made anything

  8. #8
    Junior Member
    Using
    AutoCAD 2012
    Join Date
    May 2012
    Posts
    16

    Default

    Registered forum members do not see this ad.

    Sorry ive not been able to send a drawing as of yet.
    The code you sent helps me lots as im almost there now. Is there a way of selecting a block name for the "obj" line instead of having to select it manually? im trying to set this up automated as i have 500+ drawings i would like to test this out on with various layouts being created. so far i have set it up like below, but as mentioned i would like it to zoom to the block called Arch instead of the manual process of selecting it.


    Code:
    (defun c:CVP ()
    (setq obj (entsel "\npick rectang"))
    (setvar 'CTAB "Arch")
    (command "._MSPACE")
    (command "Zoom" "O" obj "")
    (command "._PSPACE")
    (command "._ZOOM" "E")
      (princ)
    )

Similar Threads

  1. Automitic swap from model to paper space when working in model thru viewport
    By Abbyjay in forum AutoCAD Drawing Management & Output
    Replies: 3
    Last Post: 21st Nov 2012, 04:42 am
  2. Bring Paper Space object through Viewport into Model Space
    By karenreeves in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 8
    Last Post: 24th Nov 2011, 08:58 pm
  3. Replies: 6
    Last Post: 22nd Feb 2011, 07:34 pm
  4. model space within a viewport not functional
    By td88 in forum AutoCAD Beginners' Area
    Replies: 2
    Last Post: 2nd May 2010, 11:23 pm
  5. Viewport and Model Space
    By john551 in forum AutoCAD Beginners' Area
    Replies: 5
    Last Post: 18th Aug 2009, 07:59 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