- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am using a code to organize the name with which the inventor's .ipt file will be saved. but I would like to be able to select the location where it will be saved.
Thank you very much for the help.
this is the code used
'get model doc
oModleDoc = ThisDoc.ModelDocument
'process file name
'get position of the last backslash
Dim FNamePos As Long
FNamePos = InStrRev(oModleDoc.FullFileName, "\", -1)
'get file name
Dim docFName As String
docFName = Right(oModleDoc.FullFileName, Len(oModleDoc.FullFileName) - FNamePos)
'define the property set
oDTPs = oModleDoc.PropertySets.Item("Design Tracking Properties")
'define the property
oPN = oDTPs.Item("Part Number").Value
'replace old file name with iproperty value
oPathAndName = Replace(oModleDoc.FullFileName,docFName,oPN)
'save off a copy
ThisDoc.Document.SaveAs(oPathAndName & ".ipt" , True)
'present message to user
MessageBox.Show("File saved to: " & oPathAndName & ".ipt", "iLogic")
Solved! Go to Solution.