I’m writing a macro that will iterate through a BOM and will edit configuration specific properties of parts/assemblies in the BOM. To be clear, I want to edit the part/assembly files themselves. This is a big step beyond anything I have written before and have a question.
I know how to traverse the bom and identify the components in each row using “swBOMTableAnn.GetComponents2”. I think I then need to use “OpenDoc7” on each component so that I can then use “swCustPropMgr.Add3” to edit their configuration specific custom properties. Am I taking the correct approach?
If you’re in an assembly, then you don’t necessarily have to call OpenDoc#. You can likely just get the ModelDoc2 from each Component2 interface and manage the custom properties without having to open/activate each child document.
If you manage to get some code together, I’m sure others in addition to myself would be happy to take a look to help you over some road blocks or improve anything.