Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need to insert a part into an assembly via iLogic.
I need to bring up the insert component dialog. I always select the component manually in the dialog box.
After inserting the component, an iProperty is created with a value.
I looked in the API Help and didn't find anything. FileDialog Object
'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("Custom", "Saved By")& "-" & iProperties.Value("Custom", "Date Saved") & "-" & iProperties.Value("Custom", "Time Saved") '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() 'oFileDlg.ShowOpen() oFileDlg.ShowPlaceComponent()??????????????????????????????????????????? '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 'ThisApplication.Documents.Open(oFileDlg.FileName) 'oDoc.SaveAs(MyFile, False) 'True = Save As Copy & False = Save As End If MessageBox.Show(oFileDlg.FileName, "Title")
Solved! Go to Solution.