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.
Solved! Go to Solution.
Solved by ollikat. Go to Solution.
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.
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
Hi,
here you are:
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