Hi Community,
In the .IAM I have two occurences of Part A.
Using the following code (or similiar), the command saves in an attribute a different value for each occurrence.
int i=0;
foreach (ComponentOccurrence occ in co)
{
items.Clear();
byte[] oOccRef = new byte[10];
occ.GetReferenceKey(ref oOccRef, nKeyCont);
if (!occ.AttributeSets.get_NameIsUsed("ATTR"))
{
occ.AttributeSets.Add("ATTR", false);
occ.AttributeSets["ATTR"].Add("ITEMCSchema", ValueTypeEnum.kStringType, i);
i++;
}
}
When the user uses the command Export DWFx, is it possible to "split" the BOM into the occurrences.
If I extract now, the data in the DWFx are:
- PartA, quantity=2
Is it possible to obtain:
- ATTR 1, PartA, quantity 1
- ATTR 2, PartA, quantity 1
This is important because I assign in the attribute a different code based on the functionality of the piece and during the assembly phase, the worker with the DWFx needs to know this attribute and not only the name of the part.
Hope my request is understandable and someone can help me.
Thanks,
Regards,
Mario
Solved! Go to Solution.
Solved by Vladimir.Ananyev. Go to Solution.
Standard BOM mechanism differs parts by their Part Number property values, saved in document files. It ignores attributes and any other information in component occurrences.
In order to split these components into different BOM rows you have not only assign attributes but need to copy parts + replace file references as well.
Look at the ComponentOccurrence.Replace method.