02-21-2022
02:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
02-21-2022
02:10 PM
Thank you, that was it. Here's the revised code:
Sub Main() oFileName = ThisDoc.Path & "\Drawing Files\" & ThisDoc.FileName & ".dwg" If (System.IO.File.Exists(oFileName)) Then Exit Sub End If Template = ThisDoc.Path & "\.Resources\Templates\Sheet Metal Drawing.dwg" Dim oDrawingDoc As Document= ThisApplication.Documents.Add(DocumentTypeEnum.kDrawingDocumentObject, Template, False) Dim oSheet As Sheet = oDrawingDoc.Sheets.Item(1) Dim oCenter As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(oSheet.Width / 2, oSheet.Height / 2) oSheet.DrawingViews.AddBaseView(ThisDoc.Document, oCenter, 1, kFrontViewOrientation, kHiddenLineRemovedDrawingViewStyle, "Front") oDrawingDoc.SaveAsInventorDWG(oFileName, False) End Sub