Page 1 of 1

How to get the location of mouse point?

Posted: 28 Oct 2016, 08:21
by agvs
I don’t know how to get the location of clicking(mouse).
It may use 'Point(,)'. But I don’t know exactly.
Let me know it.

Re: How to get the location of mouse point?

Posted: 28 Oct 2016, 21:11
by support
Hello,

To get the location of the mouse pointer, you should use the OnMouseDown event. Please note that this and other similar events don't have separate event members in AxSgCADEditor class, but use the common OnProcess member which returns the different event data through the OnProcess event handler.

The OnMouseDown event is disabled by default, if you want this event to be raised when clicking in the drawing area, you should enable it (or "sign to the event" in terms of CADEditorX) by processing the following XML command:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<cadsofttools version="2">
  <signtoevent Event="OnMouseDown" Enabled="True"/>
</cadsofttools>
Once the OnMouseDown event is occured, the OnProcess event handler returns the following XML data:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<cadsofttools version="2.0">
  <Results>
    <Result Instruction="OnMouseDown" Type="event" guid="{60170C89-54C9-455A-99C7-B775B03CED1F}">
      <Output Button="LBUTTON" X="334" Y="199" point="-1.00857050452783,-22.8609314359638" Shift="-494141432"/>
    </Result>
  </Results>
</cadsofttools>
In the given XML string, X and Y determine the on-screen point coordinates relative to the top-left corner of the drawing area, while point determines the location of the same point in CAD coordinates.


Mikhail