@Anonymous
BIM Add-in APIs are embedded into Inventor APIs. Users can use those APIs directly without knowing any technical detail about BIM Add-in.
I made a simple VBA script to show how to export a part/assembly to rfa file. You can try it.
- Launch Inventor.
- Launch VBA editor from Ribbon "Tools"->"VBA Editor
- Insert a module by context menu of "Modules" folder of "ApplicationProject".
- Copy/paste follow code into new created module. Then "Run"/"Debug" the script.
Sub DoRFAExport()
Dim strInvFilePath As String
strInvFilePath = "C:\test\part1.ipt"
Dim strRFAFilePath As String
strRFAFilePath = "C:\test\part1.rfa"
Call RFAExportFunc(strInvFilePath, strRFAFilePath)
End Sub
Sub RFAExportFunc(strInvFilePath As String, strRFAFilePath As String)
'open document
Dim oDoc As Document
Set oDoc = ThisApplication.Documents.Open(strInvFilePath)
'get BIMComponent object
Dim oBIMComp As BIMComponent
If (oDoc.DocumentType = kPartDocumentObject) Then
Dim oPartDocument As PartDocument
Set oPartDocument = oDoc
Set oBIMComp = oPartDocument.ComponentDefinition.BIMComponent
Else
If (oDoc.DocumentType = kAssemblyDocumentObject) Then
Dim oAssyDocument As AssemblyDocument
Set oAssyDocument = oDoc
Set oBIMComp = oAssyDocument.ComponentDefinition.BIMComponent
End If
End If
If (oBIMComp Is Nothing) Then
Return
End If
'export to .rfa
Call oBIMComp.ExportBuildingComponent(strRFAFilePath)
'close doc
Call oDoc.Close(True)
End Sub
P.S. Inventor API help file is installed at "C:\Users\Public\Documents\Autodesk\Inventor 20xx\Local Help". We can get more API details from it.
Regards,
Paul