What is the use case. In AATK we use motion graphics and snap points, if you explain what your doing, I may be able to point you to a script that does something similar.
I want to make a better measurement tool which shows both at the same time mm and mils units. I also want to be able to measure parallel distance between object which are on 45 degrees.
I found the solution.
There is a hidden property called 'snaplocation'
Property SnapLocation(Event As EPcbEventTypeCmd, [button As EPcbMouseButton = epcbMouseButtonLeft]) As Boolean
Member of MGCPCB.Command
Snaps the location for the specified event when snapping is enabled. Only valid for the button down, button click, and mouse move events.
EPcbEventTypeCmd options are:
EPcbMouseButton options are:
To use this you need to register the command, attach it and then set this snaplocation to true.
In this example i used the epcbEventCmdOnMouseMove and the corresponding OnMouseMove event.
When the mouse moves the dX and dY variables use the snap location
'example on how to use snap location.
Set ccmd = app.Gui.RegisterCommand("my command", True)
Call Scripting.AttachEvents(ccmd, "ccmd")
Function ccmd_OnMouseMove(eButton, eFlags, dX, dY)
Call app.Gui.StatusBarText("x="& dX &" y=" & dY , epcbStatusField3)
It would have been nice to see this in the automation documentation.