CAD动态提示操作(com接口网页版)

夙愿已清 提交于 2019-12-10 15:19:53

鼠标移动到实体上后,停留一会,控件可能得到该实体对象,然后能动态提示一些信息。响应控件事件:DMxDrawXEvents::InputPointToolTipEvent,详细说明参考:http://www.mxdraw.com/help/MxDrawXLib___DMxDrawXEvents__InputPointToolTipEvent@IDispatch_@BSTR_.htm,调用函数SetDynToolTipPopTime设置动态提示时间。

1.  增加InputPointToolTipEvent事件响应函数:

document.getElementById("MxDrawXCtrl").ImpInputPointToolTipFun = DoInputPointToolTipFun;

2.  在事件中返回需要提示的字符串,在事件代码里,把对象类型名提示出来:

function DoInputPointToolTipFun(ent) {
 
    {
        var sClassName = ent.ObjectName;
 
        var tip = "<b><ct=0x0000FF><al_c>"+sClassName+
            "</b><br><ct=0x00AA00><hr=100%></ct><br>";
 
        mxOcx.SetEventRetString(tip);
    }
    ent = null;
    CollectGarbage();
}

动态提示效果如下:

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!