Automation: Replacing Content Center Parts Automation

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Mike, (And other users who can help)
***For any users joining, see this link for the original thread and starting code:
You're code is definitley a great starting point, and will most likely save me a ton of time!
I am currently diving into a small project which should save a lot of time for designers in the end if it pans out.
Issue being resolved:
We use the Vault and have a ton of machines that get re-used from time to time through the Copy Design method. There's obviously some changes that are made from job to job, but the big issue is changing a machine from an Imperial to Metric one. This is the time (and mind) consuming process I'm looking to shorten.
What I have:
Currently I have a code (few tweaks needed but it works) that is run from an upper assembly. This code then cycles through each and every sub assembly and part that exists within it. As it cycles through, it checks for hole features which are tapped, and if it finds one of these instances, changes the thread from Imperial to Metric according to a Hard Coded set of values.
Current Dilema:
What's the point of changing the holes if the designer has to go through the assembly to change the bolts and fasteners anyways?
I've practiced a bit with your code and been able to replace items, the issue is everything must be hard coded in order to do so. My question is:
Is there a way to get the Family from the Part Occurence / Document / Anything related?
I've looked through the API, but have only found that everything related to the Content Center.... is only accessable through the Content Center, and nothing else.
For Example, yes I am able to tell if a part has come from the content center (ie. PartComponentDefinition.IsContentMember), but that's as far as it goes, just a simple Boolean.
There MUST be a way to find out some sort of Content Center information from the direct Part / other related documents. I've looked at the "Replace Content Center Part Sample" provided in the API, but this example hard codes the ContentTreeViewPath as well.
In the end, I don't quite understand the point of hard coding this path with no way to access it through the Part Document. This only creates the need for constant manual change and / or MANY rules to compensate each and every family.
Is there an easy answer to my dilemma?
Thanks for the help in advance
Mitch