Hello,
I’m importing revit page numbers from an excel file. Then I translate these into page names. Afterwards, I automatically go to the views they are in and do the PDF and DWG conversion. However, it only does this for the cell in the 1st row of Excel. I can choose which row to convert by adding a parameter, but how can I do it all at once?
Half of those are blank - if you zoom in you can’t see any text.
If you want to loop in Dynamo then use the ‘count’ node.
So if you have 10 items use the count node to tell you it’s 10 in that list. then type
0… n-1 in a codeblock. Plug the count node into the codeblock, that’s your n value.
That’ll create a range. You start at zero because dynamo is zero indexed and n-1 will give you 9 in this instance which is the last item in your list.
Use this range to tell Dynamo which excel rows you want to read.
I didn’t do it as a code block, but I wrote such a code in Python.
# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
msg = IN[0]
try:
finish = int(msg)
except ValueError:
finish = 0
# İlk sayı
first = 0
number_list = []
for i in range(first, finish):
number_list.append(i)
OUT = number_list
You need to look into list levels. That is how you control “looping” in Dynamo nodes. Dynamo automatically iterates over an input structure (i.e. loops) but you sometimes have to specify how that list structure should be handled. That’s where list levels come in.
The primer should cover this but there are also plenty of topics here on the forum that go into detail over this exact issue as well.