Double Foor loop...using code block?

Maybe I should give this one its own thread…

Hello, I am trying to now use design script, with a double FOR loop.

Of course, I am clueless of what I am doing… :frowning:

Anyone could give me some pointers here?

Here is what I got: you can see the source data, and what I have in the code block.
The two FOR loop need to be in parallel: in this case, 5 values and 5 paths should be used: a,a b,b c,c etc. forming 5 couples of data, not 25. Values and Paths should always be same depth lists, while “ele” should always be just one element.

Thank you!

regards

gio

Hello Gio,

It’s unclear what you are trying to achieve here :slight_smile: Can you please elaborate a little more?

From what I gather, you want to:

  1. Take a set of input Values (Family Types?)
  2. Take a set of input Paths (Image locations?)
  3. Take a single element (Not sure what this is)

Then you want to, for the active view, export an image after you have set a parameter value that is a family type to the element? i.e. - you can to change the Elements family type, export the view, then repeat?

Hi Solamour,

yes, I think you got it.

I have a legend element (ele) in the current view (a legend, doh), and I wish to:

  1. change its type
  2. export the view to the given path / file (this may require a view or document refresh)
  3. repeat for the next couple of values (combo type and path / file).

Thank you

Regards

gio

I am not sure Design Script is a good route for this, as it will require:
For each item in the list:

  1. Start a new transaction
  2. Modify the element
  3. End the transaction
  4. Refreshing the document
  5. Exporting the data

Managing Revit transactions and document update calls at that level would likely be brutal and prone to eventual instability in design script due to the reliance on external zero touch nodes in design script. Python or a zero touch node would likely be better suited.

1 Like