- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm trying to get some code to work to make a workflow as easy as possible for non inventor users using a design calculator.
Current workflow (we use vault but are avoiding it in this scenario)
Copy .ipt and .idw from master folder into new folder
Rename files to the same unique filenames
open .ipt
once inputs are complete click button that runs the below rule-
'opens drawing with same filename
Try oIDW = ThisDoc.FileName(False) & ".idw" ThisDoc.Launch(oIDW) Catch MessageBox.Show("No Drawing Found", "Title") End Try
Drawing opens
below rule triggers on open
'replaces model reference with same file name but with .ipt
oDoc = ThisDoc.Document oFilepathext = ThisDoc.ChangeExtension(".ipt") Dim oFD As FileDescriptor oFD = oDoc.ReferencedFileDescriptors(1).DocumentDescriptor.ReferencedFileDescriptor oFD.ReplaceReference(oFilepathext) InventorVb.DocumentUpdate()
The model reference shows correctly in "Replace Model Reference" but the view doesn't update.
The sheet has the lightning bolt like it needs updating but it won't let me update anywhere (I've also tried getting to update with a ilogic rule)
If I save and close it and reopen it fixes the link but this is a step I want to avoid.
Any help appreciated.
Solved! Go to Solution.