How to get the location of mouse point?

Discuss and ask questions about CADEditorX and XML API.

Moderators: SDS, support, admin

Post Reply
agvs
Posts: 30
Joined: 16 Jun 2016, 11:10

How to get the location of mouse point?

Post by agvs » 28 Oct 2016, 08:21

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.

support
Posts: 3271
Joined: 30 Mar 2005, 11:36
Contact:

Re: How to get the location of mouse point?

Post by support » 28 Oct 2016, 21:11

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
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply