Method ClipTo
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
ClipTo(DxfEntity)
Clips the viewport to a closed entity of its layout, as the VPCLIP command does with an object: the viewport shows
model space only inside the boundary, and its frame becomes the box of the boundary, its view kept in place. A
viewport 100 by 80 about (100, 100) at 1:2 clipped to a circle of radius 30 about (110, 105) is 60 by 60 about
(110, 105), the model point at its centre now the one that lay 10 right and 5 above, 20 and 10 in model units. The
boundary stays the entity it is, with the viewport among its reactors (102 {ACAD_REACTORS), as AutoCAD writes
it; the boundary the viewport had before stays an entity of the layout, let go. A region is a boundary as it is: one
of a ring (a circle of radius 40 less one of 15) makes the frame 80 by 80, the box of its outer loop, and shows nothing
in the hole, and one of two squares apart has a frame round both.
public void ClipTo(DxfEntity boundary)
Parameters
boundaryDxfEntityA circle, a whole ellipse, a closed polyline (LWPOLYLINE or 2D POLYLINE), a closed spline or a REGION whose shape is read (GetRegionShape()) of the viewport's block, which is not the viewport.
Exceptions
- ArgumentNullException
Thrown when the boundary is null.
- ArgumentException
Thrown when the boundary is not an entity of the viewport's block, is erased, has no area, or is not a closed circle, ellipse, polyline or spline, as AutoCAD says "Clip object must be closed."
- InvalidOperationException
Thrown when the viewport is erased or in no file, or the file is older than R2000, which has no such link.