04-27-2020
10:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-27-2020
10:36 AM
I added i filebrowser to select iam file to your code. Is this what you're looking for? ![]()
Dim oDlg As Inventor.FileDialog ThisApplication.CreateFileDialog(oDlg) oDlg.Filter = "Inventor Assembly Files (*.iam)|*.iam" oDlg.ShowOpen() ' to open files If oDlg.FileName = "" Then Exit Sub Dim oPartDoc As AssemblyDocument oPartDoc = ThisApplication.Documents.Open(oDlg.FileName, False) Dim oDrawingDoc As DrawingDocument oDrawingDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet oSheet = oDrawingDoc.Sheets.Item(1) Dim oPoint1 As Point2d oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(4.5#, 6#) Dim oView1 As DrawingView oView1 = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint1, 0.03125#, kFrontViewOrientation, kHiddenLineRemovedDrawingViewStyle) ActiveSheet.View(oView1.Name).SetCenter(4.5, 6) Call oPartDoc.Close(True)
Jhoel Forshav
Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website