Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a program that opens an instance of an existing file and returns that file. What I want to do is call the save as command and return the new file that generates. I do not know what the name will be, because I don't type the name myself, we use a system of randomly generated numbers that are generated when the save as command is run by the program. I need to figure out a way to open and return the new file name, as I intend to pass information into it from an excel file and run some ilogic rules to reconfigure the entire thing.
Please note I'm running the rules from excel but have the inventor reference library enabled.
Thank you
Private Sub CreateMomentFrameB_Click() Dim Doc As Object Dim Doc2 As Object Dim DLG As FileDialog Dim Inventor As Inventor.Application Dim InventorObjects As Variant InventorObjects = OpenInventorFile("C:\Work\Designs\Project Documents\EDH\Working Projects\Dynamic Base Assemblies\DynamicMomentFrameAssembly.iam", False) Set Inventor = InventorObjects(0) Set Doc = InventorObjects(1) 'This saves the file but doc is still set to the old file, so that when I run my ilogic rule it uses that rather than the freshly made file. Doc.Save Worksheets("PCR").Range("J" & 7) = Split(Split(Doc.FullFileName, "\")(UBound(Split(Doc.FullFileName, "\"))), ".")(0) Call RuniLogic("Master Rule", Doc, Inventor, False) End Sub
Solved! Go to Solution.