Bim Controller

interface ICwAPI3DBimController

Public Functions

virtual ICwAPI3DString *getLastError(int32_t *aErrorCode) = 0

Gets the last error message.

Parameters:

aErrorCode[out] [int32_t*] A pointer to an integer where the error code will be stored.

Returns:

[ICwAPI3DString*] A string containing the last error message.

virtual ICwAPI3DString *getIfcGuid(elementID aElementId) = 0

Gets the IFC GUID for a given element.

Example:
ICwAPI3DElementIDList* selectedElements = aFactory.getElementController()->getAllIdentifiableElementIDs();
elementID* element = selectedElements->front();
ICwAPI3DString* ifcGuid = aFactory.getBimController()->getIfcGuid(*element);
wprintf(L"IFC GUID: %s\n", ifcGuid->data());

Parameters:

aElementId[in] [elementID] The id of the element.

Returns:

[ICwAPI3DString*] A string containing the IFC GUID.

virtual void setBuildingAndStorey(ICwAPI3DElementIDList *aElementIdList, const character *aBuilding, const character *aStorey) = 0

Sets the building and storey for a list of elements.

Example:
ICwAPI3DElementIDList* selectedElements = aFactory.getElementController()->getAllIdentifiableElementIDs();
const character* buildingName = L"Building A";
const character* storeyName = L"Ground Floor";
aFactory.getBimController()->setBuildingAndStorey(selectedElements, buildingName, storeyName);

Parameters:
  • aElementIdList[in] [ICwAPI3DElementIDList*] A list of element ids.

  • aBuilding[in] [const character*] The name of the building.

  • aStorey[in] [const character*] The name of the storey.

virtual ICwAPI3DString *getBuilding(elementID aElementId) = 0

Gets the building name for a given element.

Parameters:

aElementId[in] [elementID] The id of the element.

Returns:

[ICwAPI3DString*] A string containing the name of the building.

virtual ICwAPI3DString *getStorey(elementID aElementId) = 0

Gets the storey name for a given element.

Parameters:

aElementId[in] [elementID] The element id.

Returns:

[ICwAPI3DString*] A string containing the name of the storey.

virtual void clearErrors() = 0

Clears all errors.

virtual ICwAPI3DIfc2x3ElementType *getIfc2x3ElementType(elementID aElementId) = 0

Gets the IFC 2x3 element type for a given element.

Example:
ICwAPI3DElementIDList* selectedElements = aFactory.getElementController()->getAllIdentifiableElementIDs();
elementID* element = selectedElements.front();
ICwAPI3DIfc2x3ElementType* ifcType = aFactory.getBimController()->getIfc2x3ElementType(*element);

Parameters:

aElementId[in] [elementID] The id of the element.

Returns:

[ICwAPI3DIfc2x3ElementType*] The IFC 2x3 element type.

virtual void setIfc2x3ElementType(ICwAPI3DElementIDList *aElementIdList, ICwAPI3DIfc2x3ElementType *aElementType) = 0

Sets the IFC 2x3 element type for a list of elements.

Example:
ICwAPI3DElementIDList* selectedElements = aFactory.getElementController()->getAllIdentifiableElementIDs();
ICwAPI3DIfc2x3ElementType* ifcEntityType = aFactory.createEmptyIfc2x3ElementType();
ifcEntityType->setIfcMember();
aFactory.getBimController()->setIfc2x3ElementType(selectedElements, ifcEntityType);

Parameters:
virtual bool importIfcAsGraphicalObject(const character *aFilePath) = 0

Imports an IFC file as a graphical object.

Example:
const character ifcFilePath[] = L"C:/imports/building_model.ifc";
bool success = aFactory.getBimController()->importIfcAsGraphicalObject(ifcFilePath);
if (success)
{
    printf("IFC imported as graphical object successfully\n");
}

Parameters:

aFilePath[in] [const character*] The path to the IFC file.

Returns:

[bool] True if the import was successful, false otherwise.

virtual bool importBcf(const character *aFilePath) = 0

Imports a BCF file.

Example:
const character bcfFilePath[] = L"C:/imports/issues.bcf";
bool success = aFactory.getBimController()->importBcf(bcfFilePath);
if (success)
{
    printf("BCF file imported successfully\n");
}

Parameters:

aFilePath[in] [const character*] The path to the BCF file.

Returns:

[bool] True if the import was successful, false otherwise.

virtual bool exportBcf(const character *aFilePath) = 0

Exports a BCF file.

