I’m creating a script that’s getting a lot of rebar info from excel.
But not all rebar is necessary but the calculation rules are present in the Dynamo script.
I’d like to make some sort of “switch” that looks to the input (an excel cell) and when it have a value it passes that value but when it has no value it’s “suspends” a part of the script.
Basicly I want to keep the calculation without the output to Revit but I don’t want the yellow error signs!
A bit error catching and handling.
I’m sorry…sure I can. First I just wanted to know if the thing I need actualy can be done in Dynamo.
I already tryed the "passthrough’node from the Clockwork package and placed it fore the Rebar.ByCurve node.
But that only result in an error. And yet when I don’t connect a node to the hostElementId input…no error and also no rebar in Revit.
So I started to make an design script “switch” with an if-statement but that also fails.
The thing is that the calculation for the rebar must be present in the script but the input could be not present.
So the rebar isn’t needed. And when a calculation has no input it gives an error.
And though the script will complete as intended…it gives back errors to the user who does not understand those errors because he/she is using Dynamo player and doesn’t know how Dynamo works.
He/she just reads “Run completed with warnings” and stops working to ask for help.
But the strange thing is…this is my side script! And this is a 1-on-1 copy from my large mainscript.
And in my mainscript it works just great. atleast…the standard way that is.
When I get the “Curve” input from the Line.ByStartPointEndPoint node it works in my mainscript but give a error in my side script. And it’s just copy and past into a new script.
This for thinking with me! Much appreciated!
I had no idea of these nodes. But aren’t you doing the same thing as I do inside my code block?
You do it with nodes and I’m doing it with a designscript.
Here’s the content of my code block:
I thought so to…that the “null” part is the problem.
To solve that I’d like to pass…nothing! But I have no idea if that is possible.
Because when I disconnect the ElementId from the Rebar.ByCurve the script runs and I don’t get a warning massage.
But like I mentioned I don’t know if it is possible.
If input equals this then let element pass… if it doesn’t do nothing/break/don’t pass anything/cut the line/disconnet to the Rebar.ByCurve input!
Hey Mike… i have tried this also in one of my scripts and till now i seem to get nothing to do the trick… exactly like you said ( cute the line ) part!
but i’m trying to do something now which is if i can say ’ passing fake value ’ when it doesn’t equal to yes. you might want to try that.
i’ll keep you updated
I know…I know…sorry for the confusion.
But in my case the “switch” is intended for the ElementID input of the Rebar node.
I noticed that when I leave that input unconnected the node doesn’t have enough input to work and turns light grey instead of dark grey. And I don’t get a warning.
But a curve is also a line and a line is also a curve.
(Don’t get me wrong Erik…I’m not attacking you … I’m just debating and looking for a solution)
When I run my main script (with the same script setup as my side script I posted above) I don’t get that warning.