明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2076|回复: 6

[基础] 求如何得到CAD里现在的光标位置

[复制链接]
发表于 2013-12-25 13:41 | 显示全部楼层 |阅读模式
如何得到CAD里现在的光标位置?看了论坛里有动态得到光标位置,但要结束那个程序必有按下左键,我只想返回一下CAD光标的的坐标,希望各位老师指导一下
发表于 2013-12-25 14:04 | 显示全部楼层
(cadr(grread T 15 2))
发表于 2013-12-25 16:27 | 显示全部楼层
1,PointMonitor
2,Jig
3,API
 楼主| 发表于 2014-1-15 13:51 | 显示全部楼层
求高手给个示例代码
发表于 2014-1-15 16:28 | 显示全部楼层
using aApp = Autodesk.AutoCAD.ApplicationServices.Application;

aApp.DocumentManager.MdiActiveDocument.Editor.PointMonitor += new PointMonitorEventHandler(ed_PointMonitor);

    void ed_PointMonitor(object sender, PointMonitorEventArgs e)
    {
//e.Context 里面有一大堆点,你用 e.Context.ComputedPoint 吧
    }

点评

e.Context.ComputedPoint是捕捉的点,和光标所在的点有一小点距离的  发表于 2014-8-7 16:50
发表于 2014-1-15 18:01 | 显示全部楼层
楼上正解,我也准备说Editor.PointMonitor事件
发表于 2014-1-26 16:59 | 显示全部楼层
也可以使用Application.PreTranslateMessage捕获任何你感兴趣的事件
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-17 13:45 , Processed in 0.317324 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表