Referencing DWG controls in Web pages, interacting with drawings, and responding to mouse clicks on objects
[Mxdraw CAD Control Document]
The complete example of the following help is in the sample\ie\iedemo.htm of the control installation directory.
- The main use of the function description
A. Implementcommandeventfun
The control's command event function, which interacts with the user, needs to be implemented within the command event function so that the control can ensure that the normal Windows message loop is processed.
B. Implementmouseeventfun
Control mouse Event function, you can use the JS program, in response to mouse events, detailed description as follows:
void MouseEvent (Long lType, double DX, double DY, long lret);
LONG LType Event Type, 1 mouse movement, 2 is the left mouse button press, 3 is the right mouse button press, 4 is the left mouse button double-click 5 is the left mouse button to release 6 is the right mouse button release 7 is the mouse button is the middle key to release 8 is the mouse button in the middle mouse button double Click 9 is the middle mouse button scrolling
DOUBLE DX event occurs when the x-coordinate of the mouse, document coordinates
DOUBLE DY the mouse y-coordinate when the event occurs, document coordinates
LONG lret Lret returns non 0, message will not be passed down
C. DrawLine
Used to draw a straight line on a DWG diagram, as described in detail below:
Parameter description
DOUBLE dX1 The start point x coordinate of the line
DOUBLE dY1 The start point y-coordinate of a line
DOUBLE dX2 The end point x coordinate of the line
DOUBLE dY2 The end point y-coordinate of a line
D. Imxdrawselectionset::selectatpoint2
Returns the entity object under a point coordinate, you can set the filter condition, return the object of a layer, a property of a certain type.
- JS Implementation code Description
A. Referencing controls in a Web page,
Clsid:74a777f8-7a8f-4e7c-af47-7074828086e2 is the GUID of the control.
The control program can be made into a cab installation package, and data can be signed to facilitate automatic installation of downloads in the Web page.
Detailed reference Example: http://www.mxdraw.com/iedemo.html
<objectclassid= "Clsid:74a777f8-7a8f-4e7c-af47-7074828086e2" id= "Mxdrawxctrl" codebase= "http://www.mxdraw.com/ mxdrawx.cab#version=1,0,0,1 "width=100% height=90%>
<paramname= "_version" value= "65536" >
<paramname= "_extentx" value= "24262" >
<paramname= "_extenty" value= "16219" >
<paramname= "_stockprops" value= "0" >