BOM (Bill Of Materials) Manager is a service class that works with BOM tables, part references and BOM rows. All data held by BOM tables is stored in data containers that call data entries. There are three data entry types: DataEntry, DataEntryPart, and DataEntryBlock. DataEntryPart is connected with part references, and DataEntryBlock is connected with components.
DataEntryPart stores data differently than DataEntryBlock. BOM Manager has a set of methods that provide access to BOM table data, for example:
- getItemData gets data for a BOM row;
- getPartData gets data for a part reference;
BOM Manager methods make it possible to get attributes attached to DataEntryPart as well as data attached to DataEntryBlock. DataEntryPart holds data in a plain data array, where DataEntryBlock has a different approach.
DataEntryBlock structure features
Let’s look at some BOM tables in OdaMfcApp (AcDbDictionary -> AcmBOM) and a BOM Row (AcmBom -> AcmBomRow).
List of BOM rows and selected row
Here we can see a piece of BomRow entry properties. On the left is a BOM Row that is attached to DataEntryBlock, and on the right is a BOM Row that is attached to DataEntryPart. Basically, the attributes (properties) for a component or part that are attached to DataEntryBlock (through BOM Row) are stored in special objects — AmdtSystemAttribute objects that are implicitly connected with a DataEntry object through component definition objects.
BOM Row properties
DataEntryPart stores data in a plain data sequence (arrays). DataEntryBlock data strongly depends on component definition (CompDef) objects. The following DataEntryBlock properties look like this:
DataEntryBlock property set
DataEntryBlock holds a SoftPointer to the AcAmCompDef (component definition) and component name. DataEntryBlock interacts with the component definition object to get its attributes.
AcAmCompDef is a component definition object that describes a component overall. It holds the component object, component name, and view definition object for a selected component. In the Teigha Mechanical structure, a component definition object is a binding element between AmdtSystemAttribute and DataEntryBlock objects. All AmdtSystemAttribute objects have one global holder: AcRfMCADAPIAttHolder.
AcRfMCADAPIAttHolder is just a holder with a set of HardPointers to AmdtSystemAttribute objects; AcRfMCADAPIAttHolder doesn’t bind anything. For binding, there are AcRfObjAttGroupMgr objects. AcRfObjAttGroupMgr binds together a set of AmdtSystemAttributes and a component definition object (AcAmCompDef object).
It is useful to know that AcRfObjAttGroupMgr objects are aggregated into a global AcRfAttGeneralMgr.
AmdtSystemAttribute is a final atomic data cell in all Teigha Mechanical structures that holds attribute data. An AmdtSystemAttribute object holds the attribute name and attribute data in Unicode format.
Getting the AmdtSystemAttribute value:
OdString AmdtSystemAttribute::getString() const;
Getting the AmdtSystemAttribute array:
OdDbObjectIdArray AcRfObjAttGroupMgr::getSystemAttribIdArray() const;
Getting the AcRfMCADAPIAttHolder by AcMeScope:
void AcRfMCADAPIAttHolder::getHolderFromScope(const AcMeScope* pScope, OdDbObjectId& objectId) const;
Getting the AcRfAttGeneralMgr by AcMeScope:
AcRfAttGeneralMgrPtr AcRfAttGeneralMgr::getManagerFromScope(const AcMeScope* pScope) const;
BOM Manager is a service that allows you to work with part data and component data. Most of the data is stored in data entries. The Teigha Mechanical structure is organized so that DataEntryPart entries store data inside themselves, and DataEntryBlock entries store data in other objects that are implicitly connected with data entries. AmdtSystemAttributes allows you to store attribute values in a convenient way.