How to get the location of mouse point?

Discuss and ask questions about CADEditorX and XML API.

Moderators: admin, support, SDS

How to get the location of mouse point?

Postby agvs » 28 Oct 2016, 06: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: 30
Joined: 16 Jun 2016, 09:10

Re: How to get the location of mouse point?

Postby support » 28 Oct 2016, 19: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:
Posts: 2754
Joined: 30 Mar 2005, 08:36

Return to CADEditorX

Who is online

Users browsing this forum: No registered users and 1 guest