70001313 Get the Object Snap of a user action get point

Article 70001313
Type Wish
Product Engine
Version 7014
Date Added 4/11/2018 12:00:00 AM
Fixed 7.7015.0.2 (4/11/2018 12:00:00 AM)
Submitted by InspecVision

Summary

Get the Object Snap of a user action get point

Solution

It can be done by using the vdDocument.FilterActionPoint event
In version 7015.0.2 the vdDocument.FilterActionPoint event and VectorDraw.Actions.IBaseAction.CurrentOsnap property was also exported to be used with COM Wrapper interfaces.


Example C#:

doc.FilterActionPoint += new vdDocument.FilterActionPointEventHandler(doc_FilterActionPoint);
void doc_FilterActionPoint(object sender, object action, ref gPoint pt)
{
VectorDraw.Actions.IBaseAction baction = action as VectorDraw.Actions.IBaseAction;
OsnapPoint op = baction.CurrentOsnap;
if (op != null)
{
doc.Prompt("\r\n " + op.ObjectSnap.GetType().Name);
}
else
{
doc.Prompt("\r\n null");
}
doc.Prompt(null);
}





Example VB6 COM

Private WithEvents doc As VectorDraw_Professional.vdDocument

Private Sub doc_FilterActionPoint(ByVal sender As Object, ByVal action As Object, pt As VectorDraw_Geometry.IgPoint)
Dim baction As VectorDraw_Actions.BaseAction
Dim op As VectorDraw_Geometry.OsnapPoint
Set baction = action
Set op = baction.CurrentOsnap
If Not (op Is Nothing) Then
doc.Prompt Chr(13) & Chr(10) & op.ObjectSnap.ToString
doc.Prompt ""
Else
doc.Prompt Chr(13) & Chr(10) & " null"
doc.Prompt ""
End If
End Sub

Send comments on this topic.