乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 95|回复: 5

Question: samples\entity\hilight_dg of SDK2009

[复制链接]

46

主题

261

帖子

8

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
445
发表于 2008-6-14 05:41:02 | 显示全部楼层 |阅读模式
if visualstyle is "2dWireframe" ,OK!
but isn't, Select edge might fail!
回复

使用道具 举报

69

主题

875

帖子

15

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1146
发表于 2008-6-14 21:14:29 | 显示全部楼层
Do you have a little more information for us ahlzl?
If I get want you mean, when 'picking' objects on the screen you are actually picking pixels which are traced back to their owners that draw them such as a line, edge or face. If it's not 2d wire frame (all lines/edges) it becomes very hard to determine an edge when the whole face is rendered as the edge is also rendered, if that makes sense.
回复

使用道具 举报

46

主题

261

帖子

8

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
445
发表于 2008-6-14 22:08:33 | 显示全部楼层
thank you, MickD .
but use AutoCAD command ——"solidedit", Select edge success 100% in any visualstyle !!!
How modify SDK's code?
thanks
回复

使用道具 举报

69

主题

875

帖子

15

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1146
发表于 2008-6-14 23:06:58 | 显示全部楼层
Ok, when using the acad command it highlights the edges yes? This allows you to be able to pick the isolated highlighted edge. In you code you need highlight the object, have a look at 'highlighting' in the help doc's, you may also need to catch the mouse over event or similar to imitate how autocad does this without actually picking an object.
Do you have any code so far we might be able to help you with?
回复

使用道具 举报

46

主题

261

帖子

8

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
445
发表于 2008-6-14 23:45:32 | 显示全部楼层
thanks again !
I write C# code, also fail !
  1. using Autodesk.AutoCAD.ApplicationServices;
  2. using Autodesk.AutoCAD.Colors;
  3. using Autodesk.AutoCAD.DatabaseServices;
  4. using Autodesk.AutoCAD.EditorInput;
  5. using Autodesk.AutoCAD.Geometry;
  6. using Autodesk.AutoCAD.Runtime;
  7. namespace ABC
  8. {
  9.     public class Class1
  10.     {
  11.         [CommandMethod("test")]
  12.         public void MyTest()
  13.         {
  14.             Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
  15.             Database db = HostApplicationServices.WorkingDatabase;
  16.             using (Transaction trans = db.TransactionManager.StartTransaction())
  17.             {
  18.                 TypedValue value = new TypedValue((int)DxfCode.Start, "3DSOLID");
  19.                 TypedValue[] values = { value };
  20.                 SelectionFilter sfilter = new SelectionFilter(values);
  21.                 PromptSelectionOptions opt = new PromptSelectionOptions();
  22.                 opt.SingleOnly = true;
  23.                 PromptSelectionResult res = ed.GetSelection(opt, sfilter);
  24.                 if (res.Status != PromptStatus.OK)
  25.                 {
  26.                     return;
  27.                 }
  28.                 SelectionSet ss = res.Value;
  29.                 ObjectId objId = ss[0].ObjectId;
  30.                 Solid3d ent = (Solid3d)trans.GetObject(objId, OpenMode.ForWrite);
  31.                 int marker = ss[0].GraphicsSystemMarker;
  32.                 Matrix3d xform = Matrix3d.Identity;
  33.                 Point3d pickPoint = new Point3d(0, 0, 0);
  34.                 FullSubentityPath[] pathes;
  35.                 try
  36.                 {
  37.                     pathes = ent.GetSubentityPathsAtGraphicsMarker
  38.                         (SubentityType.Edge, marker, pickPoint, xform, 0, null);
  39.                 }
  40.                 catch (System.Exception e)
  41.                 {
  42.                     ed.WriteMessage("\n" + e.Message);
  43.                     return;
  44.                 }
  45.                 ent.Highlight(pathes[0], false);
  46.                 ed.GetString("\nEnter...");
  47.                 ent.Unhighlight(pathes[0], false);
  48.                 Color myColor = Color.FromColorIndex(ColorMethod.ByColor, 1);
  49.                 SubentityId edgeId = pathes[0].SubentId;
  50.                 ent.SetSubentityColor(edgeId, myColor);
  51.                 trans.Commit();
  52.             }
  53.         }
  54.     }
  55. }

I declare fail, and wait  MickD、 Daniel、 other man
回复

使用道具 举报

46

主题

261

帖子

8

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
445
发表于 2008-6-15 12:44:06 | 显示全部楼层
I tried your routine. It does seem like a bug.  You might post it at the Autodesk Discussion Groups to see if anyone has an alternative method. Sorry I couldn’t be of much help
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-2-6 06:45 , Processed in 0.270114 second(s), 64 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表