vports

(vports)

The vports function retrieves a description of all viewports within the graphics area of the current drawing.

Return Value

The function returns a list that includes the viewport descriptions in form of an identification number, followed by viewport bounding box coordinates (lower-left and upper-right corner). Each viewport description is returned in a sublist.

The function returns nil, if no drawing is open.

Note: The coordinates returned in the description list vary, depending on the setting of TILEMODE system variable. Depending on the status whether the current drawing is displayed in model mode or in layout mode (Sheet tabs), the information retrieved by the function differs in its meaning, as follows.

Model ViewTiles List

When the model tab is active, the list describes the ViewTiles. The coordinates indicate the viewport's lower left and upper right corners of the drawing area of the program's desktop.

ViewTiles in model space are managed by the ViewTiles and Windows commands. The current viewport identifier, that is a viewport number, can be retrieved by applying the Lisp expression (getvar "CVPORT").

Sheet Viewports List

When the TILEMODE variable is currently set to 0 (off), the list consists of the viewports created on the current Sheet (in paper space). The corners are described by Sheet coordinates.

Viewport entities are created with the Viewport or -Viewport commands. On a Sheet, viewport number 1 is always the visible part of the drawing on the Sheet.

Examples

: (vports)

((0 (0.003233 0.005155) (0.996767 0.994845)))

: (vports)

((0 (0.003233 0.005155) (0.500000 0.994845)) (1 (0.500000 0.005155) (0.996767 0.994845)))

: (vports)

((1 (-0.000000 0.000000) (14.162791 9.000000)))

: _Viewport

Specify start corner» p1

Specify second corner» p2

: _Viewport

Specify start corner» p3

Specify second corner» p4

: (vports)

((1 (-0.000000 0.000000) (14.162791 9.000000)) (2 (1.978552 3.860590) (5.815013 6.924933)) (3 (8.541554 2.509383) (12.908847 5.839142)))

Related Functions

tblnext, tblsearch