I am trying to construct a 2D truss which consists of multiple lines (assemblies) which are divided with different lengths. The line segments’ end points are connected with each other to produce the diagonal braces.
I maganed to change the diagonal orientations for the whole structure, but my main goal is to change it individually for every assembly (A1-A3 in the picture)
My thinking is to make a multiline data panel, which consists of as many numbers as assemblies I have, and the values would determine the orientation.
The problem is that the number of assemblies also varies (but it is a finite number, mostly 2-3-4), and I can’t figure out the management of the branches. I tried it with explode, but this way you have to adjust the outputs based on the number of assemblies.
I also attach the code which is now suitable for orientation changes for the whole structure but not for individual assemblies.
You seem to have it working well enough, except for a slight off-by-one span error reaching the end of ‘Total length’? The white group below using Merge is a better way to handle lists of inputs explicitly. In this case, the slider ‘No._assemblies’ can be replaced by the length the of Merge list.
P.S. Getting your data trees correct is largely a matter of avoiding ‘Flatten’ completely.
Maybe a little more than that, depending on how you want it?
P.P.S. I just noticed that now all the assemblies have lost their last brace when division length isn’t an integral multiple. How to fix that? Maybe avoid it? And ‘Zig-Zag’ mode is broken too.
LATER: Restored flattened lists to get bracing back, then used a cluster cProx four times to break up the lists of “Columns” and “Braces” into their respective assembly branches. Notice that columns where two assemblies join will be included in both assemblies.
If you have a determined number of assemblies, it is not that hard, but I can’t cope with the changing number of branches without manually rewriting the code.
Actually the zigzag orientation is not that important, so if it worked for only left/right (0/1) that would be great as well.
Note the content of the ‘Orientation’ panel to designate bracing by assembly. It replaces the global “Choose orientation” value list.
In this panel, the list “0,1,0,1,2” corresponds to “Left,Right,Left,Right,Zag”.