10-05-2022
05:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-05-2022
05:08 AM
Sorry,
I use thise code for automatic drawing sheet bay sheet and only open assambly:
Sub main 'Dim oAsmDoc As Document = ThisDoc.Document Dim oAsmDoc As _Document = ThisApplication.ActiveDocument templateFile = "Template.idw" Dim oDrawingDoc As DrawingDocument = ThisApplication.Documents.Add(DocumentTypeEnum.kDrawingDocumentObject,templateFile,True) oDrawingDoc.Activate() Dim oSheet As Sheet = oDrawingDoc.Sheets.Item(1) Dim oPoint1 As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(oSheet.Width/4, oSheet.Height/1.25) Dim oPoint2 As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(oSheet.Width/1.25, oSheet.Height/3) Dim oView As DrawingView oView = oSheet.DrawingViews.AddBaseView(oAsmDoc, oPoint2, 1/30, ViewOrientationTypeEnum.kIsoTopRightViewOrientation,DrawingViewStyleEnum.kShadedDrawingViewStyle ) 'oView.RotateByAngle((PI / 180), True) oView = oSheet.DrawingViews.AddBaseView(oAsmDoc, oPoint1, 1 / 20, ViewOrientationTypeEnum.kFrontViewOrientation, DrawingViewStyleEnum.kHiddenLineRemovedDrawingViewStyle, ) Dim V2Point2D As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(oView.Center.X, oView.Center.Y + 10) Dim V3Point2D As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(oView.Center.X - 10, oView.Center.Y) Dim oView2 As DrawingView = oSheet.DrawingViews.AddProjectedView(oView, V2Point2D, DrawingViewStyleEnum.kFromBaseDrawingViewStyle) oView2.Position = ThisApplication.TransientGeometry.CreatePoint2d(oView.Center.X, oView.Center.Y - oView.Height / 2 - oSep - oView2.Height / 2) End Sub
, and i lyke to modif for multi sheet drawing and all subassambly with part number.
Thanks.