CAD entity to set a hyperlink (Web version)

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

Set dynamic objects prompt event callback function.

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

//设置对象动态提示事件回调函数

function DoInputPointToolTipFun(ent) {

    var sHyperlinks = ent.Hyperlinks;

    if(sHyperlinks.length != 0)

    {

        var sClassName = ent.ObjectName;

 

        var tip = "<b><ct=0x0000FF><al_c>"+sClassName+

            "</b><br><ct=0x00AA00><hr=100%></ct><br><a=\"link\">" + sHyperlinks + "</a>";

        //设置用户自定义事件的结果返回值

        mxOcx.SetEventRetString(tip);

    }

    ent = null;

    CollectGarbage();

}

 

Setting a hyperlink is clicked entity event callback function.

 

1

2

3

4

5

6

function DoHyperlinkClickFun(ent, dX, dY) {

    //打开一个网址连接

    mxOcx.GotoURL(ent.Hyperlinks);

    //设置自定义事件的返回值

    mxOcx.SetEventRet(1);

}

 

Select the entity to set a hyperlink.

 

1

2

3

4

5

6

7

8

9

10

11

12

13

//新建一个COM组件对象

var selEnt = mxOcx.NewComObject("IMxDrawUiPrEntity");

selEnt.message = "选择要设置的对象";

if (selEnt.go() != 1)

    return;

//返回用户选择的实体

var ent = selEnt.Entity();

if (ent == null)

    return;

//设置超链接(用户可以设置所需链接)

ent.Hyperlinks = "www.cdtong.net";

//设置动态提示弹出时间,默认为1000.0毫秒

mxOcx.DynToolTipTime = 100;

 

related question

•  How to Draw a tag to your pages?

•  How to set the object grips display color?

•  how to get coordinate information pl line?

•  drawings inside How to print the page to add header and footer?

•  How to add a text style, and set the current text style, etc.

•  How to dynamically draw a straight line with a length of?

•  how to select a set point in the structure?

•  how dynamic draw polylines?

•  How to dynamically draw the spline?

•  how to draw a circle with a perimeter of the area?

Guess you like

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