Hi There,
I am looking for a solution to create STEP files automatically for parts and assembly using a single click.
Or
Convert all files in a folder to STEP files.
The following will do:
Public Sub ExportToSTEP() ' Get the STEP translator Add-In. Dim oSTEPTranslator As TranslatorAddIn Set oSTEPTranslator = ThisApplication.ApplicationAddIns.ItemById("{90AF7F40-0C01-11D5-8E83-0010B541CD80}") If oSTEPTranslator Is Nothing Then MsgBox "Could not access STEP translator." Exit Sub End If Dim oContext As TranslationContext Set oContext = ThisApplication.TransientObjects.CreateTranslationContext Dim oOptions As NameValueMap Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap If oSTEPTranslator.HasSaveCopyAsOptions(ThisApplication.ActiveDocument, oContext, oOptions) Then ' Set application protocol. ' 2 = AP 203 - Configuration Controlled Design ' 3 = AP 214 - Automotive Design oOptions.Value("ApplicationProtocolType") = 3 ' Other options... 'oOptions.Value("Author") = "" 'oOptions.Value("Authorization") = "" 'oOptions.Value("Description") = "" 'oOptions.Value("Organization") = "" oContext.Type = kFileBrowseIOMechanism Dim oData As DataMedium Set oData = ThisApplication.TransientObjects.CreateDataMedium oData.FileName = "C:\temptest.stp" Call oSTEPTranslator.SaveCopyAs(ThisApplication.ActiveDocument, oContext, oOptions, oData) End If End Sub
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
Can't find what you're looking for? Ask the community or share your knowledge.