Machine Controller

interface ICwAPI3DMachineController

Public Functions

virtual ICwAPI3DString *getLastError(int32_t *aErrorCode) = 0

Gets the last error.

Parameters:

aErrorCode[out] [int32_t*] The error code.

Returns:

[ICwAPI3DString*] The error string.

virtual void exportBTL(uint32_t aBTLVersion, const character *aExportFilePath) = 0

Exports a BTL file.

Example:
btlVersion btlVersion = btlVersion::btlx_2_1;
const character* outputPath = L"C:/exports/timber_project.btlx";

aFactory.getMachineController()->exportBTL(static_cast<uint32_t>(btlVersion), outputPath);

Parameters:
  • aBTLVersion[in] [btlVersion] The BTL version.

  • aExportFilePath[in] [const character*] The export file path.

virtual void exportWeinmannMFB(uint32_t aMFBVersion) = 0

Exports a Weinmann MFB file.

Example:
weinmannMfbVersion mfbVersion = weinmannMfbVersion::wup_3_4;

aFactory.getMachineController()->exportWeinmannMfb(static_cast<uint32_t>(mfbVersion));

Parameters:

aMFBVersion[in] [weinmannMfbVersion] The Weinmann MFB version.

virtual void exportHundegger(uint32_t aHundeggertype) = 0

Exports a Hundegger file.

Example:
hundeggerMachineType hundeggerType = hundeggerMachineType::k2;

aFactory.getMachineController()->exportHundegger(static_cast<uint32_t>(hundeggerType));

Parameters:

aHundeggertype[in] [hundeggerMachineType] The Hundegger machine type.

virtual void clearErrors() = 0

Clears all errors.

virtual void exportHundeggerWithFilePath(uint32_t aHundeggertype, const character *aExportFilePath) = 0

Exports a Hundegger file.

Example:
hundeggerMachineType hundeggerType = hundeggerMachineType::k2;
const character* outputPath = L"C:/exports/hundegger_project.k2";

aFactory.getMachineController()->exportHundeggerWithFilePath(static_cast<uint32_t>(hundeggerType), outputPath);

Parameters:
virtual void exportHundeggerWithFilePathAndPresetting(uint32_t aHundeggertype, const character *aExportFilePath, const character *aPresetting) = 0

Exports a Hundegger file.

Example:
hundeggerMachineType hundeggerType = hundeggerMachineType::k2;
const character* outputPath = L"C:/exports/hundegger_project.k2";
const character* presettingFile = L"...3d/Machine/Hundegger/K2/hundegger_settings.xml";

aFactory.getMachineController()->exportHundeggerWithFilePathAndPresetting(static_cast<uint32_t>(hundeggerType), outputPath, presettingFile);

Parameters:
  • aHundeggertype[in] [hundeggerMachineType] The Hundegger machine type.

  • aExportFilePath[in] [const character*] The export file path.

  • aPresetting[in] [const character*] The presetting file path (.xml).

virtual void exportBTLWithPresetting(uint32_t aBTLVersion, const character *aExportFilePath, const character *aPresetting) = 0

Exports a BTL file with a presetting file.

Example:
btlVersion btlVersion = btlVersion::btlx_2_1;
const character* outputPath = L"C:/exports/timber_project.btlx";
const character* presettingFile = L"...3d/Machine/BTL/btl_settings.xml";

aFactory.getMachineController()->exportBTLWithPresetting(static_cast<uint32_t>(btlVersion), outputPath, presettingFile);

Parameters:
  • aBTLVersion[in] [btlVersion] The BTL version.

  • aExportFilePath[in] [const character*] The export file path.

  • aPresetting[in] [const character*] The presetting file path (.xml).

virtual void calculateBTLMachineData(ICwAPI3DElementIDList *aElementIdList, uint32_t aBTLVersion) = 0

Calculates the Machine Data for BTL.

Example:
ICwAPI3DElementIDList* beamElements = aFactory.getElementController()->getAllIdentifiableElementIDs();
btlVersion btlVersion = btlVersion::btlx_2_1;

aFactory.getMachineController()->calculateBTLMachineData(beamElements, static_cast<uint32_t>(btlVersion));

Parameters:
virtual void calculateHundeggerMachineData(ICwAPI3DElementIDList *aElementIdList, uint32_t aHunderggertype) = 0

Calculates the Machine Data for Hundegger.

Example:
ICwAPI3DElementIDList* beamElements = aFactory.getElementController()->getAllIdentifiableElementIDs();
hundeggerMachineType hundeggerType = hundeggerMachineType::k2;

aFactory.getMachineController()->calculateHundeggerMachineData(beamElements, static_cast<uint32_t>(hundeggerType));

Parameters:
virtual void loadHundeggerCalculationSet(uint32_t aHundeggertype, const character *aFilePath) = 0

Loads the Hundegger calculation set.

Parameters:
  • aHundeggertype[in] [hundeggerMachineType] The Hundegger machine type.

  • aFilePath[in] [const character*] The file path of the calculation set.

virtual ICwAPI3DElementIDList *getElementHundeggerProcessings(elementID aElementId, uint32_t aHundeggertype) = 0

Gets the list of Hundegger processings for a specific element.

Example:
elementID element = 123456789;
hundeggerMachineType hundeggerMachineType = hundeggerMachineType::k2;
ICwAPI3DProcessingList* processings = aFactory.getMachineController()->getElementHundeggerProcessings(element, static_cast<uint32_t>(hundeggerMachineType));
printf("Found %d Hundegger processings\n", processings->count());

