# Create Panel Schedule Sheet Instances on Sheets

**URL:** <https://forum.dynamobim.com/t/create-panel-schedule-sheet-instances-on-sheets/30007>\
**Category:** Revit\
**Tags:** archi-lab, python, dynamo\
**Created:** [December 23, 2018, 12:08am UTC](https://forum.dynamobim.com/t/create-panel-schedule-sheet-instances-on-sheets/30007 "2018-12-23T00:08:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathanhGQQDB](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@nathanhGQQDB](https://forum.dynamobim.com/u/nathanhGQQDB)\
**Post date:** [December 23, 2018, 12:08am UTC](https://forum.dynamobim.com/t/create-panel-schedule-sheet-instances-on-sheets/30007/1 "2018-12-23T00:08:07Z")

</div>

Hi all,

First time poster and relatively new to Dynamo and could use some help. I’ve been taking a stab at creating a graph that allows the user to select a titleblock, multiple panel schedules, and a panel schedule graphic that’s been placed on a sheet, so as to get it’s position relative to titleblock, and then create new sheets with panel schedule graphic instances placed using the position data acquired.

Basically, the code is @SeanP’s Schedule.dyn from [Place Legends on Multiple Sheets with Template Legend](https://forum.dynamobim.com/t/place-legends-on-multiple-sheets-with-template-legend/25632) tweaked just a bit. (see attached)

 ![PlacePanelSchedule](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/6/16285ecee3073aa7c8554b40bd5b3b4eb4503c00.png) His code uses Rhythym, Data-Shapes, Spring, and Archi-Lab package nodes just like mine.

My problem is in the node “Create Panel Schedule Graphics 2”, where I get the error “list can not be called”. I was hoping someone might be able to point out what’s causing my error and if it can be remediated. When ran the node is actually receiving a list of Panel Schedule Views for IN[0] and a list of Sheets for IN[1]. Can provide more detail as necessary.

pschedules = IN[0]  
templateSheets = IN[1]

try:

pschedGraphics =   
for i in range (0, 24):  
pschedGraphics.append(PanelScheduleSheetInstance.Create(doc, pschedules(i), templateSheets(i)))

except:  
import traceback

errorReport = traceback. format\_exc ()

if errorReport is None:  
OUT = pschedGraphics  
else:  
OUT = errorReport

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [December 23, 2018, 1:09am UTC](https://forum.dynamobim.com/t/create-panel-schedule-sheet-instances-on-sheets/30007/2 "2018-12-23T01:09:56Z")

</div>

Without the whole node to work with, it looks like you should be using pschedules[I] not “(I)” as that is for methods not indices. Change them to open brackets and see if that works.

If that doesn’t work, then also try to post and image with all of the result windows open and a full copy of the code for troubleshooting.

Thanks for the shout out, and glad to see my graph is being used for other stuff!

---

<div class="post-metadata">

**Author:** ![nathanhGQQDB](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@nathanhGQQDB](https://forum.dynamobim.com/u/nathanhGQQDB)\
**Post date:** [December 23, 2018, 6:23am UTC](https://forum.dynamobim.com/t/create-panel-schedule-sheet-instances-on-sheets/30007/3 "2018-12-23T06:23:34Z")

</div>

Thanks man and no problem! I apologize for the haphazardness of this inquiry. I was in a rush to get out of the office on Friday after spending way too much time just trying to get this code to work and didn’t think to just email myself the .dyn itself, so I could make this post the next day. I’ll try your suggestion and if it doesn’t work I’ll post the .dyn so the forum can have a better chance at troubleshooting. I’ll try and sneak back into my office on Friday the 28th (even though I’m on PTO) just cause I’m headed that way that day anyway and get the .dyn. If that doesn’t work I’ll get it out on the 1st.

---

<div class="post-metadata">

**Author:** ![nathanhGQQDB](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@nathanhGQQDB](https://forum.dynamobim.com/u/nathanhGQQDB)\
**Post date:** [January 2, 2019, 4:24pm UTC](https://forum.dynamobim.com/t/create-panel-schedule-sheet-instances-on-sheets/30007/4 "2019-01-02T16:24:37Z")

</div>

Hey @SeanP, sorry for the delay… Here is my full graph and screenshot as promised. I tried switching the parantheses with brackets for pschedules and templateSheets, but no luck. The error I get when I try that is “Expected ElementID, got UnknownElement” [PanelSchedules2Sheets2.dyn](https://forum.dynamobim.com/uploads/short-url/cV4znRKow0gFIGOyZ8BnobVsGuH.dyn) (106.2 KB)

 ![PanelSchedules2Sheets2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/4/144533cb851fea9e9304f015fa546030d74db4c1.png)

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [January 2, 2019, 6:15pm UTC](https://forum.dynamobim.com/t/create-panel-schedule-sheet-instances-on-sheets/30007/5 "2019-01-02T18:15:51Z")

</div>

Hi Nathan,

There are some changes to make in your scripts :

**Create Panel Schedule :**

```
import clr
# Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

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

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 variable.
pschedules = UnwrapElement(IN[0])
templateSheets = UnwrapElement(IN[1])

#Start the transaction
TransactionManager.Instance.EnsureInTransaction(doc)

pschedGraphics = []
for i,j in zip(pschedules,templateSheets):
	pschedGraphics.append(PanelScheduleSheetInstance.Create(doc, i.Id, j))

#End the transaction
TransactionManager.Instance.TransactionTaskDone()

# Assign your output to the OUT variable
OUT = pschedGraphics

```

**Set location script:**

```
# Copyright(c) 2017, Konrad K Sobon
# @arch_laboratory, http://archi-lab.net

import clr
import sys

pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)

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

clr.AddReference("RevitNodes")
import Revit

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

clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

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

def process_list(_func, _list):
    return map(lambda x: process_list(_func, x) if type(x) == list else _func(x), _list)

for loc in IN[1]:
	def set_location(item, location=loc.ToXyz()):
		pschedule = UnwrapElement(item)
		pschedule.Origin = location
		return item

output = []
try:
    errorReport = None
    TransactionManager.Instance.EnsureInTransaction(doc)
    output = process_list(set_location, IN[0])
    TransactionManager.Instance.TransactionTaskDone()
except:
    import traceback

    errorReport = traceback.format_exc()

# Assign your output to the OUT variable
if errorReport is None:
    OUT = output
else:
    OUT = errorReport

```

 ![panelschedule](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/4/64f3e1c30fc885723d586917669d6d2b5a28b0be.png)

[PanelSchedules2Sheets3.dyn](https://forum.dynamobim.com/uploads/short-url/ioMtTDX4cfusRz4AE66UudlPxG2.dyn) (72.6 KB)

---

<div class="post-metadata">

**Author:** ![nathanhGQQDB](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@nathanhGQQDB](https://forum.dynamobim.com/u/nathanhGQQDB)\
**Post date:** [January 2, 2019, 7:01pm UTC](https://forum.dynamobim.com/t/create-panel-schedule-sheet-instances-on-sheets/30007/6 "2019-01-02T19:01:09Z")

</div>

Beautiful! Works like a charm.

---

<div class="post-metadata">

**Author:** ![coffee](https://avatars.discourse-cdn.com/v4/letter/c/dc4da7/32.png) [@coffee](https://forum.dynamobim.com/u/coffee)\
**Post date:** [March 9, 2020, 2:51pm UTC](https://forum.dynamobim.com/t/create-panel-schedule-sheet-instances-on-sheets/30007/7 "2020-03-09T14:51:19Z")

</div>

Everything works as expected when a single panel schedule is used as a template (boolean set to True for SelectSingleElement on UI.SelectModelElecments data), but when I select multiple panel schedules as the template, I get the following error in the “Set Panel Schedule Graphic Location” python code:  
line 33, in AttributeError: ‘list’ object has no attribute ‘ToXyz’

This is related to the following loop:  
for loc in IN[1]:  
def set\_location(item, location=loc.ToXyz()):  
pschedule = UnwrapElement(item)  
pschedule.Origin = location  
return item  
I’ve set up a Watch, and IN[1] is a list of multiple locations as expected.

Does anyone know why the ToXyz() is causing the error?
