How to change sub parameters of a parameter of a piping system

I came across the following post which was useful for me in changing the the piping system type name through the use of python coding here Renaming Piping/Duct Systems Type Names

But when I tried to change the Fluid Type parameter I found the parameter to be normally changed by a drop down selection, and therefore has sub parameters. They are the following


I wanted to change the last sub parameter, Fluid Type, but I found I couldn’t.
I used various nodes, each with there own characteristics but was unable to change the value.

I tried to alter the python code, but am out of my depth here, but maybe this is the best solution if you know what you are doing. Here’s my attempt.

import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *
import clr
clr.AddReference(‘RevitAPI’)
import Autodesk
from Autodesk.Revit.DB import *
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
FluidType = UnwrapElement(IN[0])
TypeName = IN[1]

TransactionManager.Instance.EnsureInTransaction(doc)
for i,j in zip(FluidType,TypeName):
i.TypeName = j
TransactionManager.Instance.TransactionTaskDone()

OUT = pipingsystemtype

Hi @r.lietz,

You must use the ElementId to set Fluid Type :

import clr
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

elements = UnwrapElement(IN[0]) if isinstance(IN[0],list) else [UnwrapElement(IN[0])]
fluid = UnwrapElement(IN[1])

TransactionManager.Instance.EnsureInTransaction(doc)
for elem in elements:
	elem.FluidType = fluid.Id
TransactionManager.Instance.TransactionTaskDone()

OUT = elements

I added a custom node to facilitate the process in the latest version of the Genius Loci package:


Set SystemType Parameters.dyn (19.6 KB)

2 Likes

1 Question - 1 Answer — Perfect !!

Mr de Chasteigner, your Honour, I have located a genius.

1 Like