找回密码
 立即注册
查看: 1845|回复: 0

[分享] Using OSnap functionality during a Jig in .Net

[复制链接]
发表于 2013-5-27 21:15:08 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
Using OSnap functionality during a Jig in .Net                                                        By Philippe Leefsma
  Q:
  I would like to take advantage of my OSNAP settings while jigging my entity, so it looks like it sticks to the closest snapped point while user is still moving the cursor.
  I was trying to use some of the Editor selection methods, but it doesn't seem to work.
  
  A:
  The Editor functionalities such as selections cannot be performed while the jig is running.
  A solution to implement this requirement is to set the osnap options before starting the jig, to “End Point” for example. That can be done programmatically as well using the OSMODE system variable. Then inside your jig use a PointMonitor to get the snapped point.
  Here is an example of my Jig class that illustrates that. A full sample is available as attachment:
class CoSnapJig : EntityJig { private Point3d _previousPos; private Point3d _position; private Editor _ed; public CoSnapJig(): base(new DBText()) { _ed = Application.DocumentManager.MdiActiveDocument.Editor; DBText dbTxt = (DBText)Entity; dbTxt.TextString = "Jigged DBText"; _ed.PointMonitor += new PointMonitorEventHandler(ed_PointMonitor); } void ed_PointMonitor(object sender, PointMonitorEventArgs e) { _position = e.Context.ComputedPoint; } public new Entity Entity { get
展开
osnapjig.zip

论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2026-12-1 22:44 , Processed in 0.178719 second(s), 28 queries , Gzip On.

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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