Message 1 of 2
Need help running a iLogic rule that saves assembly and drawing file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I am trying to run a iLogic rule that allows the user to save the Assembly and Drawing into a new file name/ part number.
I am able to save the assembly, but I cant seem to get the drawing file associated with that assembly to save simultaneously.
Currently I have a rule in the assembly that "saves As" and a rule in the document that "Save As", and my current process is to have the assembly rule run the Drawing rule, but it seeems it wont let me.
Is this the right approach? Is there a better approach?
here is my current code:
' defining the active document oDoc = ThisDoc.Document ' creating a file dialog box pop-up 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 ' setting the directory to the dialog at oFileDlg.InitialDirectory = ThisDoc.PathAndFileName(False) oFileDlg.FileName = iProperties.Value("Project", "Part Number") oFileDlg.CancelError = True On Error Resume Next oFileDlg.ShowSave 'catch an empty string in the imput If Err.Number <> 0 Then MessageBox.Show("No File Saved.", "iLogic: Dialog Canceled") Else If oFileDlg.FileName <> "" Then MyFile = oFileDlg.FileName 'save the file oDoc.SaveAs(MyFile, True) 'True = Save As Copy & False = Save As End If
iLogicVb.RunRule ("Sample Part", "Rule name")