Message 1 of 7
Creating a sketchpoint reg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I am creating a sketchpoint at the end of a line using below
Dim oPoint0 As SketchPoint oPoint0 = ThisApplication.TransientGeometry.CreatePoint(oLine1.EndSketchPoint.Geometry.X, oLine1.EndSketchPoint.Geometry.Y)
I need to autoselect the sketchpoint later to run another part of the code
Dim StartingPoint As SketchPoint = oPoint0 Dim StartingPointSketch As PlanarSketch = StartingPoint.Parent Dim oRefPlane As WorkPlane = StartingPointSketch.PlanarEntity StartingPointOffset = ThisApplication.MeasureTools.GetMinimumDistance(StartingPointSketch.OriginPointGeometry, StartingPoint.Geometry3d) MessageBox.Show(StartingPointOffset)
I am getting the following error:
Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor.SketchPoint'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{8006A022-ECC4-11D4-8DE9-0010B541CAA8}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
What am I doing wrong ?