Hi everyone,
I am following ArchSmarters python code to create Placeholder Sheets. I am getting the error as seen in the pic below.
I don’t think it’s the code. I think it has something to do with the RevitServices.dll file and/or its location. If I have made a mistake with the code, please direct me. I followed it from this video. https://www.youtube.com/watch?v=LPk0LMjsyy8
Where should the RevitServices.dll file be located? I am on a work computer and thought it may need to be in the “Users” folder but not sure.
I am in Revit 2023 with Dynamo V2.16.4
Below is my script.
# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
clr.AddReference('RevitAPI')
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transaction import TransactionManager
from Autodesk.Revit.DB import BuiltInCategory, FilteredElementCollector, ViewSheet, Transaction
# The inputs to this node will be stored as a list in the IN variables.
sheetNumbers = IN[0]
sheetNames = IN[1]
# Get the current Revit document
doc = DocumentManager.Instance.CurrentDBDocument
# Start a transaction
t = Transaction(doc, "Create Placeholder Sheets")
t.Start()
# Create the specified number of placeholder sheets
placeholderSheets = []
for i in range(len(sheetNumbers)):
sheet = ViewSheet.CreatePlaceholder(doc)
sheet.Name = sheetNames[i]
sheet.SheetNumber = sheetNumbers[i]
placeholderSheets.append(sheet)
# Commit transaction
t.Commit()
# Assign your output to the OUT variable.
OUT = placeholderSheets
Cheers and thank you!