Example:
const character lBcfOutputPath[] = L"C:/exports/project_issues.bcf";
bool lSuccess = aFactory.getBimController()->exportBcf(lBcfOutputPath);
if(lSuccess)
{
  printf("BCF file exported successfully");
}

Parameters:

aFilePath[in] [const character*] The path to the BCF file to be exported.

Returns:

[bool] True if the export was successful, false otherwise.

virtual bool exportIfc(ICwAPI3DElementIDList *aElementIdList, const character *aFilePath) = 0

Exports an IFC file.

Example:
ICwAPI3DElementIDList* selectedElements = aFactory.getElementController()->getAllIdentifiableElementIDs();
const character ifcOutputPath[] = L"C:/exports/building_model.ifc";
bool success = aFactory.getBimController()->exportIfc(selectedElements, ifcOutputPath);
if (success)
{
    printf("IFC file exported successfully\n");
}

Parameters:
  • aElementIdList[in] [ICwAPI3DElementIDList*] A list of element ids to be included in the export.

  • aFilePath[in] [const character*] The path where the IFC file will be exported.

Returns:

[bool] True if the export was successful, false otherwise.

virtual ICwAPI3DElementIDList *importIfcReturnExchangeObjects(const character *aFilePath) = 0

imports an IFC File and returns the ids of the Exchange Objects.

Parameters:

aFilePath[in] [const character*] The path to the IFC file.

Returns:

[ICwAPI3DElementIDList*] The id of the exchange objects.

virtual ICwAPI3DElementIDList *convertExchangeObjects(ICwAPI3DElementIDList *aElementIdList) = 0

converts a list of Exchange Objects to Cadwork Elements.

Parameters:

aElementIdList[in] [ICwAPI3DElementIDList*] The exchange object id to convert.

Returns:

[ICwAPI3DElementIDList*] The list of cadwork element id.

virtual double getStoreyHeight(const character *aBuilding, const character *aStorey) = 0

Gets the height of a specific storey in a building.

Parameters:
  • aBuilding[in] [const character*] The name of the building.

  • aStorey[in] [const character*] The name of the storey.

Returns:

[double] The height of the storey.

virtual void setStoreyHeight(const character *aBuilding, const character *aStorey, double aHeight) = 0

Sets the height of a specific storey in a building.

Example:
const character* buildingName = L"Building A";
const character* storeyName = L"Ground Floor";
double heightMillimeters = 3500;
aFactory.getBimController()->setStoreyHeight(buildingName, storeyName, heightMillimeters);

Parameters:
  • aBuilding[in] [const character*] The name of the building.

  • aStorey[in] [const character*] The name of the storey.

  • aHeight[in] [double] The height to set for the storey.

virtual ICwAPI3DString *getIfc2x3ElementTypeString(ICwAPI3DIfc2x3ElementType *aElementType) = 0

Gets the string representation of an IFC 2x3 element type.

Parameters:

aElementType[in] [ICwAPI3DIfc2x3ElementType*] The IFC 2x3 element type.

Returns:

[ICwAPI3DString*] A string representation of the IFC 2x3 element type.

virtual ICwAPI3DString *getIfc2x3ElementTypeDisplayString(ICwAPI3DIfc2x3ElementType *aElementType) = 0

Gets the display string of an IFC 2x3 element type.

Parameters:

aElementType[in] [ICwAPI3DIfc2x3ElementType*] The IFC 2x3 element type.

Returns:

[ICwAPI3DString*] A display string of the IFC 2x3 element type.

virtual ICwAPI3DStringList *getAllBuildings() = 0

Gets a list of all buildings.

Returns:

[ICwAPI3DString*] A list of all buildings.

virtual ICwAPI3DStringList *getAllStoreys(const character *aBuilding) = 0

Gets a list of all storeys in a given building.

Parameters:

aBuilding[in] [const character*] The name of the building.

Returns:

[ICwAPI3DString*] A list of all storeys in the building.

virtual bool exportIfc2x3Silently(ICwAPI3DElementIDList *aElementIdList, const character *aFilePath) = 0

Exports an IFC 2x3 file silently.

Parameters:
  • aElementIdList[in] [ICwAPI3DElementIDList*] A list of element ids to be included in the export.

  • aFilePath[in] [const character*] The path where the IFC file will be exported.

Returns:

[bool] True if the export was successful, false otherwise.

virtual bool exportIfc4Silently(ICwAPI3DElementIDList *aElementIdList, const character *aFilePath) = 0

Exports an IFC 4 file silently.

