Hey, I’ve a list of concrete elements and steel elements, but i want to run different scripts on them. If my parameter “Element material name” is “Concrete”, i want it to run script A onwards. AND DO NOT RUN SCRIPT B AT ALL! . Similarly, If my parameter “Element material name” is “Steel”, i want it to run script B onwards. AND DO NOT RUN SCRIPT A AT ALL!
I know there are many solutions with if statements saying if input is true, run script, if false, do not run. But its not about true or false, or running script or not. Its about “Concrete” or “Steel” and running Script A or B!
You may need to replace the String.Contains operation with something that suits your situation better, but either way, you can use a conditional statement to create 2 lists. The null values will pass through the script and cause warnings, but it will prevent your inputs from going down the wrong branch. You can do a List.Clean operation before each branch if you want to cut down on the warnings (and that might run the script faster).
yeah @SeanP i want to gather info for only one type of element at a time, Like i want to crawl web for “Concrete” only, so I will input concrete in the string, and it will do a separate script to fetch amount of sand, aggregate and cement.
But if i put “Steel”, i do other things for specs, like finding out their weight and rebar number and length etc.
So can’t run the same script for both type of elements.
1- Running and making fail might not work, because im using export to excel in the end of both scripts, with different export options.
2- Please describe the second method, seems reasonable!
3- Yes python is a great option, but I don’t master in python
Wow, this seems like a solution.
But what if I dont have any element from “Steel”? the B part will go all null and what will happen to the export to excel node in the end of B script? how to stop that to execute?
Although a combined solution may get you where you want to go, but I would suggest looking at different graphs especially since each “branch” is doing completely different things with the elements found. I’d encourage simplicity when possible.