Replace assembly component in new folder. Inventor 2020. VBA or Apprentice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
My flow
I use Design Assistant now, but it is so boring 🙂
I copy Assembly, SubAssembly, Parts and Drawings from old folder to new folder and rename files from ABC 1 to ABC 2... with windows cmd.
What I should do next is to replace or actually resolve files from new folder. And I would like to do it with some automation.
For example I am using VBScript in Winautomation for SAP GUI but I dont think I can use this VBScript for Inventor.
I found VBA Example
Public Sub CReplace()
Dim oOccurrence As ComponentOccurrence
Set oOccurrence = ThisApplication.ActiveDocument.ComponentDefinition.Occurrences.Item(1)
oOccurrence.Replace "<filename>", True
End Sub
I have files:
A.iam (main assembly)
B.iam:1 (SubAssembly)
C.iam:1 (SubAssembly)
D:1.ipt (Part)
E.idw (Drawing)
*** Item (1), I don`t ge it, all files have :1 on the end and another assembly might have different number of files.
How to choose item with file name for example:
"change B.iam (old folder) to Bxxx.iam (new folder)"
"change C.iam (old folder) to Cxxx.iam (new folder)"
"change D.ipt (old folder) to Dxxx.iam (new folder) with Exxx.idw"
Any ideas