Interop Exception for View.DrawingCurves
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Guys,
I am facing an error with the following API
View.DrawingCurves(OModel as Object)
I am facing this Interop error in Visual Basic, while using Inventor 2024 DLL.
I have attached the screenshots of all the errors here with, also attaching my code snippet.
Public Overridable Function GetGrooveCurvePoint(iGrooveNo As Integer) As Point2d
Try
Dim onumer As DrawingCurvesEnumerator = Nothing
Dim oCurveLeft As DrawingCurve
Dim dRefXMin As Double = 1000
'onumer = oViewSection.DrawingCurves(oIptDoc.ComponentDefinition.Features(GlobalCADRes.strGroove + " " & iGrooveNo))
Dim oFeature As Object = CType(oIptDoc.ComponentDefinition.Features(GlobalCADRes.strGroove & " " & iGrooveNo), Object)
onumer = oViewSection.DrawingCurves(oFeature)
'Get the Longest Curve of groove
For Each oDrawCurve As DrawingCurve In onumer
If oDrawCurve.StartPoint.X > oViewSection.Center.X And oDrawCurve.EndPoint.X > oViewSection.Center.X Then
If Math.Round(oDrawCurve.StartPoint.X, 2) = Math.Round(oDrawCurve.EndPoint.X, 2) Then
'If Math.Round(oDrawCurve.StartPoint.Y, 2) <> Math.Round(oDrawCurve.EndPoint.Y, 2) Then ''''change by Nilesh for 69769 on 29/09/11
If oDrawCurve.EndPoint.X < dRefXMin Then
dRefXMin = oDrawCurve.EndPoint.X
oCurveLeft = oDrawCurve
'End If
End If
End If
End If
Next
If oCurveLeft IsNot Nothing Then
If oCurveLeft.StartPoint.X > oCurveLeft.EndPoint.X Then
Return oCurveLeft.StartPoint
Else
Return oCurveLeft.EndPoint
End If
End If
Return Nothing
Catch ex As Exception
End Try
End Function