Get system type of pipe

Hi,

I struggle to get the System Type of pipes. A pipe will have three related values in this context:

  1. System Type Name, e.g. “Raw water”
  2. System classification, e.g. “Domestic cold water”
  3. A unique name consisting of system type name + integer, e.g. “Raw water 1”

I want the first value. I am able to get the other two by following code:

e.MEPSystem.Name      # gives "Raw water 1"

pipingSystems = FilteredElementCollector(doc).OfClass(PipingSystemType).ToElements()
list_piping_system = [ ]
list_piping_system_id = [ ]

for i in pipingSystems:
	list_piping_system.append(i)
	list_piping_system_id.append(i.Id)

for k, sys in enumerate(list_piping_system_id):
	if sys = e.get_Parameter(BuiltInParameter.RBS_PIPING_SYSTEM_TYPE_PARAM).AsElementId():
		list_piping_system[k]       # gives an element with name "Raw water"

I’m currently using the dynamo node “Element.Name” to get the value “Raw water”, but I would like to to this in python. But if I add the attribute “.Name” after the element, I get an error saying “Attribute error: Name”

Hi,

Add .ToDSType(True) to your script.

doc.GetElement(e.get_Parameter(BuiltInParameter.RBS_PIPING_SYSTEM_TYPE_PARAM).AsElementId()).ToDSType(True).Name

2 Likes

Awesome, thanks!

Had to modify it slightly, though, here is the code that worked:

for k, sys in enumerate(list_piping_system_id):
	if sys = e.get_Parameter(BuiltInParameter.RBS_PIPING_SYSTEM_TYPE_PARAM).AsElementId():
		list_piping_system[k].ToDSType(True).Name
1 Like