Passthrough problems

Im trying to make a script that sets a number to objects according to which space it i place and what component type it is. I also need to validate if there are duplicates of the values. I have solved this issue by finding the duplicates and setting their value to an empty string and then i validate the components up against the other components that have a real value and setting the next available number. This part of the script works perfectly, but i have issues with waiting and passing information. For example i want to first set the duplicate value to an empty string, and then validate against the other components. Now i have to run the script 3 times to make it set the right value. I have tried everything at this point, i have tried a codeblock: [pass, wait][0] and it didn’t work, i have tried the custom node from clockwork, it doesn’t work, now i have tried a python script witch does the same as the codeblock, and it still does not work… can someone please help me? it is very frustrating to need to run the script 3 times do get it to work, especially since it takes awhile to run.

Hi !
Something is strange in your script, because you change the value of a parameter and then call back the first value to change it again…Are you sure your python filter works well ?

i’m not 100% sure that the python node works, i copied it from another thread on the forum, but i have tried everything else. As of the “strange” part, im first setting the parameter of the duplicate to an empty string and im then validating it vs all other elements in the same room, this was the easiest way i found. that is why im setting the parameter fist to “” and then getting the new value of the parameter.

I am not an expert in python but it seems your script is making a list of list. Could you show the content of the 2 input lists and the content of the output ?
I think you should first work on the list of values and then set them in just one time.

I first need to set it to an empty string because some people on the project adds the family from the browser, therefor the parameter has no value (empty string), while other people copy the family and paste it in different locations, thus i get duplicates. the best way i found to solve this is if i sett the parameter on the duplicate elements to an empty string first and the i check all the elements in the project if they have an empty string in them, from there i set the new available value to the element. that is why i want to set the parameter first as empty then as a new value.

Can you post an image with the node previews turned on so we can see what your graph is doing? It’s hard to follow right now.

Two things to note:

  1. Revit changes don’t actually commit until the graph finishes. Everything runs in a single transaction. In order to get your parameter values to actually change multiple times you will need to use the Transaction nodes to commit multiple transactions.
  2. You really only need to set the parameter values once. There’s no need to get the values and set them to something else just so you can get those values and change them again. As long as you keep track of your values and the elements they belong to, you can do all the name management in the graph and only change the final value once.

@Nick_Boyts Aha i see, that explains a lot.I did it this way because when i used an OR-node it messed up my list structure. therefor i found it easier to set the parameter once then validate the list based on one condition instead of two. I have not used transaction nodes before, maybe you can show me? sounds like it would solve my problem :slight_smile:

My point is that you already have the data. You can still check both conditions separately.

Give the Transaction nodes a shot first. They’re very straight forward. Then you can ask specific questions if you run into any issues.

@Nick_Boyts Thank you! it worked with the transaction nodes :slight_smile: I will however think about what you said about not setting values twice. my script runs twice as slow now :see_no_evil: