APIDb_​DoClipID

Clips the elements created during a clipping session.

    GSErrCode ACAPI_Database (
        APIDb_DoClipID,
        API_Region*       clipRegion,
        API_ClipTran*     clipTran
    );

 

Parameters

clipRegion
the region to clip elements to
clipTran
clipping transformation

 

Return Values

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

For other common API errors see the API Errors document.

 

Remarks

You can create elements to be clipped into the current database with a clipping region and transformation. Use the APIDb_StartClippingSessionID database function to open a temporary database, create the elements with ACAPI_Element_Create into it, then call APIDb_DoClipID to merge them into the actual database applying the given clipping parameters. Don’t forget to 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_StartClippingSessionID
APIDb_StopClippingSessionID
ACAPI_Element_Create
ACAPI_Database
API Functions