Message 1 of 3
Label for ElectricalSystemType
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
To get the Category name for the current language I usually use something like this.
Category.GetCategory(document, BuiltInCategory.OST_ElectricalCircuit).Name;
To get the name for BuiltInParameter I could use LabelUtils.
I wonder if is possible to get the label of the ElectricalSystemType enum.
public enum ElectricalSystemType
{
UndefinedSystemType = 0,
Data = 5,
PowerCircuit = 6,
Telephone = 9,
Security = 10,
FireAlarm = 11,
NurseCall = 12,
Controls = 13,
Communication = 14,
PowerBalanced = 30,
PowerUnBalanced = 31
}
I know if I have an ElectricalSystem created in my project I could get the name of the SystemType using the BuiltInParameter.RBS_ELEC_CIRCUIT_TYPE and getting the AsValueString like the example below.
public string GetSystemName(ElectricalSystem electricalSystem)
{
if (electricalSystem.get_Parameter(BuiltInParameter.RBS_ELEC_CIRCUIT_TYPE) is Parameter parameter)
{
return parameter.AsValueString();
}
return electricalSystem.SystemType.ToString();
}
This gets the name of the SystemType on the current Revit language.
That's what I need, but using ElectricalSystemType enum without any ElectricalSystem.
I don't know if is possible, does anyone knows how!?