Author Topic: Get the coordinates of an osnap glyph?  (Read 2016 times)

0 Members and 1 Guest are viewing this topic.

gablackburn

  • Guest
Get the coordinates of an osnap glyph?
« on: August 22, 2011, 05:27:02 PM »
I've Googled and searched these forums for this, but have come up with nothing so far.

I'm using VB.NET and would like to find out if there's a way to record the coordinates of an osnap glyph when it lights up. 

I'm drawing a jig line and would like my jigline/dragline to jump from my crosshairs to the ENDpoint of a particular line when the endpoint glyph lights up.  If I can get those coordinates, I can get this to work.

I feel like ObjectSnapInfo may have something to do with it, but I keep getting Fatal Errors whenever I try anything with it.

Thanks in advance.
GA Blackburn

kaefer

  • Guest
Re: Get the coordinates of an osnap glyph?
« Reply #1 on: August 23, 2011, 05:01:35 AM »
I'm using VB.NET and would like to find out if there's a way to record the coordinates of an osnap glyph when it lights up.

No takers? You could wrap your point acquisition in a PointMonitor or PointFilter event handler and
- check the InputPointContext.History for the PointHistoryBits.ObjectSnapped bit, and
- check the InputPointContext.ObjectSnapMask for the ObjectSnapMasks.End bit, and
- if both are set, InputPointContext.ComputedPoint.contains your point.

Quote
I'm drawing a jig line and would like my jigline/dragline to jump from my crosshairs to the ENDpoint of a particular line when the endpoint glyph lights up.  If I can get those coordinates, I can get this to work.

Here I'm not sure if I can follow you. You shouldn't mess with the coordinates of the input device, lest the user experiences unexpected behaviour. The usual way would be to leave the crosshairs alone and return the snap point only if it is selected.

Quote
I feel like ObjectSnapInfo may have something to do with it, but I keep getting Fatal Errors whenever I try anything with it.

I think that's for custom osnap. But it may work for you too. There's an example over at Kean's.

gablackburn

  • Guest
Re: Get the coordinates of an osnap glyph?
« Reply #2 on: August 23, 2011, 09:40:32 AM »
Quote
You could wrap your point acquisition in a PointMonitor or PointFilter event handler and
- check the InputPointContext.History for the PointHistoryBits.ObjectSnapped bit, and
- check the InputPointContext.ObjectSnapMask for the ObjectSnapMasks.End bit, and
- if both are set, InputPointContext.ComputedPoint.contains your point.

Thanks for the help kaefer, I will start looking into InputPointContext and give it a shot...