Loop export into Excel

Hey Guys!
i’ve been stuck for a while at this one…

Is it possible to export a Loop into Excel?

What i, trying to do is to move a element in Revit. For example i move a wall from 0 to 1 by 0.1 steps with a LoopWhile. How can i transfer information from the wall (getparamatervalue) at each Loop-step?

Hello,
here an idea
loop export excel

2 Likes

Thanks for the answer, but not exactly what i meant.

My purpose is to move the element through all steps by just 1 click, because i have multiple of them. Then i want Dynamo to list the values at every movement in a excel sheet.

You can export to excel within a python node and then just do it with every loop:

I did but it is expecting a openpare? What does it mean?

You need to pay attention:

Your python node is set up with cpython3. You need to change it to ironpython.

image

Its still giving me the error quote… :confused: i changed the settings to ironpython and the python script node. While doing Dynamo told me, that ironpython is an old version and is no more supported.


Wait, do you mean this one?

You cannot use python language in a code block. Furthermore your python node does not throw an error.

The original code was written for Revit 2019 and I just tried it in Revit 2022 and it still works if the python node is set to ironpython:

My bad sorry!

Still im trying to do what youre doing but it doesnt seem to work. The wall gets moved so the rest of my script seems to work through.
But the Excel file wont pop out. As you see on the picture i tried changing it from Python3 to IronPython and even used the migration assistant, but non of this helped.

Can you turn on the preview for your list.create node? Seems to be an issue with that.

I can just guess at the moment, but are you trying to concat the “TB m²” to values? Then you could do it like this:
image

Sure. Here it is. Like i said. Im trying to get a Excel where multiple elements are getting listed with their value for every loop (moving them step by step)

You forgot to turn on the preview, like I did.

Sorry my bad.

Found the error. You need a data input list with three levels:

image

Replace your List.Create node with a code block like this:
image

the Excel worked! Thanks!

but its not listing all my iterations. As you see in the picture the wall should loop from -0,38 to 0,812 and give me the value for all iterations (+0,1 steps) back in Excel.
im getting just one value in excel.


Iron10

Yes, you need to put everything inside of python as I sad at the beginning.

If you are new to python in dynamo, take a look at this:

oh i see. Just for my understanding:

what youre saying is, i need to get all the form all the nodes and connection the python script and put it in the ,PythonScript" node as well . so the only nodes left will be listed elements which will be putted in the ,PythonScript" node?

Exacty. Everythin you do with nodes is possible to do in python scripts with the revit api. Just like I recreated the export to excel node in this python script.

There is a crash course on python nodes in dynamo:

Allright thank you very much!!!

Viele Grüße :v:

Hey,
so i used the node to code function to translate my nodes and connections to a python script and got this huge code. For some reason it does not translate the selected elements into python code.
My question is:
How can i use the code so the integer sliders will loop through the first, second, third… so every possible statement will loop through. Then i want to connect it with the excel python script so every possibility is put into excel?