Message 1 of 5
Save idw as dxf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am very new to VB. I'm wondering if someone could explain what the invapp.CommandManager is or where I could find some help on it. The code is shown below. It works great but it saves the file as a zip file and I just need the dxf. Also, I don't understand how to tell it where the file should be saved.
Thanks you,
Joan
I downloaded an AutoSave program from one of the forums and I'm trying to customize it.
Sub AutoSave()
MsgBox "See you tomorrow", vbInformation
Dim invApp As Inventor.Application
Set invApp = ThisApplication
invApp.SilentOperation = True
Dim idwDoc As Inventor.DrawingDocument
Set idwDoc = invApp.ActiveDocument
Dim dxfFile As String
dxfFile = idwDoc.FullFileName
If dxfFile = "" Then
dxfFile = "c:\temp\" & idwDoc.DisplayName
End If
Mid(dxfFile, Len(dxfFile) - 3) = ".dxf"
With invApp.CommandManager
Call .PostPrivateEvent(kFileNameEvent, dxfFile)
Call .StartCommand(kFileSaveCopyAsCommand)
End With
Set idwDoc = Nothing
invApp.SilentOperation = False
Set invApp = Nothing
End Sub
I am very new to VB. I'm wondering if someone could explain what the invapp.CommandManager is or where I could find some help on it. The code is shown below. It works great but it saves the file as a zip file and I just need the dxf. Also, I don't understand how to tell it where the file should be saved.
Thanks you,
Joan
I downloaded an AutoSave program from one of the forums and I'm trying to customize it.
Sub AutoSave()
MsgBox "See you tomorrow", vbInformation
Dim invApp As Inventor.Application
Set invApp = ThisApplication
invApp.SilentOperation = True
Dim idwDoc As Inventor.DrawingDocument
Set idwDoc = invApp.ActiveDocument
Dim dxfFile As String
dxfFile = idwDoc.FullFileName
If dxfFile = "" Then
dxfFile = "c:\temp\" & idwDoc.DisplayName
End If
Mid(dxfFile, Len(dxfFile) - 3) = ".dxf"
With invApp.CommandManager
Call .PostPrivateEvent(kFileNameEvent, dxfFile)
Call .StartCommand(kFileSaveCopyAsCommand)
End With
Set idwDoc = Nothing
invApp.SilentOperation = False
Set invApp = Nothing
End Sub