Distinguishing Cabletray Fittings

Distinguishing Cabletray Fittings

pbobz
Contributor Contributor
1,790 Views
7 Replies
Message 1 of 8

Distinguishing Cabletray Fittings

pbobz
Contributor
Contributor

 

Hi,

 

I'm looking for a way to distinguish cabletray fittings... T junctions from Vertical Inside from a Vertical Outside and so on...

I search into many parameters without success. I found a way getting the element's Symbol->Family->Parameters-> "Element Type", it distinguish fittings but not vertical inside from outside...

 

If you have any idea about doing that.

 

Cheers

0 Likes
1,791 Views
7 Replies
Replies (7)
Message 2 of 8

jeremytammik
Autodesk
Autodesk

I think you need to continue collecting various distinguishing characteristics and developing ever finer differentiation tools yourself. You may glean some ideas from several The Building Coder discussions on distinguishing various MEP fitting types:

 

http://thebuildingcoder.typepad.com/blog/2016/02/ifc-import-levels-and-mep-element-shapes.html#3

 

I hope this helps.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 8

pbobz
Contributor
Contributor

Thanks for the tip,

 

I was secretly hopping for some kind of enum of all fittings, but it looks like there's nothing more than:

 

FamilyInstance > Symbol > Family > Parameter > BuiltInParameter.FAMILY_CONTENT_PART_TYPE

 

to get the Part type. This, actually, do not distinguish for example a Ladder Vertical Elbow  inside (Part type 44) from an vertical outside (also part 44) but I'll find a way to recognize them.

 

Regards

0 Likes
Message 4 of 8

jeremytammik
Autodesk
Autodesk

Yes, for sure.

 

They are curve based elements. Retrieve the curve and analyse that.

 

They have connectors. Retrieve the connectors and analyse their locations and directions.

 

They have parameters. Retrieve the parameters and analyse them.

 

Please let us know how you end up solving this.

 

Thank you!

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 5 of 8

pbobz
Contributor
Contributor

Hi Jeremy,

 

As Parameters, Connectors and curves are the same. The only solution to distinguish one from the other is by checking the position of sweeps inside the family. I'm not familiar with sweeps but it seems there's no offsets (vertical or horizontal offsets in parameters are 0.0 in both cases) .

 

Keep digging. 🙂

 

(PS: In the mean time, I'm shamefully using a string.contains in different languages to find "inside" and "outside" variations in the family name. That's of course temporary 🙂

 

OutsideOutsideInsideInside

0 Likes
Message 6 of 8

jeremytammik
Autodesk
Autodesk

Can't you use the connector direction to distinguish between these two?

 

In one case, they are both horizontal, and the Z component is zero.

 

In the other, one of the Z components is non-zero.

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 7 of 8

pbobz
Contributor
Contributor

 

Connectors are the same (don't take my screenshot as an orientation information, I just turn the view to show the sweep being outside). But, actually, vertical outside and vertical inside elbows are exactly the same. The only difference I found was the sweep position along the curve.

Wish the Part ID were different 😛

 

 

0 Likes
Message 8 of 8

marslandp
Explorer
Explorer

Hi

 

Did you ever find a way of efficiently determining the inside from outside bends?


I have the same problem and have quickly solved it by creating a list of all the family type Ids for all the inside bends.

 

All I then do is check if the name of each "Vertical Ladder Elbow" type exists in the list, if it does its an inside bend if it doesn't it must be outside.


List<ElementId> insideBendIds = new List<ElementId>();
FilteredElementCollector typeCollector = new FilteredElementCollector(_doc).OfCategory(BuiltInCategory.OST_CableTray);
ICollection<ElementId> typeIds = typeCollector.ToElementIds();
foreach(ElementId typeId in typeIds)
{
     Element e = _doc.GetElement(typeId);
     Parameter p = e.get_Parameter(BuiltInParameter.RBS_CURVETYPE_DEFAULT_ELBOWUP_PARAM);
     if(p != null)
     {
          if(p.StorageType == StorageType.ElementId)
          {
               insideBendIds.Add(p.AsElementId());
          }
     }
}

 

 

The check code is:

 

if(insideBendIds.Contains(fi.GetTypeId()))
{
     cType = "Ladder Inside Elbow";
}
else
{
     cType = "Ladder Outside Elbow";
}

0 Likes