c# 在cad里鼠标经过一个实体时获得该实体
www.dimcax.com
c# 在cad里鼠标经过一个实体时获得该实体
应该用什么事件来解决这个问题?才鸟大哥?
可以用editor的一个事件来取得: application.documentmanager.mdiactivedocument.editor.pointfilter += new pointfiltereventhandler(editor_pointfilter); static void editor_pointfilter(object sender, pointfiltereventargs e) { autodesk.autocad.editorinput.inputpointcontext context = e.context; fullsubentitypath[] path = context.getpickedentities(); if (path.length == 0) return; try { foreach (fullsubentitypath objpath in path) { objectid[] ids = objpath.getobjectids(); foreach (objectid objid in ids) { ..... } } } catch(system.exception exp) { displaystatus(exp.message); } }
搞定,感谢tommy