DISP_E_MEMBERNOTFOUND with Inventor.Point
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Platform: Visual Studio Professional 2017 (build just released today), Windows 10 16299 based (updated), Inventor 2018 latest release build. Autodesk Inventor.Interop (ver 22.2.0.0)
I'm getting a total twilight zone moment here. here is some code that runs fine, but when I set the value of the function to an empty variable (regardless of object type being "object" or "Inventor.Point" I get this error. "Member not found"
stack trace:
at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateSet(Object o, Type& objType, String name, Object[] args, String[] paramnames, Boolean OptimisticSet, CallType UseCallType)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateSet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean OptimisticSet, Boolean RValueBase, CallType CallType)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateSetComplex(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean OptimisticSet, Boolean RValueBase)
at TTSInventorTools.BatchDrawing.CreatePartDrawing() in C:\Code\Inventor\TTS Inventor Tools\TTSInventorTools\TTSInventorTools\BatchDrawing.vb:line 485
What is at line 485:
Dim pntCameraTarget As Object = FindMidPoint3D(Model.InvDoc.ComponentDefinition.RangeBox.MinPoint, Model.InvDoc.ComponentDefinition.RangeBox.MaxPoint)
What is FindMidPoint3D:
Public Function FindMidPoint3D(ByRef p1 As Point, ByRef p2 As Point) As Inventor.Point
Dim x As Double = FindMid(p1.X, p2.X)
Dim y As Double = FindMid(p1.Y, p2.Y)
Dim z As Double = FindMid(p1.Z, p2.Z)
Dim p As Inventor.Point = invApp.TransientGeometry.CreatePoint(x, y, z)
Return p
End Function
I followed this code all the way to return P, and everything is fine, and the point is created and it has an x,y,z values that are acceptable.
Then after it attempts to assign this "p" from FindMidPoint3D to pntCameraTarget (as Object or as Inventor.Point), I get the same error.
Please help me resolve this.