Run/Execute the whole script if it is true or else run/execute the other script

Hi all,

I have created two separate scripts to create grids for uniform and non uniform spacing. so If I set bool to true then the script for uniform grids creation should execute and if it is false then the other script for non uniform grids should execute.

I am trying the “scopeif” node but not able to proceed to execute the script. Please let me know the solution.

Thanks in advance.

Hey @shashank.baganeACM, have you searched the forums for similar topics already? There’s a lot of information about this scenario out there already. If you’ve found some helpful information could you then link it and explain what you’ve tried or where you’re having issues?

Hi @Nick_Boyts Thanks for response.

I have searched in forum but I found it for only for a node,

I wanted to execute the whole script it is true or if the user wants to create uniform grids.

If the user wants to create non uniform grids then he/she will select false then automatically the other script i.e non uniform script should execute based on the inputs. Can you please tell me how to do that ?

I am jus trying to use scopeif, but not able to run the script. I have got the path of files but not able to run.

Try doing some more research on selectively running different parts of a graph. The information is already out there. If you have specific questions about that information we’d be happy to answer them.

1 Like

Here are a few topics that might get you started.

1 Like

I might not be seeing something here, but why not have two different graphs entirely, one for uniform spacing and one for non-uniform spacing?

Hi @jacob.small because the inputs for uniform grids and non uniform grids are different. I want to use input slider for uniform grids and excel sheet for non uniform grids as grids spacing along X and Y directions are different for non uniform grids.

If I run the non uniform grids script then it will ask me to enter the values in excel then it takes reference of entered values from excel then grids will be created.

If I want to run the script for uniform grids then I’ll give inputs as per the requirement like what will be spacing between grids along X and Y direction and what are the number of grids required and all…

So I have created two separate scripts for that to differentiate between uniform grids creation and non uniform grids creation.

Ok, so why do you want these two similar but yet very different things in the same file?

“Create Uniform Grids via Excel.dyn”
and
“Create Non-Uniform Grids via Sliders.dyn”

Users pick which set of code they want to use by selecting which file to use.

I get ‘but that is one more file to use’ concerns, but it is likely less confusing for users. If this was a Revit feature would the completely separate UIs be triggered by making the users press a button, and then asking them which method, or would there be two different buttons? To me it sounds like two buttons.

3 Likes

Yes @jacob.small That is what I am basically trying to do. I want users to select the options from dropdown menu using UIs (data shapes package) but I am facing difficult to prepare it. Can you please tell me atleast basic graph to do that ? It would be very helpful !

I have created two separate scripts .dyn for uniform grids creation and non-uniform grid creation

I understand what you’re trying to do, but am questioning the “why”. What is the value in making two graphs which do two different things into a single graph?

Right now you have two graphs which make all the grids in a project, and users have to decide which one to use depending on the project’s needs. We are currently looking to make it one graph and once it starts running have it ask the users which method they would like to use. In the end it will still be two clicks, and a user will need to make a decision as to which is the right method for this project.

If we put these statements in front of your CEO, how much money do you think he would be willing to spend to achieve the single graph you’re chasing, knowing there are other issues out there which don’t yet have any easy button?

1 Like

Hi @jacob.small I understand that but we are trying to develop whole model using computational design concept. So please let me know basic graph to do that.

The simple way: wrap the entire code base less the UI inside a custom node. No warning will be triggered by the side which doesn’t run as a result of null values being passed, and the final output will just be the resulting grids.

1 Like

Hi @jacob.small @Nick_Boyts Thanks for the idea. I really appreciate for giving your valuable time. Thank you so much.

Here is the script I have modified that works fine for me.

Parametric Grids creation.dyn (204.7 KB)