BimRv SDK: Work with the FamilyGeomCombination Interface

Artur Vakhramov

May 07, 2021

This article describes how to add and remove elements from a geometric combination.

A FamilyGeomCombination element implements geometric combinations and contains a set of GenSweep-derivative elements (e.g., extrusion, sweep, blend).

Add Elements to a Combination

To add a solid form to a combination, use the appropriate addSolidGeomToCombination() method:

OdResult addSolidGeomToCombination(const OdBmObjectId& id);

Here, id is an identifier of a solid GenSweep element.

To add a void form to a combination, use the addVoidGeomToCombination() method:

OdResult addVoidGeomToCombination(const OdBmObjectId& id, const OdBmObjectId& solidId);

Here, id is an identifier of a void GenSweep element, and solidId is an identifier of an existing solid GenSweep element in a combination.

Remove Elements from a Combination

To remove a solid form from a combination, use the appropriate removeSolidGeomFromCombination() method:

OdResult removeSolidGeomFromCombination(const OdBmObjectId& id);

Here, id is an identifier of a solid GenSweep element.

To remove a void form from a combination, use the removeVoidGeomFromCombination() method:

OdResult removeVoidGeomFromCombination(const OdBmObjectId& id, const OdBmObjectId& solidId);

Here, id is an identifier of a void GenSweep element, and solidId is an identifier of an existing solid GenSweep element in a combination.

Example

The following example can be found in the _BmFormsJoin_func() function, located in the Examples/TB_Commands/BmFamilyBooleanCmd.cpp file.

OdBmFamilyGeomCombinationPtr pFamilyGeomCombination = OdBmFamilyGeomCombination::createObject();
ODBM_TRANSACTION_BEGIN(t, pDb)
t.start();
OdBmObjectId idFGC = pDb->addElement(pFamilyGeomCombination);
pFamilyGeomCombination->addSolidGeomToCombination(genSweep1);
pFamilyGeomCombination->addSolidGeomToCombination(genSweep2);
t.commit();
ODBM_TRANSACTION_END()