Message 1 of 15
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have tried to add views to my sheet but I can not seem to add projected views with the current code.
Should I just use "AddBaseView" everywhere instead of "AddProjectedView" because something is not working
with "AddProjectedView" option. Also it does not contain view orientation in itself so I am curious how program
knows how to choose the right side of the projected view.
This is idea:
And the code:
Dim oDrawingDoc As DrawingDocument = ThisApplication.ActiveDocument Dim oSheet As Sheet = oDrawingDoc.Sheets.Item(1) Dim oPoint1 As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(20, 20) Dim oPoint2 As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(20, 10) Dim oPoint3 As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(30, 10) Dim oPoint4 As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(30,20) Dim oPath As String = System.IO.Path.GetDirectoryName(oDrawingDoc.FullFileName) Dim oAssyFullFileName As String = System.IO.Path.Combine(oPath, "iMachineIsland_top_assy.iam") Dim oAssyDoc As AssemblyDocument = ThisApplication.Documents.Open(oAssyFullFileName, False) Dim oBaseView As DrawingView oBaseView = oSheet.DrawingViews.AddBaseView(oAssyDoc, oPoint1, 1, kTopViewOrientation, kHiddenLineDrawingViewStyle) Dim oView2 As DrawingView oView2 = oSheet.DrawingViews.AddProjectedView(oBaseView, oPoint2,kFromBaseDrawingViewStyle) Dim oView3 As DrawingView oView3 = oSheet.DrawingViews.AddProjectedView(oView2, oPoint3, kFromBaseDrawingViewStyle) Dim oIsoView As DrawingView Dim IsoView = oSheet.DrawingViews.AddBaseView(oAssyDoc, oPoint4, 1, kIsoTopLeftViewOrientation, kHiddenLineDrawingViewStyle) oAssyDoc.Close(True)
In case anyone knows what is wrong here with creating View 2 and View 3 please let me know.
Tom
Solved! Go to Solution.