Get Revit Title Cell Data

Does anyone know of a way to get data from a schedule title cell?

I’m using dynamo to export electrical element data to excel so they can be edited by a non-Revit user. We insert cells in the Revit schedule title to input schedule notes. I’m looking for a way to include the that specific cell in the data that I’m exporting to allow the non-Revit user to edit the schedule notes. I would then like to import that back into Revit. Does anyone know if this is possible?

try BimorphNodes package and archilab package, it should help you in that

I can’t seem to find a node that will get the title cells/rows. I can get at the headers and body rows but not title rows.

Use this link and combine it with the changes for the SectionType below and I think this may get you what you want:

TableData td = vs.GetTableData(); // get viewschedule table data
TableSectionData tsd = td.GetSectionData(SectionType.Header); // get header section data
string text = tsd.GetCellText(0, 0);
tsd.SetCellText(0, 0, "my new title");

Got it! Thanks for the references. I had to modify it a little bit to get the input and output but that did the trick. Here’s what I came up with:

The inputs to this node will be stored as a list in the IN variables.

schedule = UnwrapElement(IN[0])
row = IN[1]
column = IN[2]

TransactionManager.Instance.EnsureInTransaction(doc)

#get viewschedule table data
td = schedule.GetTableData()
#get header section data
tsd = td.GetSectionData(SectionType.Header)
text = tsd.GetCellText(row,column)

TransactionManager.Instance.TransactionTaskDone()

Assign your output to the OUT variable.

OUT = text

Excuse the formatting. New user here.

I’m using your script. Any idea why this outputs an empty string?

Revit 2019: get title cell data.rvt (600 KB)
Dynamo: get title cell data.dyn (16.1 KB)
Python: get title cell data.py (1.2 KB)

import clr

clr.AddReference("ProtoGeometry")
from Autodesk.DesignScript.Geometry import *

# Import RevitNodes
clr.AddReference("RevitNodes")

import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitAPI")

clr.AddReference("RevitAPIUI")

import Autodesk
from Autodesk.Revit.DB import *

# Import Revit elements
from Revit.Elements import *

# Import DocumentManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *

import sys

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
adoc = doc.ActiveView

#The inputs to this node will be stored as a list in the IN variables.

schedule = UnwrapElement(IN[0])
row = IN[1]
column = IN[2]

TransactionManager.Instance.EnsureInTransaction(doc)

#get viewschedule table data
td = schedule.GetTableData()
#get header section data
tsd = td.GetSectionData(SectionType.Header)
text = tsd.GetCellText(row,column)

TransactionManager.Instance.TransactionTaskDone()
#Assign your output to the OUT variable.

OUT = text

Line 48 replace Header with Body. Header is used for the data above the A, B, C, etc. column markers. Body is used for data below that.
It should read: tsd = td.GetSectionData(SectionType.Body)

I was getting header cells (rows inserted below the title cell row) information with my code above. Also, if you’re looking to output all of the headers into a list, you’ll need to have a loop in your python code.

Hello,
here is an alternative to read header

import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

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

clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument

schedule = UnwrapElement(IN[0])
row = IN[1]
column = IN[2]

text = schedule.GetCellText(SectionType.Header,row,column)

OUT = text