With the help from another blog; I was able to create a rule in ilogic that would perform a saveas off the assembly and then in turn would also run the rule under each part to create a brand new assembly and brand new parts within the assembly so that if you were to modify the main assembly this would not be affected by those changes.
Below is the code required for the saveas of an assembly:
'define the active document oDoc = ThisDoc.Document 'create a file dialog box Dim oFileDlg As inventor.FileDialog = Nothing InventorVb.Application.CreateFileDialog(oFileDlg) 'check file type and set dialog filter If oDoc.DocumentType = kPartDocumentObject Then oFileDlg.Filter = "Autodesk Inventor Part Files (*.ipt)|*.ipt" Else If oDoc.DocumentType = kAssemblyDocumentObject Then oFileDlg.Filter = "Autodesk Inventor Assembly Files (*.iam)|*.iam" Else If oDoc.DocumentType = kDrawingDocumentObject Then oFileDlg.Filter = "Autodesk Inventor Drawing Files (*.idw)|*.idw" End If 'set the directory to open the dialog at oFileDlg.InitialDirectory = ThisDoc.WorkspacePath() 'set the file name string to use in the input box oFileDlg.FileName = iProperties.Value("Project", "Project") & "_" & iProperties.Value("Summary", "Title") 'work with an error created by the user backing out of the save oFileDlg.CancelError = True On Error Resume Next 'specify the file dialog as a save dialog (rather than a open dialog) oFileDlg.ShowSave() 'catch an empty string in the imput If Err.Number <> 0 Then MessageBox.Show("No File Saved.", "iLogic: Dialog Canceled") ElseIf oFileDlg.FileName <> "" Then MyFile = oFileDlg.FileName 'save the file oDoc.SaveAs(MyFile, True) 'True = Save As Copy & False = Save As End If
Now in my example; I have created a custom naming convention of the assembly that is controlled by the Project value, and the Title value within the iproperties. (shown below)
oFileDlg.FileName = iProperties.Value("Project", "Project") & "_" & iProperties.Value("Summary", "Title")
Now, to cause the parents under the assembly to saveas with predetermined values run the part rule within the assembly. (shown below)
When you run the rule it will automatically open a SaveAs dialog box for the assembly and once you hit save it will start running the SaveAs dialog for all the parts in the assembly that you call for the "RunRule".