I’m trying to set some of my schedule fields to be hidden using the IsHidden property (link) I found on RevitAPIDocs. Seems pretty straight forward but something seems to be going over my head.
I’ve tried getting and setting the property but everything returns the same warning. Am I missing a reference? Gotta be something simple.
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('DSCoreNodes')
from DSCore import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
from Revit.Elements import *
clr.AddReference('System')
from System.Collections.Generic import *
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
param = UnwrapElement(IN[0])
#TransactionManager.Instance.EnsureInTransaction(doc)
param.IsHidden = True
#TransactionManager.Instance.TransactionTaskDone()
#Assign your output to the OUT variable.
OUT = 0
Thanks @Kulkul!
Is there a difference between using the ScheduleField object I used and the one pulled directly from the schedule definition? This was the direction I was about to go.
EDIT: Must be. It looks like ScheduleField object from Dynamo isn’t unwrapping properly.
I just got the schedule view from the Views node and used the ScheduleFields node to get it’s list of fields. Then input one (or many) of the fields into my python code.
This script works great for a single schedule, but how can it be adapted to accept a list of applicable schedules that require a common column to be hidden?