Viewport Outline

Function Syntax VPO / VPOL / VPOA
Current Version 1.3
Download VPOutlineV1-3.lsp
View HTML Version VPOutlineV1-3.html
Donate

Program Description

This program allows the user to automatically generate polylines in modelspace representing the outline of a selected paperspace viewport, all viewports in the active paperspace layout, or all viewports found in all paperspace layouts.

The program offers three custom commands:

Outline Selected Viewport (VPO)

This command is only available in paperspace (that is, when a layout tab other than the Model tab is the current layout, and no viewports are active). Upon issuing the command syntax VPO at the AutoCAD command-line, the user is prompted to select a viewport for which to construct the viewport outline in modelspace.

Following a valid selection, the boundary of the selected viewport is transformed appropriately to account for the position, scale, rotation, & orientation of the modelspace view displayed through the selected viewport, and a 2D polyline (LWPolyline) representing this transformed boundary is constructed in modelspace.

Outline All Viewports in the Active Layout (VPOL)

This command is also only available in paperspace and, upon issuing the command syntax VPOL at the AutoCAD command-line, the program will automatically acquire & generate an outline for all viewports found in the active paperspace layout.

The user is notified at the command-line if no viewports are found in the active paperspace layout.

Outline All Viewports all Layouts (VPOA)

Upon issuing the command syntax VPOA at the AutoCAD command-line, the program will automatically acquire & generate an outline for all viewports found in all paperspace layouts of the active drawing.

The user is notified at the command-line if no viewports are found in any paperspace layout.


The program is compatible for use with all Rectangular, Polygonal & Clipped Viewports (including those with Arc segments), and with all views & construction planes.

The program also offers the ability to optionally offset the polyline outline to the interior of the viewport boundary by a predetermined number of paperspace units specified in the 'Program Parameters' section of the program source code.

The program may also be configured to automatically apply a predefined set of properties (e.g. layer, colour, linetype, etc.) to the resulting polyline outline - these properties are also listed within the 'Program Parameters' section of the source code.

Demonstration

In the following demonstration, the program has been configured to offset the outline by 2 units, and place the result on a separate layer.

Viewport Outline Demo

Instructions for Running

Please refer to How to Run an AutoLISP Program.

textsize

increase · reset · decrease

Designed & Created by Lee Mac © 2010