- 积分
- 4975
- 明经币
- 个
- 注册时间
- 2007-9-25
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
本帖最后由 pxt2001 于 2022-8-17 19:00 编辑
请问:C#可以定义CAD透明命令吗?例如在定义了Tb平移视图命令,但是不能透明执行,请问如何才能透明执行?
- <font size="3"><font size="4">[CommandMethod("Tb")] //向右平移视图
- public static void TestPoint2()
- {
- Database db = HostApplicationServices.WorkingDatabase;
- Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
- ViewTableRecord view = ed.GetCurrentView();
- Point2d pc2 = view.CenterPoint;
- Point3d pc0 = new Point3d(pc2.X, pc2.Y, 0);
- double wid = view.Width;
- double high = view.Height;
- Point3d Pc = new Point3d((pc0.X - high), pc0.Y, 0);
- view.CenterPoint = new Point2d(Pc.X, Pc.Y);
- //更新当前视图
- ed.SetCurrentView(view);
- }</font></font>
复制代码 |
|