APIDb_​StartClippingSessionID

Sets up clipping session for newly created elements to be clipped.

    GSErrCode ACAPI_Database (
        APIDb_StartClippingSessionID
    );

 

Return Values

NoError
The function has completed with success.
APIERR_NESTING
the clip session is opened for the database

For other common API errors see the API Errors document.

 

Remarks

This function creates a temporary database and redirects the subsequent ACAPI_Element_Create calls into it. The elements created during this session then can be copied into the actual element database with the APIDb_DoClipID command applying the given clipping region and transformation. You must close the clipping session with the APIDb_StopClippingSessionID database function to restore the target database.

Note that only the 2D drawing elements will be clipped. Construction elements, like walls, columns will NOT take part in the clipping algorithm.

 

Example


API_Region          clipRegion;
API_Element         element;
GSErrCode           err;

BNZeroMemory (&clipRegion, sizeof (API_Region));
clipRegion.box.xMin = 0.0;
clipRegion.box.xMax = 2.0;
clipRegion.box.yMin = 1.54;
clipRegion.box.yMax = 2.54;

err = ACAPI_Database (APIDb_StartClippingSessionID, nullptr, nullptr);
if (err == NoError) {
    /* ... */
    err = ACAPI_Element_Create (&element, nullptr);
    /* ... */
    err = ACAPI_Database (APIDb_DoClipID, &clipRegion, nullptr);
}
err = ACAPI_Database (APIDb_StopClippingSessionID, nullptr, nullptr);

Requirements

Version: API 4.1 or later
Header: APIdefs_Database.h

 

See Also

API_Region
APIDb_DoClipID
APIDb_StopClippingSessionID
ACAPI_Element_Create
ACAPI_Database
API Functions