Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Occurrence and DWFx

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Anonymous
357 Views, 1 Reply

Occurrence and DWFx

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

 

 

 

1 REPLY 1
Message 2 of 2
Vladimir.Ananyev
in reply to: Anonymous

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.

 

 


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report