Announcements

Announcement: We’re aware of an issue affecting starting a new topic from category pages and creating new blog posts. New topics can still be started directly from the relevant board. Learn more here.

How to get PartType of CableTray fitting or Conduit fitting

How to get PartType of CableTray fitting or Conduit fitting

jlpgy
Advocate Advocate
1,690 Views
2 Replies
Message 1 of 3

How to get PartType of CableTray fitting or Conduit fitting

jlpgy
Advocate
Advocate

Hi developers:

For MEP fitting elements, ther are all of type FamilyInstance.

I can access FamilyInstance.MEPModel property. For Duct and Pipe fittings, MEPModel is of type MechanicalFitting which has a property named as 'PartType'. But for CableTrya and Conduit fittings, MEPModel property is of type MEPModel, and it has not 'PartType'.

How can I determine the part type of a CableTray fitting or a Conduit fitting?

单身狗;代码狗;健身狗;[email protected]
0 Likes
Accepted solutions (1)
1,691 Views
2 Replies
Replies (2)
Message 2 of 3

Revitalizer
Advisor
Advisor
Accepted solution

Hi,

 

does this help?

 

Parameter partTypeParam = familyInstance.Symbol.Family.get_Parameter(BuiltInParameter.FAMILY_CONTENT_PART_TYPE);

if (partTypeParam != null)
{
	PartType partType = (PartType)partTypeParam.AsInteger(); // e.g. 13 = Connection, 7 = Transition
}

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 3 of 3

jlpgy
Advocate
Advocate

Yep!

It works!

Thanks a lot for your clear and sharp solution! Smiley Very Happy

单身狗;代码狗;健身狗;[email protected]
0 Likes