乐筑天下

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

AutoCAD ACA/MEP路由偏好耦合

[复制链接]

24

主题

204

帖子

6

银币

后起之秀

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

铜币
300
发表于 2015-6-16 07:43:19 | 显示全部楼层 |阅读模式
我正在尝试从布管系统配置中获取接头类型/配件。我已经能够在布管系统配置中设置所有其他配件,但我不知道如何获得接头配件。任何人都有这方面的经验。
  1. using (var tr = db.TransactionManager.StartTransaction())
  2.             {
  3.                 var modelSpace = db.ModelSpace(OpenMode.ForWrite);
  4.                 var dict = new DictionaryPipePartRoutingPreferencesStyle(db);
  5.                 var rp = dict.Records.Cast()
  6.                     .Select(r => (PipePartRoutingPreferencesStyle) tr.GetObject(r, OpenMode.ForRead))
  7.                     .FirstOrDefault(p => p.Name == "Butt Welded");
  8.                 if (rp == null)
  9.                     return;
  10.                 // This doesn't return the joint type
  11.                 ConnectionType jointConnType;
  12.                 rp.GetJointConnectionType(2.0, out jointConnType);
  13.                 Type jointType;
  14.                 rp.GetJointObjectType(2.0, out jointType);
  15.                 var x = rp.FindPartGuid(BuiltInShape.Circular, BuiltInShape.Circular, BuiltInShape.Circular,
  16.                     BuiltInShape.Circular, jointConnType, jointConnType, jointConnType, jointConnType, jointType, false,
  17.                     2.0);
  18.                 //These don't return the joint type
  19.                 var couplingId = rp.FindPartGuid(jointType, 2.0);
  20.                 couplingId = rp.FindPartGuid(Type.Coupling, 2.0);
  21.                 //All these work as expected
  22.                 var cross = rp.FindPartGuid(Type.Cross, 2.0);
  23.                 var elbowId = rp.FindPartGuid(Type.Elbow, 2.0);
  24.                 var flex = rp.FindPartGuid(Type.PipeFlex, 2.0);
  25.                 var lateral = rp.FindPartGuid(Type.Lateral, 2.0);
  26.                 var pipeId = rp.FindPartGuid(Type.Pipe, 2.0);
  27.                 var takeoff = rp.FindPartGuid(Type.Takeoff, 2.0);
  28.                 var tee = rp.FindPartGuid(Type.Tee, 2.0);
  29.                 var wye = rp.FindPartGuid(Type.Wye, 2.0);
  30.                 var concentric = rp.FindPartGuid(Type.Transition, 2.0);
  31.                 var eccentric = rp.FindEccentricPartGuid(Type.Transition, true, 2.0);
  32.                 tr.Commit();
  33.             }

本帖以下内容被隐藏保护;需要你回复后,才能看到!

游客,如果您要查看本帖隐藏内容请回复
回复

使用道具 举报

24

主题

204

帖子

6

银币

后起之秀

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

铜币
300
发表于 2015-6-16 10:57:50 | 显示全部楼层
我明白了。这是我的错。我使用了一种类型的路由首选项,其中接头为空。当我将接头类型更改为对接焊以外的任何内容时,
  1. rp.FindPartGuid(Type.Coupling, 2.0)

就像您所期望的那样工作。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-2-5 00:43 , Processed in 0.243308 second(s), 56 queries .

© 2020-2025 乐筑天下

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