AutoCAD – Drawings

Clip a viewport in AutoCAD: VPCLIP, polygonal viewports, and two traps when removing the clip

Clip a viewport in AutoCAD with VPCLIP, build polygonal or object viewports with MVIEW, and use MSPACE and PSPACE. Erase the boundary and the viewport goes too.

  • TS. Đỗ Quốc Hoàng
  • 8 min read
Four cases of creating and clipping layout viewports: rectangular, polygonal, clipped then unclipped with VPCLIP, and erasing the clip boundary Photo: Diagram by the Institute of Information Technology in Civil Engineering

On a drawing sheet, a viewport need not be a rectangle. A connection detail wants a round viewport; an L-shaped plan wants an L-shaped one that stays clear of the title block. To clip a viewport in AutoCAD you use VPCLIP, which reshapes an existing viewport to any closed boundary.

This article covers creating rectangular, polygonal and object viewports, clipping and unclipping them, and moving between model space and paper space. Every size is read from the objects themselves in AutoCAD 2027, using the acadiso.dwt template in millimetres. Setting and locking viewport scale is covered in layouts in AutoCAD, and rotating viewports in rotating a drawing in a layout. For sheet layout taught properly, the Institute runs an AutoCAD course for construction.

What viewports in AutoCAD are

Viewports in AutoCAD are windows placed on a layout, looking through to the drawing on the Model tab. Each is a real object named Viewport in paper space. Open Layout1 of a new drawing from acadiso.dwt and there is already one, 206 × 156 mm.

The commands that work with viewports, from the 2027 acad.cuix file:

CommandAliasWhat it does
MVIEWMVCreates viewports: rectangular, polygonal, from an object, 2/3/4 at once
VPCLIPReshapes an existing viewport; menu Modify → Clip → Viewport
MSPACEMSSteps inside a viewport to work on the model
PSPACEPSSteps back out to paper space

On the ribbon, the Layout Viewports panel has Rectangular, Polygonal, Object, Clip and Lock buttons. Its create buttons run -VPORTS; its Clip button runs VPCLIP.

Create a viewport in AutoCAD with MVIEW

Type MV on a layout and the 2027 release asks:

Specify corner of viewport or [ON/OFF/Fit/Shadeplot/Lock/NEw/NAmed/Object/Polygonal/Restore/LAyeroverride/laYer/2/3/4] <Fit>:
MethodWhat you doResult
RectanglePick two corners, e.g. 10,10 then 130,100One 120 × 90 mm viewport
P (Polygonal)Pick vertices as for a polyline, then COne polygonal viewport
O (Object)Select a closed shape already drawn on the layoutA viewport in that exact shape
4Pick two corners of the whole areaFour equal viewports

Option 4 over a 130 × 80 mm area gives four viewports of 65 × 40 mm each. Option 2 creates exactly two and 3 exactly three over the area you pick.

Option Object turns a circle of radius 40 into a round viewport 80 across. The circle stays, and from then on it is that viewport's clip boundary.

A polygonal viewport is two objects

Build a five-vertex viewport with MV → P, then count the objects on the layout. There are two new ones, not one: a Viewport and a Polyline acting as its clip boundary. A rectangular viewport from two corners is a single Viewport with no boundary.

A polygonal viewport still has its own rectangular size: the five-vertex one spanning 150,10 to 260,100 reports 110 wide by 90 high, the rectangle around the polygon. Only the part inside the boundary is displayed.

The VPCLIP command: clipping an existing viewport

When a viewport is already scaled and positioned and only its shape must change, use the VPCLIP command rather than drawing a new one. The 2027 prompts:

StepThe promptWhat you do
1Select viewport to clip:Select the viewport
2Select clipping object or [Polygonal] <Polygonal>:Select an existing closed shape, or Enter to draw a polygon
3Specify start point: then Specify next point or [Arc/Close/Length/Undo]:Pick the vertices, C to close

A 120 × 90 rectangle clipped to a triangle becomes a triangular viewport. According to the Autodesk documentation, valid boundaries are closed polylines, circles, ellipses, closed splines and regions.

The viewport keeps its scale and view centre; only the visible part changes:

Frame (mm)View centre in the modelView height / frame height
Before clipping120 × 902000,15003 091.84 / 90 = 34.35
After clipping116 × 862000,15002 954.42 / 86 = 34.35

The last ratio is model units per millimetre of paper, identical before and after, so the scale has not changed. That is why clipping beats deleting and redrawing, which means setting the scale again.

Removing the clip: the frame does not go back

To remove a clip, run VPCLIP, select the viewport and type D (Delete) at the second prompt. The boundary is deleted and the viewport is rectangular again, but not the original rectangle:

StateFrame size
Original120 × 90 mm
Clipped to a triangle116 × 86 mm (around the triangle)
After VPCLIP → D116 × 86 mm, not back to 120 × 90

The frame keeps the size of the box around the last clip. To get the old frame back, type U straight after the clip: it returns to exactly 120 × 90 with the same centre and scale. After several other steps, you must drag the corners back by hand.

Erasing the boundary erases the viewport

The second trap is worse. A polygonal viewport is a Viewport plus a Polyline. Select just the polyline and erase it, expecting to lose only the border. Result: the viewport vanishes too, both objects erased together.

To hide viewport borders when plotting, do not erase them. Put the viewport and its boundary on their own layer and set that layer not to plot, as described in rotating a drawing in a layout.

One more clipping error: the boundary must lie within the part of the layout currently on screen. Type vertices outside the visible area and the 2027 release refuses:

Invalid: Clip entity not currently regen'ed.

No viewport is created. Zoom so the whole area is visible, repeat, and the command runs normally.

MSPACE and PSPACE: in and out of a viewport

A layout has two working states, read from the CVPORT variable:

CommandStateCVPORT
PS (PSPACE)Working on the sheet: title block, notes, viewports1
MS (MSPACE)Working inside a viewport, on the model itself2 or more

Knowing mspace and pspace avoids a very common mistake: drawing the title block while inside a viewport, or trying to edit the model from outside. Two 2027 messages tell you where you are:

TypedWhenAutoCAD says
PSAlready outside viewportsAlready in paper space.
MSThe layout has no viewports leftThere are no active Model space viewports.

The second happens after deleting every viewport on a layout: MS has nowhere to go and CVPORT stays 1. Create a viewport with MV first.

A worked order for clipping a viewport in AutoCAD

Putting the measurements together gives a safe order of work for an L-shaped plan on an A3 sheet:

  1. Create an ordinary rectangular viewport with MV and two corners, large enough for the whole plan.
  2. Type MS, set the scale and centre the plan, then lock the viewport as shown in layouts in AutoCAD.
  3. Type PS to return to the sheet. Zoom so that the whole viewport is visible, which avoids the regen error.
  4. Run VPCLIP, select the viewport, press Enter and pick the six corners of the L, then C.
  5. Check the result. If the shape is wrong, type U at once rather than VPCLIP → D, so the frame returns to its original size.
  6. Move the viewport and its new boundary to a no-plot layer, instead of erasing the border.

Following this order, you clip a viewport in AutoCAD once, keep the scale set in step 2, and never lose the viewport by accident. The same order works for a round detail viewport: draw the circle in step 4 first and select it instead of pressing Enter.

Three things often repeated that are not true

Often repeatedWhat holds on the 2027 release
VPCLIP → Delete restores the original frameThe frame keeps the clip's bounding size, 116 × 86 instead of 120 × 90
Erasing a polygonal viewport's border removes only the borderErasing the boundary erases the viewport
A polygonal viewport is one objectIt is two: a Viewport and a Polyline

Frequently asked questions

Which command clips a viewport in AutoCAD?

VPCLIP. Select the viewport, then an existing closed shape, or press Enter to draw a clipping polygon.

How do I make a round viewport?

Draw a circle on the layout, type MV, choose O, and select the circle.

How do I remove a clip?

Run VPCLIP, select the viewport, type D. It becomes the rectangle around the old clip, not the original size.

Why did the viewport disappear when I erased its border?

For polygonal and object viewports, the border is the clip boundary; erasing it erases the viewport. Put it on a no-plot layer instead.

Why does MS not take me into a viewport?

The layout has no viewports; AutoCAD says There are no active Model space viewports. Create one with MV.

Why does clipping say "Clip entity not currently regen'ed"?

The boundary lies outside the visible area. Zoom to show the whole clip area and try again.

About the author

TS. Đỗ Quốc Hoàng — Vice Director of the Institute of Information Technology in Civil Engineering, Hanoi University of Civil Engineering, and a specialist in software development for construction