How to get the location of mouse point?

Discuss and ask questions about CADEditorX and XML API.

Moderators: admin, support, SDS

Post Reply
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.

Posts: 2834
Joined: 30 Mar 2005, 11:36

Re: How to get the location of mouse point?

Post by support » 28 Oct 2016, 21:11


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"/>
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">
    <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"/>
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.

Technical Support E-mail:
Chat support on Skype:

Post Reply