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: 

Exporting to STL under high resolution

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
JorisSteurs1246
4079 Views, 2 Replies

Exporting to STL under high resolution

I have an iLogic rule that saves out a part to STL.

It works well but is saves under a low resolution and effects the quality of my 3D prints.

I tried to do some changes as you see in the script below but they didn'tresultt in a better outcome.

Looking forward to your suggestions.

 

 


oPath = ThisDoc.WorkspacePath


Dim STLAddIn As TranslatorAddIn
STLAddIn = ThisApplication.ApplicationAddIns.ItemById("{81CA7D27-2DBE-4058-8188-9136F85FC859}")

Dim oDocument As Document = ThisDoc.Document

Dim oContext As TranslationContext
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
' Create a NameValueMap object
Dim oOptions As NameValueMap
oOptions = ThisApplication.TransientObjects.CreateNameValueMap

' Create a DataMedium object
Dim oDataMedium As DataMedium
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
' Check whether the translator has 'SaveCopyAs' options
If STLAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then
oOptions.Value("OutputFileType") = 0 ' 0 = Binary , 1 = ASCII
oOptions.Value("ExportUnits") = 5 ' units = mm


'********* here I want to set the resolution to high, but unsuccessfully ***********

 

oOptions.Value("Resolution") = High  'the output staysin a poorly low resolution.

 

'********************************************************

 

oOptions.Value("ExportColor") = True
End If

'Set the destination file name
oDataMedium.FileName = ThisDoc.ChangeExtension(".stl")

'Publish document.
Call STLAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)

 

MessageBox.Show("The STL file is created and saved in " & oPath , "Info")

 

Tags (1)
2 REPLIES 2
Message 2 of 3
t_hascj
in reply to: JorisSteurs1246

Hi JerisSteurs1246,

Try this code:

oOptions.Value("Resolution") = 0

 

Resolution HIGH = 0
MEDIUM = 1
LOW = 2
CUSTOM = 3 
BREP = 4

http://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-25D24E28-7517-4903-8AEE-123F8C71A89E


Thanks,
Jaroslav

Message 3 of 3
JorisSteurs1246
in reply to: t_hascj

Thank you Jaroslav! The model comes out perfectly now.

 

Joris

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report