Page 1 of 1
Editing Config Specific Props from BOM question
Posted: Tue Sep 10, 2024 1:41 pm
by loeb
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?
Thank You
Re: Editing Config Specific Props from BOM question
Posted: Tue Sep 10, 2024 4:53 pm
by AlexB
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.
Re: Editing Config Specific Props from BOM question
Posted: Tue Sep 10, 2024 6:16 pm
by loeb
AlexB,
I'm opening the parts/assemblies as I'm going through a drawing BOM.
I managed to get my code working today, much like I described. Now, to move them to the vault and check them in and figure out how the PDM API...
Thank you for your offer of help. I might just take that you up on that.
Re: Editing Config Specific Props from BOM question
Posted: Wed Sep 11, 2024 12:58 am
by gupta9665
loeb wrote: ↑Tue Sep 10, 2024 6:16 pm
AlexB,
I'm opening the parts/assemblies as I'm going through a drawing BOM.
I managed to get my code working today, much like I described. Now, to move them to the vault and check them in and figure out how the PDM API...
Thank you for your offer of help. I might just take that you up on that.
Please note that PDM API is not supported in Standard version. So you will need PDM professional in order to use the APIs.