CAD drawing tag to your pages

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/u013725001/article/details/91360424

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

//循环

while(true)

{

    //新建一个COM组件对象 参数为COM组件类名

    var getPt = mxOcx.NewComObject("IMxDrawUiPrPoint");

    getPt.message = "点取绘制点";

    if(getPt.go() != 1)

    {

        return;

    }

    var frstPt = getPt.value();

    if(frstPt == null)

        return;

    //返回拾取矩形框的宽度,默认值为6

    var dLen = mxOcx.GetCursorPickRect();

    //视区长度到文档长度变换

    dLen = mxOcx.ViewLongToDocCoord(dLen);

    dLen *= 3.0;

    //绘制失量线

    //参数一为开始点X值;参数二为开始点Y值;参数三为结束点X值;参数四为结束点Y值;参数五为颜色

 

    mxOcx.DrawVectorLine(frstPt.x - dLen,frstPt.y - dLen,

        frstPt.x + dLen,frstPt.y + dLen,

        255

    );

    mxOcx.DrawVectorLine(frstPt.x - dLen,frstPt.y + dLen,

        frstPt.x + dLen,frstPt.y - dLen,

        255

    );

    //绘制失量圆

    //参数一为失量圆中心点X,文档坐标 ;参数二为失量圆中心点Y,文档坐标;参数三为失量圆半径,文档坐标;参数四为颜色

    mxOcx.DrawVectorCircle(frstPt.x,frstPt.y,

        dLen * 0.5, 65280);

    //更新当前控件的显示

    mxOcx.UpdateDisplay();

}

Guess you like

Origin blog.csdn.net/u013725001/article/details/91360424