Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
j.peterszetapdm
949 Views, 7 Replies

iPart or iAssembly member save as other automation

Hi all, 

I'm not all that up to speed with iLogic but I've cobbled together a rule to generate all members of an iPart/iAssembly factory. This is good but I really want it to also save as another format too like a .sat file or .step and I cant seem to get it to, it will only save the current member.

 

 

' Set reference to active document.
oDoc = ThisApplication.ActiveDocument

' Check the Document type is an assembly or part
If (oDoc.DocumentType <> kAssemblyDocumentObject And _
   oDoc.DocumentType <> kPartDocumentObject) Then
   MsgBox("Error:Document type is not assembly/part")
   Exit Sub
End If

Dim oDef As AssemblyComponentDefinition = oDoc.ComponentDefinition 
Dim initRowIndex As Integer
Dim oFactory As iAssemblyFactory = oDef.iAssemblyFactory


Dim oRow As iAssemblyTableRow
For Each oRow In oFactory.TableRows
	' Generate the member and file, (overwrites member file or creates new file)
	oFactory.CreateMember(oRow)
	' Get document's full file name
    sFname = iProperties.Value("Project", "Part Number") & ".sat"

    ' Do a 'Save Copy As' to SAT format
    oDoc.SaveAs(sFname, True)
Next

 

 

 

 

Anyone able to help get the save as for each member working?