Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to distinguish between types of electrical equipment?

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
ltadachi
1050 Views, 4 Replies

how to distinguish between types of electrical equipment?

in a baptism by fire attempt to build a plugin that will support basic electrical systems analysis, i have not found the relevant method to distinguish within OST electrical equpment. 

 

native filtering for electrical equipment is very effective, but i cannot find the enumeration or parameter to sort by part type. 

 

I'm interested in filtering for panel board, transformers, motors, and distribution boards. 

 

I haven't figured it out yet. 

4 REPLIES 4
Message 2 of 5
ollikat
in reply to: ltadachi

Hi

 

Did you check out the family parameter "FAMILY_CONTENT_PART_TYPE". Value in this parameter can be compared with Autodesk.Revit.DB.PartType enumeration values. Available values for electrical equipment seems to be PanelBoard, Transformer, SwitchBoard, OtherPanel, EquipmentSwitch.


Hope this helps.

Message 3 of 5
ltadachi
in reply to: ollikat

Well done sir.

I was looking in the wrong place for part type parameter. i incorrectly conjured that it would be under electrical equipment enumerations. not family content.
Message 4 of 5
Revmzk
in reply to: ltadachi

What would be the correct syntax to use the enumeration in a comparison to validate this parameter value rather than the integer value? 

FamilyInstance pcequip = e as FamilyInstance;
Parameter famconptyp = pcequip.Symbol.Family.get_Parameter(BuiltInParameter.FAMILY_CONTENT_PART_TYPE);

if (famconptyp.AsInteger() == 15) //I know there should be some way to use the PartType.Transformer enumerated type

                                                            //in this comparison instead of the integer value to check if the FamilyInstance is a                                                                 //Transformer

Message 5 of 5
Revitalizer
in reply to: Revmzk

Hi,

 

here you are:

https://forums.autodesk.com/t5/revit-api-forum/how-to-get-parttype-of-cabletray-fitting-or-conduit-f...

 

Just cast the integer value into the enum value:

 

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





Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community