Parameters:
  • aElementIdList[in] [ICwAPI3DElementIDList*] A list of element ids to be included in the export.

  • aFilePath[in] [const character*] The path where the IFC file will be exported.

Returns:

[bool] True if the export was successful, false otherwise.

virtual bool exportIfc4SilentlyWithOptions(ICwAPI3DElementIDList *aElementIdList, const character *aFilePath, ICwAPI3DIfcOptions *aOptions) = 0

Exports an IFC 4 file silently with options.

Parameters:
  • aElementIdList[in] [ICwAPI3DElementIDList*] A list of element ids to be included in the export.

  • aFilePath[in] [const character*] The path where the IFC file will be exported.

  • aOptions[in] [ICwAPI3DIfcOptions*] The options for the IFC export.

Returns:

[bool] True if the export was successful, false otherwise.

virtual bool exportIfc2x3SilentlyWithOptions(ICwAPI3DElementIDList *aElementIdList, const character *aFilePath, ICwAPI3DIfcOptions *aOptions) = 0

Exports an IFC 2x3 file silently with options.

Parameters:
  • aElementIdList[in] [ICwAPI3DElementIDList*] A list of element ids to be included in the export.

  • aFilePath[in] [const character*] The path where the IFC file will be exported.

  • aOptions[in] [ICwAPI3DIfcOptions*] The options for the IFC export.

Returns:

[bool] True if the export was successful, false otherwise.

virtual elementID getElementIdFromIfcBase64Guid(const character *aGuid) = 0

Get elementID from an IFC base64 Guid.

Parameters:

aGuid[in] [const character*] An IFC GUID in base64 string format (“28kif20KPEuBjk2m1N3ep$”).

Returns:

The element id.

virtual ICwAPI3DString *getIfcBase64Guid(const elementID aElementId) = 0

Get IFC base64 Guid from element id.

Parameters:

aElementId[in] [elementID] The element id.

Returns:

[ICwAPI3DString*] The IFC GUID in base64 string format (“28kif20KPEuBjk2m1N3ep$”).

virtual void updateBmtStructureCreatedElements(ICwAPI3DElementIDList *aElementIdList) = 0

This function takes the specified elements and inserts them into the BMT structure and adds them to the active building and storey.

Parameters:

aElementIdList[in] [ICwAPI3DElementIDList*] The list of element ids.

virtual void updateBmtStructureBuildingStorey(ICwAPI3DElementIDList *aElementIdList) = 0

This function takes the specified elements and inserts them into the BMT structure and adds them to the assigned Building and Storey.

Parameters:

aElementIdList[in] [ICwAPI3DElementIDList*] The list of element ids.

virtual ICwAPI3DIfcOptions *getIfcOptions() = 0

Get the IfcOptions with the settings used in the document.

Returns:

[ICwAPI3DIfcOptions*] The IfcOptions.

virtual ICwAPI3DIfcPredefinedType *getIfcPredefinedType(elementID aElementId) = 0

Get the IfcPredefinedType of an element.

Parameters:

aElementId[in] [elementID] The element id.

Returns:

[ICwAPI3DIfcPredefinedType*] The IfcPredefinedType Wrapper.

virtual void setIfcPredefinedType(ICwAPI3DElementIDList *aElementIdList, ICwAPI3DIfcPredefinedType *aPredefinedType) = 0

Set a predefined type to elements. Attention, if you change the PredefinedType of the elements, you are responsible for ensuring that valid types are set.

Example:
ICwAPI3DElementIDList* selectedElements = aFactory.getElementController()->getAllIdentifiableElementIDs();
ICwAPI3DIfcPredefinedType* predefinedType = aFactory.createEmptyIfcPredefinedType();
predefinedType->setMember();
aFactory.getBimController()->setIfcPredefinedType(selectedElements, predefinedType);

Parameters:
virtual bool exportIfc2x3(ICwAPI3DElementIDList *aElementIdList, const character *aFilePath) = 0

Exports an IFC 2x3.

Parameters:
  • aElementIdList[in] [ICwAPI3DElementIDList*] A list of element ids to be included in the export.

  • aFilePath[in] [const character*] The path where the IFC file will be exported.

Returns:

[bool] True if the export was successful, false otherwise.

virtual bool exportIfc4(ICwAPI3DElementIDList *aElementIdList, const character *aFilePath) = 0

Exports an IFC 4 file.

Parameters:
  • aElementIdList[in] [ICwAPI3DElementIDList*] A list of element ids to be included in the export.

  • aFilePath[in] [const character*] The path where the IFC file will be exported.

Returns:

[bool] True if the export was successful, false otherwise.