明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 6943|回复: 12

[事件] 动态获取鼠标经过点的三维坐标

  [复制链接]
发表于 2009-6-2 23:27 | 显示全部楼层 |阅读模式

如果通过VB.NET来实现动态获取鼠标经过点的三维坐标呀?

谢谢

发表于 2009-6-2 23:28 | 显示全部楼层

Jig不行么?

你要实现什么功能,说清楚点?

发表于 2009-6-3 10:59 | 显示全部楼层
Up,卢版主,他的意思是实时获得CAD主窗体里光标的空间三维坐标,这个用JIG肯定能实现的,不过我想把这个功能用VB.NET做成控件(用来替代ACADX.arx的相应功能),供VB6调用,好像因为不能直接生成Com控件,不知道版主大哥有啥好的建议没有?曲线救国也行啊
发表于 2009-6-3 11:23 | 显示全部楼层

老卢是ahlzl,:)

http://bbs.mjtd.com/forum.php?mod=viewthread&tid=75796

这里的

七、实现Com接口

试试?

 楼主| 发表于 2009-6-3 15:48 | 显示全部楼层

JIG??

可否具体讲一讲呀?谢谢了

发表于 2009-6-3 18:34 | 显示全部楼层
发表于 2009-6-3 21:49 | 显示全部楼层
  1. Imports Autodesk.AutoCAD.EditorInput
  2. Imports Autodesk.AutoCAD.Runtime
  3. Imports Autodesk.AutoCAD.ApplicationServices
  4. Imports Autodesk.AutoCAD.DatabaseServices
  5. Public Class Class1
  6.     <CommandMethod("test")> Public Sub test()
  7.         Dim Ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
  8.         AddHandler Ed.PointMonitor, New PointMonitorEventHandler(AddressOf Getpoint)
  9.     End Sub
  10.     Public Sub Getpoint(ByVal sender As Object, ByVal e As PointMonitorEventArgs)
  11.         Dim Ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
  12.         Ed.WriteMessage(vbNewLine & e.Context.ComputedPoint.X)
  13.         'RemoveHandler Ed.PointMonitor, AddressOf Getpoint
  14.     End Sub
  15. End Class
发表于 2009-6-3 21:51 | 显示全部楼层
  1. Imports Autodesk.AutoCAD.EditorInput
  2. Imports Autodesk.AutoCAD.Runtime
  3. Imports Autodesk.AutoCAD.ApplicationServices
  4. Imports Autodesk.AutoCAD.DatabaseServices
  5. Public Class Class1
  6.     <CommandMethod("test")> Public Sub test()
  7.         Dim Ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
  8.         AddHandler Ed.PointMonitor, New PointMonitorEventHandler(AddressOf Getpoint)
  9.     End Sub
  10.     Public Sub Getpoint(ByVal sender As Object, ByVal e As PointMonitorEventArgs)
  11.         Dim Ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
  12.         Ed.WriteMessage(vbNewLine & e.Context.RawPoint.X)
  13.         'RemoveHandler Ed.PointMonitor, AddressOf Getpoint
  14.     End Sub
  15. End Class
发表于 2009-6-3 22:05 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2009-6-3 23:08 | 显示全部楼层

向各位大侠学习,多多指教。。。

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-19 05:59 , Processed in 0.215202 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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