Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Export glTF with iLogic

4 REPLIES 4
Reply
Message 1 of 5
miroslav.roydev
652 Views, 4 Replies

Export glTF with iLogic

Hello!

I want to export glTF file with iLogic. Now i have script for export obj and want to replace it becouse the files size it 10 time smaller and more. Now i use TranslatorAddIn.

 

Tags (1)
Labels (2)
4 REPLIES 4
Message 2 of 5

Hi @miroslav.roydev.  I have never heard of that file type or file extension before.  What specific software generates that type of file?  What is it for?  What type of Inventor document are you attempting to export as that type of file?  I see that file extension listed as one of the ones available for Inventor 2022 exports, but it does not say which software it is associated with, so it is difficult to find which TranslatorAddIn might be associated with exporting that type of file.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 5

Hi @WCrihfield, in our company we are making ERP System for our manafucture and in the ERP we want to view the 3D. The software company which we hire to develope the system is using three.js , we made few tests with the different file formant and we have best result with glTF(.glb). Now I want to write iLogic rule which can export all parts in assembly file in different glb files and the assembly.

Message 4 of 5

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

 

Message 5 of 5

Glad to see that you got it figured out. 🙂

I do not see that translator add-in available in my list of translator add-ins, which is likely why I could not find the proper one before.  I am still using Inventor Professional 2022.2.2 (but getting updated soon), so I'm guessing maybe you have 2023 version installed, because I see that is one of the new translators available in that version (Link1).

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report