Sub Main() Call ExportPartsToSTEP() End Sub Public Sub ExportPartsToSTEP() ' Get the STEP translator Add-In. Dim oSTEPTranslator As TranslatorAddIn 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 oContext = ThisApplication.TransientObjects.CreateTranslationContext Dim oOptions As NameValueMap oOptions = ThisApplication.TransientObjects.CreateNameValueMap SavePath = "****(FILE OF YOUR CHOICE LEAVE \ AT END TO PUT IN THE FILE****)\" ' Get the active assembly document Dim oAsmDoc As AssemblyDocument oAsmDoc = ThisApplication.ActiveDocument ' Iterate through each component in the assembly Dim oComp As ComponentOccurrence For Each oComp In oAsmDoc.ComponentDefinition.Occurrences ' Check if the component is a part (not another assembly) If oComp.DefinitionDocumentType = DocumentTypeEnum.kPartDocumentObject Then ' Get the part document Dim oPartDoc As PartDocument oPartDoc = oComp.Definition.Document If oSTEPTranslator.HasSaveCopyAsOptions(oPartDoc, oContext, oOptions) Then ' Set application protocol. oOptions.Value("ApplicationProtocolType") = 2 oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism Dim oData As DataMedium oData = ThisApplication.TransientObjects.CreateDataMedium ' Create the file name using the part number oData.FileName = SavePath & oPartDoc.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value & ".stp" Call oSTEPTranslator.SaveCopyAs(oPartDoc, oContext, oOptions, oData) End If End If Next End Sub