Hello,
I'm kind of new to Inventor, having the French version of Inventor Pro 9.
I'm starting to customize this version to my usual work and VBA macros are a breeze for that.
My problem is to batch some works, and to save files in a specified format like DWG ( customers purposes ).
For the batch process I found out the add-in from KWik, but the saveas macro ( exporting in different formats ) available on this site isn't working with my version.
I spent some time to find out what was wrong but I was unable to succeed.
So I'm postin the vba code which I have problem with in the hope some AUGI members can help me.
Public Sub SaveasDwg()
Set oDoc = ThisApplication.ActiveDocument
If oDoc.DocumentType <> kDrawingDocumentObject Then
Exit Sub
End If
Dim addIns As ApplicationAddIns
Set addIns = oDoc.Parent.ApplicationAddIns
Dim dwgAddIn As TranslatorAddIn
Dim i As Integer
For i = 1 To addIns.Count
If addIns(i).AddInType = kTranslationApplicationAddIn Then
If addIns(i).Description = "Autodesk Internal DWG Translator" Then
Set dwgAddIn = addIns.Item(i)
Exit For
End If
End If
Next i
'Activate AddIns
dwgAddIn.Activate
Dim fname As String
fname = oDoc.FullFileName
fname = Left(fname, Len(fname) - 3) & "dwg"
Dim iPath As Integer
Dim sPath As String
iPath = InStrRev(fname, "\")
sPath = Left(fname, iPath)
Call createDWG(oDoc.Parent, dwgAddIn, fname, sPath)
End Sub
Greetings
F. Dess
Tooling Designer
EAT Engineering
France