APIDb_​RoomReductionsID

Returns reduction data assigned to a room of the current database.

    GSErrCode ACAPI_Database (
        APIDb_RoomReductionsID,
        const API_Guid*            guid,
        RoomReductionPolyProc*     roomReductionPolyProc
    );

 

Parameters

guid 18
The referenced zone GUID identifier
roomReductionPolyProc
Callback function to export reduction information

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
Any of the parameters are nullptr.
APIERR_NESTING
The function is called from the body of a RoomReductionPolyProc.
APIERR_BADID
The zone reference is invalid.
APIERR_DELETED
The zone is deleted.

For other common API errors see the API Errors document.

 

Remarks

Zones have very complex relationships to other elements. This function is used to make easy to find what elements may reduce the zone area and how. These elements may be walls, colums, hatches, gables and rest. The overlapping places return only by either of them (see image below). The reduction polygons obtain by RoomReductionPolyProc callback function.

 

 Room reduction poly

 

Example


static void  __ACENV_CALL  RoomRedCallBack (const API_RoomReductionPolyType *roomRed)

{
    char          s[32];
    GSErrCode     err;

    switch (roomRed->type) {
        case APIRoomReduction_Rest:    sprintf (s, "Rest");   break;
        case APIRoomReduction_Wall:    sprintf (s, "Wall");   break;
        case APIRoomReduction_Column:  sprintf (s, "Column"); break;
        case APIRoomReduction_Hatch:   sprintf (s, "Hatch");  break;
        case APIRoomReduction_Gable:   sprintf (s, "Gable");  break;
    }

    ACAPI_WriteReport (s, false);
    /* draw polygon by roomRed->nCoords, roomRed->coords, ... */

    BMKillHandle ((GSHandle*) &roomRed->coords);
    BMKillHandle ((GSHandle*) &roomRed->subPolys);
    BMKillHandle ((GSHandle*) &roomRed->arcs);
    return;
}

...

GSErrCode   err = ACAPI_Database (APIDb_RoomReductionsID, &element.header.guid, (void *) RoomRedCallBack);

 

Requirements

Version: API 4.1 or later
Header: APIdefs_Database.h

 

See Also

RoomReductionPolyProc
ACAPI_Database
API Functions