Message 1 of 5
Why won't this place my drawing views correctly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When I run this code it just places one view and its in the wrong place. Also, when I edit the style or scale of the view, It doesn't change anything
'define assembly As active document Dim oDoc As AssemblyDocument oDoc = ThisApplication.ActiveDocument Try ThisApplication.Documents.Open _ (ThisDoc.PathAndFileName(True).Replace("iam", "idw")) Return 'exit rule Catch End Try oNewDrawing = ThisDoc.ChangeExtension(".idw") oTemplateFolder = ThisApplication.FileOptions.TemplatesPath oTemplate = oTemplateFolder & "Standard.idw" Dim oDrawingDoc As DrawingDocument oDrawingDoc = ThisApplication.Documents.Add (DocumentTypeEnum.kDrawingDocumentObject,, True) oDrawingDoc.Activate() Dim oSheet As Sheet oSheet = oDrawingDoc.Sheets.Item(1) Dim oPoint1 As Point2d oPoint = ThisApplication.TransientGeometry.CreatePoint2d(0, 0) Dim oPoint2 As Point2d oPoint = ThisApplication.TransientGeometry.CreatePoint2d(0, 0) Dim oPoint3 As Point2d oPoint = ThisApplication.TransientGeometry.CreatePoint2d(0, 0) ' place the base front view Dim oFrontview As DrawingView oFrontview = oSheet.DrawingViews.AddBaseView(oDoc, oPoint1, .5, ViewOrientationTypeEnum.kFrontViewOrientation, DrawingViewStyleEnum.kHiddenLineDrawingViewStyle) ' Creating projected views ' Dim oTopView As DrawingView oTopView = oSheet.DrawingViews.AddProjectedView(oFrontview, oPoint2, DrawingViewStyleEnum.kFromBaseDrawingViewStyle) Dim oIsoView As DrawingView oIsoView = oSheet.DrawingViews.AddProjectedView(oFrontview, oPoint3, DrawingViewStyleEnum.kFromBaseDrawingViewStyle) oDrawingDoc.SaveAs(oNewDrawing, False) MessageBox.Show("This new file saved as: " & oNewDrawing, "iLogic")