- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Melle. I cant reproduce the code required without doing the work needed but the process would be something like this.
I would move the constraint deleting and grounding to its own sub where i would pass in the assembly you want it applied to.
For each component occurence you need to check if typeof is kassemblycomponentdefinition then pass this into the sub. This could be a bit complicated so another way might be this;
Instead of using the bom you should navigate something like
Dim odoc as inventor.assemblydocument: set odoc = thisapplication.activedocument.
Dim oChildDoc as inventor.document.
For each oChildDoc in odoc.allreferencedfiles
if ochildDoc.componentdefinition.type = assembly then
pass to sub (ochilddoc)
end if
next
Then at the end pass in odoc.
Also you might need to add in a check for the windows file state 'ReadOnly' and change it before editing. Assuming you are allowed to edit all these files.
PPS i would also do it in VBA as its much easier to bug test/step through. And you can navigate the API.
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro