我正在尝试从布管系统配置中获取接头类型/配件。我已经能够在布管系统配置中设置所有其他配件,但我不知道如何获得接头配件。任何人都有这方面的经验。
- using (var tr = db.TransactionManager.StartTransaction())
- {
- var modelSpace = db.ModelSpace(OpenMode.ForWrite);
- var dict = new DictionaryPipePartRoutingPreferencesStyle(db);
- var rp = dict.Records.Cast()
- .Select(r => (PipePartRoutingPreferencesStyle) tr.GetObject(r, OpenMode.ForRead))
- .FirstOrDefault(p => p.Name == "Butt Welded");
- if (rp == null)
- return;
- // This doesn't return the joint type
- ConnectionType jointConnType;
- rp.GetJointConnectionType(2.0, out jointConnType);
- Type jointType;
- rp.GetJointObjectType(2.0, out jointType);
- var x = rp.FindPartGuid(BuiltInShape.Circular, BuiltInShape.Circular, BuiltInShape.Circular,
- BuiltInShape.Circular, jointConnType, jointConnType, jointConnType, jointConnType, jointType, false,
- 2.0);
- //These don't return the joint type
- var couplingId = rp.FindPartGuid(jointType, 2.0);
- couplingId = rp.FindPartGuid(Type.Coupling, 2.0);
- //All these work as expected
- var cross = rp.FindPartGuid(Type.Cross, 2.0);
- var elbowId = rp.FindPartGuid(Type.Elbow, 2.0);
- var flex = rp.FindPartGuid(Type.PipeFlex, 2.0);
- var lateral = rp.FindPartGuid(Type.Lateral, 2.0);
- var pipeId = rp.FindPartGuid(Type.Pipe, 2.0);
- var takeoff = rp.FindPartGuid(Type.Takeoff, 2.0);
- var tee = rp.FindPartGuid(Type.Tee, 2.0);
- var wye = rp.FindPartGuid(Type.Wye, 2.0);
- var concentric = rp.FindPartGuid(Type.Transition, 2.0);
- var eccentric = rp.FindEccentricPartGuid(Type.Transition, true, 2.0);
- tr.Commit();
- }
本帖以下内容被隐藏保护;需要你回复后,才能看到! 游客,如果您要查看本帖隐藏内容请 回复 |