06-01-2022
10:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-01-2022
10:21 PM
Hi all, at the end with try and error I succeed to export glTF files.
Dim oApp As Inventor.Application = ThisApplication Dim oDoc As Document = oApp.ActiveDocument Dim oOBJ As TranslatorAddIn For Each oAppAddin As ApplicationAddIn In oApp.ApplicationAddIns ' MsgBox(oAppAddin.AddInType ) If oAppAddin.DisplayName = "Translator: glTF" Then MsgBox(1) oOBJ = oAppAddin End If Next 'The following lines create the needed input variables Dim oTO As TransientObjects = oApp.TransientObjects Dim oContext As TranslationContext = oTO.CreateTranslationContext oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism Dim oOptions As NameValueMap = oTO.CreateNameValueMap Dim oDataMedium As DataMedium = oTO.CreateDataMedium Dim SavePath As String Dim tDoc As Inventor.Document = ThisDoc.Document SavePath = "\\192.168.2.101\erp\ERP_ROOT\OBJ_3Dmodels\" oBaseName = tDoc.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value oRev = tDoc.PropertySets.Item("Inventor Summary Information").Item("Revision Number").Value oRev = FormatRevisionNumber(oRev) oDataMedium.FileName = System.IO.Path.ChangeExtension(SavePath & oBaseName & oRev, ".glb") Try oOBJ.SaveCopyAs(oDoc, oContext, oOptions, oDataMedium) Catch MsgBox(oBaseName) End Try