Hi,
And if you try to run this vba module, what happens? (need to have a part open and file will be save at C:\temp\Plate.stl
Public Sub ExportToSTL()
On Error GoTo errhandler
' Get the STL translator Add-In.
Dim oSTLTranslator As TranslatorAddIn
Set oSTLTranslator = ThisApplication.ApplicationAddIns _
.ItemById("{533E9A98-FC3B-11D4-8E7E-0010B541CD80}")
If oSTLTranslator Is Nothing Then
MsgBox "Could not access STL translator."
Exit Sub
End If
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oContext As TranslationContext
Set oContext = ThisApplication.TransientObjects.CreateTranslationContext
Dim oOptions As NameValueMap
Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap
If oSTLTranslator.HasSaveCopyAsOptions(oDoc, oContext, oOptions) Then
' Set accuracy.
' 2 = High, 1 = Medium, 0 = Low
oOptions.value("Resolution") = 1
' Set output file type:
' 0 - binary, 1 - ASCII
oOptions.value("OutputFileType") = 1
oContext.Type = kFileBrowseIOMechanism
Dim oData As DataMedium
Set oData = ThisApplication.TransientObjects.CreateDataMedium
oData.FileName = "C:\temp\Plate.stl"
Call oSTLTranslator.SaveCopyAs(oDoc, oContext, oOptions, oData)
End If
Beep
MsgBox "Completed"
Exit Sub
errhandler:
Call MsgBox(Err.Description & vbCr & Err.Number)
End Sub
If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"