All my titleblock instances have these parameters.
Here is some code, the commented stuff below wasn’t helpful, specifically using lookup for ‘Key Plan’. This parameter is a boolean, custom for ttb. If false, then key plan turns off, and if on, it turns on.
import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitServices')
from Autodesk.Revit.DB import *
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
element_id_value = 377319
#uses an imported variable
element_id = ElementId(element_id_value)
#needs the doc's methods
element = doc.GetElement(element_id)
#In Snoop, we found that this parameter's storage type is string, so we strung it at end.
pe2 = element.get_Parameter(BuiltInParameter.SHEET_APPROVED_BY).AsString()
# OUT = element.LookupParameter('KeyPlan')
# OUT = doc.GetElement(element.GetTypeId())
What I want to do with this python Node code is the following to test that I can do this in Python, proof of concept.
- List of titleblocks
- search each titleblock instance for a parameter called ‘Key Plan’
- Set it to false.
I’ve done it with Dynamo’s nodes
Why I turned to Python is because I couldn’t figure out how to do the following:
Instead of feeding one parameter to set, want to set multiple parameters per element.
Any help is appreciated.