There is an easier approach to this, but there is
one limitation in Inventor 2008 that has been addressed in 2009. The approach is
to set the HandlingCode in the event to kEventHandled and the FileName to the
string of your choice (i.e. the one obtained using your own form). If you
go this route, you don't have to explicitly save the documents thru the API -
Inventor takes care of that for you. The limitation in Inventor 2008 is
that you cannot specify whether you want a drawing to be saved as an
Inventor or an AutoCAD dwg - the event assumes AutoCAD dwg if a dwg
extension is provided.
So, if your utility is intended for Inventor 2009
or later, the solution is really simple as shown below. Else, you'll have to
further experiment with your code that performs the save using the
API.
Sanjay-
Private Sub
oFileUIEvents_OnFileSaveAsDialog(FileTypes() As String, ByVal SaveCopyAs As
Boolean, ByVal ParentHWND As Long, FileName As String, ByVal Context As
NameValueMap, HandlingCode As HandlingCodeEnum)
' Your dialog/form here
' Specify that event is being handled and the file
name
HandlingCode = kEventHandled
FileName = "C:\temp\test.ipt"
' If
a DWG file extension is specified, the following specifies
' whether to save the document to AutoCAD or Inventor dwg.
' WORKS ONLY IN INVENTOR
2009 OR LATER
Call Context.Add("SaveAsInventorDWG",
True)
End Sub