03-05-2019
12:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-05-2019
12:12 PM
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?
Solved! Go to Solution.