Setting Properties Via Python Node

Good morning,

I feel like what I am trying to do is very simple but I cannot find anywhere describing how to set a property using a python script in dynamo. Or I just don’t know what I am looking. I can return the value of the property I want but I don’t know what to type in to change the value. Below is the python code that lets me return the value. Any help would be appreciated.

import clr
import Autodesk
from Autodesk.Revit.DB import FabricationPart
from Autodesk.Revit.DB import FabricationAncillaryUsage

import Revit

import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

Inpt = UnwrapElement(IN[0])
Cnt = UnwrapElement(IN[1]) 

HngRdKt = ()
Out1 = []

Doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

if Cnt > 1:
	for e in Inpt:
		HngRdKt = e.HangerRodKit
	HngRdKt = Inpt.HangerRodKit

OUT = Out1

The below snapshot shows the property I would like to change. The Revit API docs says that it has a get and set method but I don’t know how to set it.

e.HangerRodKit = 1 # assigning the value 1 to the parameter

Can´t try anything myself atm, but that should do it since the parameter can just be set.

That’s it. Appreciate it.

1 Like