The user can draw a straight line at an arbitrary position controls viewport.
The main use of Function:
_DMxDrawX::DrawLine
Draw a straight line. Details are as follows:
parameter | Explanation |
---|---|
DOUBLE dX1 |
X-coordinate of the starting point of the line |
DOUBLE dY1 |
Y coordinate of the start point of the line |
DOUBLE dX2 |
X coordinate of the end point of the line |
DOUBLE dY2 |
Y coordinate of the end point of the line |
IMxDrawCustomEntity::Draw
On the entity mapped to FIG. When generally used for dynamic drag, drag and drop at the end, to the drawing in FIG.
_DMxDrawXEvents::DynWorldDraw
Dynamic Draw event drag and drop. Details are as follows:
parameter | Explanation |
---|---|
DOUBLE dX |
X coordinate of the current mouse position |
DOUBLE dY |
Y coordinates of the current mouse position |
IDispatch* pWorldDraw |
IMxDrawWorldDraw objects for dynamically rendering |
IDispatch* pData |
IMxDrawCustomEntity objects, dynamic rendering data |
_DMxDrawX::DrawText
Draw a single line of text. Details are as follows:
parameter | Explanation |
---|---|
DOUBLE dPosX |
X coordinate of the position of the text |
DOUBLE dPosY |
Y coordinate position of the character |
BSTR pszText |
Text string |
Double dHeight |
Text height |
DOUBLE dRotation |
The angle of rotation of text |
SHORT horizontalMode |
Text horizontal alignment, 0 = kTextLeft, 1 = kTextCenter, 2 = kTextRight |
SHORT verticalMode |
Vertical alignment of the text, 1 = kTextBottom, 2 = kTextVertMid, 3 = kTextTop |
c # Code Description implemented:
Dynamic drag and drop drawing event:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
Dynamic draw a line:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
Show results:
Draw straight lines by clicking on the button, trigger DrawLine () event, the user can take the start line in any position CAD controls the viewport points, and then take the end point draw a straight line. As shown below: