Label for ElectricalSystemType

Label for ElectricalSystemType

ricaun
Advisor Advisor
426 Views
2 Replies
Message 1 of 3

Label for ElectricalSystemType

ricaun
Advisor
Advisor

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!?

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

427 Views
2 Replies
Replies (2)
Message 2 of 3

RPTHOMAS108
Mentor
Mentor

I don't see a utility for that.

 

If it were my task and I can't find such a method I'd create one of each system in a model and open it in the different language versions to extract the values in order to build my own label utility.

 

Use Revit in Other Languages | Revit 2022 | Autodesk Knowledge Network

 

There are only ten items listed but quite a few numbers missing (good job you don't have to create 31 system types). I don't know the history of that (if rationalisation has taken place or they are reserved perhaps).

0 Likes
Message 3 of 3

ricaun
Advisor
Advisor

Probably not gonna track all the names on each language, by default gonna show the enum name with space.

 

I'm developing a plugin to add a prefix/abbreviation in front of Communication circuits, does not exist a classification for Telephone, Security, Fire Alarm... etc. So I'm using the system type of electrical circuit.

 

CircuitNameCapturar.PNG

That's why I want a user-friendly name for this system type, with the language and so on.

 

😃

 

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

0 Likes