- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone, hope you all are having a great day.
So, I am automating my drawings and stuck at a problem of creating drawing views. I found the code from API help about creating detail view, which is:
' Set a reference to the drawing document. ' This assumes a drawing document is active. Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument 'Set a reference to the active sheet. Dim oSheet As Sheet oSheet = oDrawDoc.ActiveSheet ' Select a drawing view. Dim oDrawingView As DrawingView = ActiveSheet.View("FRONT").View ' Set a reference to the center of the base view. Dim oPoint As Point2d oPoint = oDrawingView.Center ' Translate point by a distance equal to the width of the view ' This will be the placement point of the detail view. oPoint.X = oPoint.X + oDrawingView.Width 'oPoint.Y = oPoint.Y - oDrawingView.Height ' Arbitrarily find an arc within the selected drawing view. ' The detail view will include this arc. Dim oCurve As DrawingCurve Dim oArcCurve As DrawingCurve For Each oCurve In oDrawingView.DrawingCurves If oCurve.CurveType = kCircularArcCurve Then oArcCurve = oCurve Exit For End If Next If Not oArcCurve Is Nothing Then ' Use the range of the arc in sheet space to calculate the detail view box. Dim oCornerOne As Point2d oCornerOne = oArcCurve.Evaluator2D.RangeBox.MinPoint oCornerOne.X = oCornerOne.X- ActiveSheet.View("FRONT").Width * 0.1 oCornerOne.Y = oCornerOne.Y - ActiveSheet.View("FRONT").Height * 0.1 Dim oCornerTwo As Point2d oCornerTwo = oArcCurve.Evaluator2D.RangeBox.MaxPoint oCornerTwo.X = oCornerTwo.X + 0.1 oCornerTwo.Y = oCornerTwo.Y + 0.1 ' Create the detail view with a rectangular box. Dim oDetailView As DetailDrawingView oDetailView = oSheet.DrawingViews.AddDetailView(oDrawingView, oPoint, _ kFromBaseDrawingViewStyle, False, oCornerOne, oCornerTwo, , 2, True , "F") Else MessageBox.Show("No arc was found in the selected drawing view.") End If
I understood all of the code, but I am having trouble understanding this block of code, which is essentially defining the fence for the detail view and hence I am unable to place the fence where i want to.
' Arbitrarily find an arc within the selected drawing view.
' The detail view will include this arc.
Dim oCurve As DrawingCurve
Dim oArcCurve As DrawingCurve
For Each oCurve In oDrawingView.DrawingCurves
If oCurve.CurveType = kCircularArcCurve
Then
oArcCurve = oCurve
Exit For
End If
Why is it finding an arc "arbitrarily"? What is this arc anyways and whats the point of finding it?
I will be very very greatful to you for any kind of help, I have been finding the answer for two days now but couldnt find any help so thought of posting it.
Thank You
I am using Inventor 2019
Solved! Go to Solution.