Create Detail view with API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All
I'm trying to create a Circular fenced detail drawing view using iLogic, but seem to be running in to an issue. I've used the Programming help and googled to death but can't seem to get anywhere.
With the following Code, I essentially get an error message saying "The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"
at this point it fails:
"at Inventor.DrawingViews.AddDetailView(DrawingView ParentView, Point2d Position, DrawingViewStyleEnum ViewStyle, Boolean CircularFence, Point2d FenceCenterOrCornerOne, Object FenceRadiusOrCornerTwo, Object AttachPoint, Object Scale, Boolean ShowLabel, String Name, Boolean Reserved)"
Problem is I don't know which parameter is incorrect. I've spent a fair few hours trying to solve this and now I'm hoping someone here may be able to enlighten me as to the issue?
SyntaxEditor Code Snippet
Sub CreateView() ' Set a reference to the drawing document. Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument 'References this drawing sheet Dim oSheet As Inventor.Sheet oSheet = oDrawDoc.ActiveSheet ' Select a drawing view. Dim oDrawingView As DrawingView oDrawingView = ActiveSheet.View("A").View ' Ready code for creating of reference points Dim oTG As TransientGeometry oTG = ThisApplication.TransientGeometry ' Set a reference to the center of the base view. Dim oPoint As Point2d oPoint = oDrawingView.Center oPoint.X = oPoint.X + oDrawingView.Width Dim oCenterPoint As Point2d oCenterPoint = oTG.CreatePoint2d(oDrawingView.Center.X, oDrawingView.Center.Y) ' Create the detail view. Dim oDetailView As DetailDrawingView oDetailView = oSheet.DrawingViews.AddDetailView(oDrawingView, oPoint, kFromBaseDrawingViewStyle, True, oCentrePoint, 1, , oDrawingView.Scale*3, True, "Detail C") End Sub
Thanks