Parameters:
Returns:

[ICwAPI3DElementIDList*] A list of element IDs representing the processings.

virtual ICwAPI3DElementIDList *getElementBTLProcessings(elementID aElementId, uint32_t aBTLVersion) = 0

Gets the list of BTL processings for a specific element.

Example:
elementID element = 123456789;
btlVersion btlVersion = btlVersion::btlx_2_1;
ICwAPI3DBtlProcessingList* processings = aFactory.getMachineController()->getElementBtlProcessings(element, static_cast<uint32_t>(btlVersion));
printf("Found %d BTL processings\n", processings->count());

Parameters:
  • aElementId[in] [elementID] The element id.

  • aBTLVersion[in] [btlVersion] The BTL version.

Returns:

[ICwAPI3DElementIDList*] A list of element IDs representing the processings.

virtual ICwAPI3DString *getProcessingName(elementID aReferenceElementId, elementID aProcessingId) = 0

Gets the name of a specific processing.

Example:
elementID element = 123456789;
btlVersion btlVersion = btlVersion::btlx_2_1;
ICwAPI3DElementIDList* processings = aFactory.getMachineController()->getElementBTLProcessings(element, static_cast<uint32_t>(btlVersion));
for (uint32_t i = 0; i < processings->count(); ++i)
{
    elementID processing = processings->get(i);
    ICwAPI3DString* name = aFactory.getMachineController()->getProcessingName(element, processing);
}

Parameters:
  • aReferenceElementId[in] [elementID] The reference element id.

  • aProcessingId[in] [elementID] The processing id.

Returns:

[ICwAPI3DString*] The name of the processing.

virtual ICwAPI3DString *getProcessingCode(elementID aReferenceElementId, elementID aProcessingId) = 0

Gets the code of a specific processing.

Example:
elementID element = 123456789;
btlVersion btlVersion = btlVersion::btlx_2_1;
ICwAPI3DElementIDList* processings = aFactory.getMachineController()->getElementBTLProcessings(element, static_cast<uint32_t>(btlVersion));

for (uint32_t i = 0; i < processings->count(); ++i)
{
    elementID processing = processings->get(i);
    ICwAPI3DString* code = aFactory.getMachineController()->getProcessingCode(element, processing);
}

Parameters:
  • aReferenceElementId[in] [elementID] The reference element id.

  • aProcessingId[in] [elementID] The processing id.

Returns:

[ICwAPI3DString*] The code of the processing.

virtual ICwAPI3DVertexList *getProcessingPoints(elementID aReferenceElementId, elementID aProcessingId) = 0

Gets the points of a specific processing.

Example:
elementID element = 123456789;
btlVersion btlVersion = btlVersion::btlx_2_1;
ICwAPI3DElementIDList* processings = aFactory.getMachineController()->getElementBTLProcessings(element, static_cast<uint32_t>(btlVersion));

for (uint32_t i = 0; i < processings->count(); ++i)
{
    elementID processing = processings->get(i);
    ICwAPI3DVertexList* points = aFactory.getMachineController()->getProcessingPoints(element, processing);
}

Note

This method only works for drillings processings. For other processings, it will return an empty list.

Parameters:
  • aReferenceElementId[in] [elementID] The reference element id.

  • aProcessingId[in] [elementID] The processing id.

Returns:

[ICwAPI3DVertexList*] A list of vertices representing the points of the processing.

virtual ICwAPI3DStringList *getProcessingBTLParameterset(elementID aReferenceElementId, elementID aProcessingId) = 0

Gets the BTL parameter set of a specific processing.

Example:
elementID element = 123456789;
btlVersion btlVersion = btlVersion::btlx_2_1;
ICwAPI3DElementIDList* processings = aFactory.getMachineController()->getElementBTLProcessings(element, static_cast<uint32_t>(btlVersion));

for (uint32_t i = 0; i < processings->count(); ++i)
{
    elementID processing = processings->get(i);
    ICwAPI3DStringList* parameters = aFactory.getMachineController()->getProcessingBTLParameterset(element, processing);
}

Parameters:
  • aReferenceElementId[in] [elementID] The reference element id.

  • aProcessingId[in] [elementID] The processing id.

Returns:

[ICwAPI3DStringList*] A list of strings representing the BTL parameter set of the processing.

virtual void exportHundeggerWithFilePathSilent(uint32_t aHundeggertype, const character *aExportFilePath) = 0

Exports a Hundegger file silently.

Example:
hundeggerMachineType hundeggerType = hundeggerMachineType::k2;
const character* outputPath = L"C:/exports/hundegger_project.k2";

aFactory.getMachineController()->exportHundeggerWithFilePathSilent(static_cast<uint32_t>(hundeggerType), outputPath);

Parameters:
virtual void exportHundeggerWithFilePathAndPresettingSilent(uint32_t aHundeggertype, const character *aExportFilePath, const character *aPresetting) = 0

Exports a Hundegger file silently.

Example:
hundeggerMachineType hundeggerType = hundeggerMachineType::k2;
const character* outputPath = L"C:/exports/hundegger_project.k2";
const character* presettingFile = L"...3d/Machine/Hundegger/K2/hundegger_settings.xml";

aFactory.getMachineController()->exportHundeggerWithFilePathAndPresettingSilent(static_cast<uint32_t>(hundeggerType), outputPath, presettingFile);

Parameters:
  • aHundeggertype[in] [hundeggerMachineType] The Hundegger machine type.

  • aExportFilePath[in] [const character*] The export file path.

  • aPresetting[in] [const character*] The presetting file path (.xml).