# Place Legend on sheet by Revit selection

**URL:** <https://forum.dynamobim.com/t/place-legend-on-sheet-by-revit-selection/16750>\
**Category:** Revit\
**Created:** [November 22, 2017, 3:45pm UTC](https://forum.dynamobim.com/t/place-legend-on-sheet-by-revit-selection/16750 "2017-11-22T15:45:15Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![DJ\_949](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@DJ\_949](https://forum.dynamobim.com/u/DJ_949)\
**Post date:** [November 22, 2017, 3:45pm UTC](https://forum.dynamobim.com/t/place-legend-on-sheet-by-revit-selection/16750/1 "2017-11-22T15:45:15Z")

</div>

Hello fellow contributors,

I have an issue I am trying to solve. Some of the members here helped me get a script working which places legends on sheets at specified coordinates. I am now looking to expand this tool to place by selection. For some reason while playing with it the only results I am getting are placement on a single selected sheet or placement on every sheet in the project. I’ve played with the settings and nodes quite a bit over the last 2 weeks and I am stumped. Any help would be greatly appreciated. Also under the view selection node is it possible to omit anything that isnt a legend? I have been looking for a solution there as well.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/8/28bdbd8f42b14f66c0199f9d69ab2eb1705e646a.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [November 22, 2017, 5:04pm UTC](https://forum.dynamobim.com/t/place-legend-on-sheet-by-revit-selection/16750/2 "2017-11-22T17:04:07Z")

</div>

What errors are you getting? It could be that your Python input is expecting a list.  
Have you looked into Data Shapes’ UI nodes? They are great for selecting sheets in a project.

---

<div class="post-metadata">

**Author:** ![DJ\_949](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@DJ\_949](https://forum.dynamobim.com/u/DJ_949)\
**Post date:** [November 22, 2017, 5:09pm UTC](https://forum.dynamobim.com/t/place-legend-on-sheet-by-revit-selection/16750/3 "2017-11-22T17:09:52Z")

</div>

I am not getting any errors it works just not as intended. On this attempt it placed the Legend on sheet “3207174” But ignored “3764420” even though I have both selected within Revit. I’ll take a look and see if that node you mentioned is one I have tried or not. I tried a few with no luck so far. This is the closest I have gotten.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/4/045a919a3bbb496f048a3a97d19a265356df033b.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [November 22, 2017, 5:18pm UTC](https://forum.dynamobim.com/t/place-legend-on-sheet-by-revit-selection/16750/4 "2017-11-22T17:18:39Z")

</div>

You have them selected but you only have one Sheet going into your Python node.

---

<div class="post-metadata">

**Author:** ![DJ\_949](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@DJ\_949](https://forum.dynamobim.com/u/DJ_949)\
**Post date:** [November 22, 2017, 5:33pm UTC](https://forum.dynamobim.com/t/place-legend-on-sheet-by-revit-selection/16750/5 "2017-11-22T17:33:50Z")

</div>

That is my problem with this. I’m trying to understand why its dropping the adl sheets when I select more than 1.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [November 22, 2017, 5:39pm UTC](https://forum.dynamobim.com/t/place-legend-on-sheet-by-revit-selection/16750/6 "2017-11-22T17:39:09Z")

</div>

The python node doesn’t care about what you have selected. It’s only running on the input sheets. Your codeblock `a[0]` is getting the item at index zero from your list, which happens to be a list of a single item. That’s the only sheet being run through python. If you’re selecting the sheets you want legends placed on then you want all of them going into the python node, there’s no need for `a[0]`.

You also don’t need those nodes to have cross-product lacing. It’s not doing anything in this instance.

---

<div class="post-metadata">

**Author:** ![DJ\_949](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@DJ\_949](https://forum.dynamobim.com/u/DJ_949)\
**Post date:** [November 22, 2017, 5:45pm UTC](https://forum.dynamobim.com/t/place-legend-on-sheet-by-revit-selection/16750/7 "2017-11-22T17:45:50Z")

</div>

So If I understand correctly the problem is that the sheets are split into multiple lists and the python node is looking for s single list at index 0. So it sounds like 2 things are of concern, My sheets being split into multiple lists and that I am only including the sheets at index 0. Thank you for sharing that with me. I’ll give it another go. I just learned a little about how lacing works at Autodesk university last week but I am still struggling to wrap my head around it fully.

---

<div class="post-metadata">

**Author:** ![DJ\_949](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@DJ\_949](https://forum.dynamobim.com/u/DJ_949)\
**Post date:** [November 22, 2017, 5:56pm UTC](https://forum.dynamobim.com/t/place-legend-on-sheet-by-revit-selection/16750/8 "2017-11-22T17:56:29Z")

</div>

So your advice got it working thank you so much!. I removed the index 0 designation and changed my lacing to longest.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [November 22, 2017, 5:56pm UTC](https://forum.dynamobim.com/t/place-legend-on-sheet-by-revit-selection/16750/9 "2017-11-22T17:56:44Z")

</div>

Most nodes don’t require lacing for a single list. Dynamo is smart enough to know that if you have a list of inputs for a node that you usually want the node to run on all items in that list. Lacing is usually necessary for multi-dimensional lists or functions that run on multiple lists.

---

<div class="post-metadata">

**Author:** ![DJ\_949](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@DJ\_949](https://forum.dynamobim.com/u/DJ_949)\
**Post date:** [November 22, 2017, 6:06pm UTC](https://forum.dynamobim.com/t/place-legend-on-sheet-by-revit-selection/16750/10 "2017-11-22T18:06:44Z")

</div>

Ah okay so when working with one list it doesn’t really matter then?

This image was used to teach us about its use during the workshop.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/5/d576df893e1f14f794d1a5bf7d9b8ec9578d1d00.jpg)

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [November 22, 2017, 6:16pm UTC](https://forum.dynamobim.com/t/place-legend-on-sheet-by-revit-selection/16750/11 "2017-11-22T18:16:52Z")

</div>

Correct. You’ll notice that each lacing option shows two lists. With a single list, there’s no lacing to be done. Dynamo just runs the node on all items.

This is slightly different for nodes that require a list as an input. Think of Flatten for example; normally it will Flatten the input into a single 1D list. However, if you want to Flatten sublists within the input list instead of the entire input, you can use Longest lacing to tell the node to treat each sublist like the input list.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/9/5937ed137613eb18d65f07ee9174231d8551ea63.png)

---

<div class="post-metadata">

**Author:** ![DJ\_949](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@DJ\_949](https://forum.dynamobim.com/u/DJ_949)\
**Post date:** [November 22, 2017, 6:29pm UTC](https://forum.dynamobim.com/t/place-legend-on-sheet-by-revit-selection/16750/12 "2017-11-22T18:29:49Z")

</div>

That adds alot more clarity to how this all works thank you.
