I’ve got a pretty involved graph that I want to take one action if it runs in 2016 and different action if it’s in 2017.
My problem is that there are several parts the run in both, and there’s no clear division I can see to pipe into an IF node.
I’ve been dealing with it by Freezing one node and Unfreezing the other depending on which version of Revit I’m in.
Those are the purple and blue Groups in the center.
I know how to find the Revit version, I just don’t know how I can split up my graph based on the results.
The first part of this Graph runs under 2016 and compares its Text elements the 2016 upgraded version.
It examines the height of the Text Boxes and automatically widens the Text Box a little bit (~6%) if the text wrapped onto an additional line.
I’d like to share this with the community, but I’d like it to run without tweaking for both versions.
Any suggestions on how I can branch in the middle? As you can see, there are wires that both branches need on both sides of the branch.
You need to break the data at the beginning of each chunk. Considering I’m not familiar with the graph (the extent of the in/out), it makes it very difficult to offer solutions.
An example of breaking the data at the beginning is below. As you can see the green portions (Revit 2016 pretend data) are not running.
Thanks, John.
I didn’t expect you to solve the whole thing for me.
But your image did help clear up one big thing for me.
From the examples I’ve seen I had thought all the hard work had to be done on the left side of the IF (or ==)
But I like your trick of passing a boolean toggle & using the in /out to shunt the effort around.
Here’s a grossly simplified version of what I’m trying to do.
Simplified even more: I want to Write an Excel file if I’m in 2016 and Read it if I’m in 2017.
In this sample, I tried to feed a number into the file name, but that’s not very clean. I don’t like forcing an error condition.
Is there any way to prevent the node from being fired at all?
Nuts.
Tried it as above, passing a Number 0 as the file name to the Excel.ReadFromFile node
It still fires the node & opens Excel with a blank document
The List.Empty trick seems to work, but now my IF statement is failing!
It looks like everything is being fed in properly, and it correctly find the Version, but the IF returns EmptyList even though that’s the false case.
The == is true, so why is the path not being passed through the IF?
@DaveP - Use ScopeIf instead. IF cannot deal with inputs of different lengths (in your case a singleton vs. an empty list). Please note that ScopeIf may however not work stably on larger / complex graphs (although by the looks of it, it should work in your case). In those (fairly rare) cases, see my comment on the issue linked below for a workaround:
Also, an alternative may be to pass a null value instead of an empty list.