CadAddVport
Vecad CadAddVport(hDwg, X, Y, W, H) — add a paper-space viewport that shows this drawing's OWN model space (unlike CadAddViewport, which shows the host's engineering data).
std::int32_t CadAddVport (
YuHandle hDwg,
double X,
double Y,
double W,
double H
);
Parameters
- hDwg (YuHandle)
- Handle to the drawing, as returned by
CadCreate. - X (double)
- Left edge of the viewport on the paper sheet.
- Y (double)
- Bottom edge of the viewport on the paper sheet.
- W (double)
- Width in world units.
- H (double)
- Height in world units.
Return Value
The handle of the newly created viewport, or 0 on failure.
Remarks
X,Y is the viewport's left-bottom corner and W,H its size on the sheet (convention taken from the LiteCAD successor SDK's lcBlockAddViewport, same author). The view defaults to the model extents (LiteCAD: DrwScale 0 => whole model), so the viewport is populated on export. Returns the viewport handle (0 on failure). Serialised as an AcDbViewport by the DXF writer so the result opens in AutoCAD paper space.