Set Sheet parameters by SheetSet (python perhaps)

Hi all,

Im trying to change parameter by ViewSheetSet.
For example a VSS contains 20 sheets, i want to change a parameter for all sheets in this VSS. “Approved By” for example.

it works when i let the user choose Sheets instead of ViewSheetSet, but manualy selecting 50 sheets still takes alot of time. trying to adapt it to work with ViewSheetSets (single and multi selected VSS if possible).

i tried adapting this, but cant get it to work Get views from viewset?

Here is the code i got so far. any help is greatly appriciated!
VSS
SetSheetSetParameter.dyn (20.5 KB)

I tried unwrapping all sheets from selected sheet sets using this python code:

import clr
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
app = DocumentManager.Instance.CurrentUIApplication.Application

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

viewSet = UnwrapElement(IN[0])

viewSets = FilteredElementCollector(doc).OfClass(ViewSheetSet)

for i in viewSet.Name:
if i.Name == viewSet.Name:
vs = i
else:
continue

OUT = [i.ToDSType(True) for i in vs.Views]

Take a look at the ArchiLab package with Get Views in Viewset node. This should work for what you are wanting to do.

2 Likes

Hi Sean, thanks for the response (again). How would i need to change the graph?
I want the user to be able to select a parameter (from chosen sheetset) and write/ overwrite its value

You need to use the script above to get all of the sheets from the SheetSet they select, then feed those into the Element.SetParameterByName with the Values from the Parameter they select and the value they provide. Make sure to check your lacing as you will most likely need to set it to Longest so it will apply to every sheet.

1 Like

I cant find a node called sheets from set. should it be in archilab package ?

Change the lacing to “longest” on the “Get Views from View Set”.

2 Likes

Genius! i need to look in to lacing, thats something i still dont understand. thanks again :slight_smile: