Community
Does anybody know if I can automatically insert the standards (3rd angle) views using a VBA macro.
For example, Top, front & right views
Many thanks in advance!!!
IsoCAM
You may create drawing views using Sheet.DrawingViews.AddBaseView and Sheet.DrawingViews.AddProjectedView methods.
Оrientation of the model within the base view.is defined by the input ViewOrientationTypeEnum constant (e.g., kBottomViewOrientation, kTopViewOrientation, etc.). Orientation of projected view depends on its insertion point position relative to the parent base view.
Here is the VB .NET sample:
Public Sub CreateViews() Dim oDrawingDoc As DrawingDocument oDrawingDoc = _InvApplication.ActiveDocument 'Open a Part model to create a view for, invisibly Dim oPartDoc As PartDocument oPartDoc = _InvApplication.Documents.Open("C:\Temp\Part1.ipt", False) Dim oTG As TransientGeometry = _InvApplication.TransientGeometry Dim oSheet As Sheet = oDrawingDoc.ActiveSheet ' Create the base view. Dim oFrontView As DrawingView oFrontView = oSheet.DrawingViews.AddBaseView(oPartDoc, _ oTG.CreatePoint2d(35, 20), 1, _ ViewOrientationTypeEnum.kFrontViewOrientation, _ DrawingViewStyleEnum.kHiddenLineDrawingViewStyle) ' Create projected views. Dim oRightView As DrawingView oRightView = oSheet.DrawingViews.AddProjectedView(oFrontView, _ oTG.CreatePoint2d(15, 20), _ DrawingViewStyleEnum.kFromBaseDrawingViewStyle) Dim oIsoView As DrawingView oIsoView = oSheet.DrawingViews.AddProjectedView(oFrontView, _ oTG.CreatePoint2d(15, 35), _ DrawingViewStyleEnum.kHiddenLineRemovedDrawingViewStyle) End Sub
Inventor API samples on drawing views are located here:
Cheers,