Schedule Field Headers. How to rename them from Dynamo?

Hello,

I am wanting to rename from Dynamo the name of the column headers of a Revit schedule. I used the package Bimorph to take the field headers name as shown in this topic https://forum.dynamobim.com/t/schedule-field-headers-headers-bimorph/22325, but I would like to rename them afterwards.

I found the Archlab node Schedule Formatting of @Konrad_K_Sobon where I can see the input Column Heading that it might be the solution but maybe there is a quick way to edit only this parameter without edit the whole list of appearance parameters of a schedule field.

I know if I put a Null value the for the other node inputs, the results will be omitted. Basically I am expecting a reduced node inputs, just the heading name edition.
IMG-20190904-WA0014

If I want to edit the field name from Revit, I can open the revit schedule, formatting, and rename on “Headers”, other options is open the schedule view and type the name manually. I would like to do the same from Dynamo.

By default the names are shown as the parameter name, but sometimes I would like to rename them.

Please if someone knows a solution it would be very useful.

Thanks

Not sure if there’s a way to do it with the custom nodes already out there but it should be a pretty straight forward task in Python.
https://www.revitapidocs.com/2020/3890f745-6f24-f81a-9f8f-d8b47c8e3f94.htm

Hi @RubenVivancos @Nick_Boyts

Is this what you guys are looking for?

3 Likes

That’s what I was expecting. Thanks @Kulkul!

@Kulkul

Exact answer but I would like to see some input names and node descriptions as usual. I think I was expecting to see a Revit core node for that purpose, I have seen core nodes for Revit schedules are very limited.

To me it seems very similar to the node Set parameter by name but it’s about a Revit schedule field.

I believe the unwanted inputs of the Archlab node schedule formatting that is done in python script could be removed and create a new custom node.

Kulkul,
Can you share python script, please.
Thanks.

I’m trying to write a script to update my headers to upper case. The python mentioned here would be helpful, can someone post this please?
thanks!

hello
an alternative with a Dictionnary (original : replace ) and ColumnHeading Property

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

#import Revit API
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


toList = lambda x : x if hasattr(x, "__iter__") else [ x ]
viewsSchedule = toList(UnwrapElement(IN[0]))
repDsDict = IN[1]
try:
	#convert DynamoDictionary to PythonDictionnary
	repPyDict = dict(zip(repDsDict.Keys, repDsDict.Values))
except:
	repPyDict = repDsDict
TransactionManager.Instance.EnsureInTransaction(doc)
for view in viewsSchedule:
	if view.ViewType == ViewType.Schedule:
		schedulDef = view.Definition
		lstfieldId = schedulDef.GetFieldOrder()
		for fieldId in lstfieldId:
			scheduleField = schedulDef.GetField(fieldId)
			valuefromdict = repPyDict.get(scheduleField.ColumnHeading)
			if valuefromdict is not None:
				scheduleField.ColumnHeading = valuefromdict
TransactionManager.Instance.TransactionTaskDone()				

OUT = repDsDict
2 Likes

please Sir i want the python script thank you

hi,
could you provide me this script please.

You can use this. The Existing Column Name must match exactly (uppercase, lowercase). Also, both Existing Column Name and New Column Name must be in list format. Hence why they are enclosed in brackets [ ]. FYI, you will get better results by posting a new thread instead of hijacking one that is several years old.

Rename Schedule Headers.dyn (8.5 KB)

2 Likes

Danke sehr merci bien Thanks

1 Like