List 1 = List 2

I have been trying to do something that I felt should be pretty simple (and maybe it is), but i’m at a loss at this point. To put it simply: I have two lists A and B; I would like to make list A = list B.

I have been trying to collect location data of viewports on a sheet and arrange the location data in a list and when it is in order I would like to simply like to make it equal to another list that I’ve created which is just a list of ordered numbers and replace the view numbers with this new list.

I used the video above as a basis of design however, I have changed a bit of it around to suit my purposes.


Let’s see what you’ve done so far.
It’s unreasonable to expect people to watch an hour long video to figure out what you’re attempting.


Sorry, the portion of the video that i’m referring to is only the last 10 minutes or so (I should have clarified). Here is what I have so far.

I was unable to use either the “get built in” or “set built in” node downloads from Archi-Lab because they broke and I don’t have enough experience with Python yet to fix it.


Edit: Just went back and realized that I missed an entire step. I’ll let you know if this resolved anything.

Ok, I guess I missed a rather big portion as I was trying to simplify the entire process. However, in the end it was necessary. Now i’m just having a less big problem.

In the video he wanted to label the views as 1A, 2B, 3C depending on the column and row, and I’d just like to label them as 1, 2, 3, 4, 5, but i’m having trouble figuring out the easiest way to translate the location into an ordered numerical list from top left to bottom right. Any help would be great!

I’ve posted the images separately below since it won’t let me upload more than one.



Bump Bump

I’ve posted what i’ve accomplished below. Any direction would be greatly appreciated.

@dwendling Assuming you want to order viewport detail numbers. Try this.
It seems to fail sometimes, saying the parameter is Read Only or numbers already exist.
However, the definition should help guide you.
ViewportNumbering.dyn (9.2 KB)


A code version of the one above…
ViewportNumbering.dyn (4.7 KB)

The Python Component

import clr
#Import Element wrapper extension methods
import Revit
#Import geometry conversion extension methods

p = [[] for _ in xrange(len(IN[0]))]
for c in range(len(IN[0])):
	for i in UnwrapElement(IN[0][c]):

#Assign your output to the OUT variable.
OUT = p

The Design Script Component…

grpLst1=List.GroupByKey(vp,vp.GetParameterValueByName("Sheet Number"))["groups"];


srtLst3<1>.SetParameterByName("Detail Number",detNum<1>);

Hey, thanks for the reply and sorry for the delay. This was extremely helpful in resolving my issue with this definition. I now have something that works perfectly!

1 Like