First I want to say I know full well this is a very very dumb way to use Dynamo! It’s the verbose versions verbose version. However, it illustrates what kind of end result I’m after.
I’m looking to create a ‘handrail generator’ that will be used for stairs that loop back on top of themselves (Which Revit doesn’t at present handle very well).
First simple version would be: Landing - Flight - Landing - Flight - Landing - Flight.
Second, harder version would use if/then statements to allow for: landing - Flight (X-axis) - mini landing - mini flight (Y-Axis) - mini landing - Flight (X-axis) and so on.
The image showcases my verbose variant. Would any have any pointers?
Here’s where I have got to so far regarding it. I’ve decided to create 2x definitions. One is a standard stair (parallel), the next would be offset one step, to be tackled after I get the first one working.
I will then simply mirror the geometry upwards based off a user choice of levels as per your suggestion Peter.
I am however running into a couple of syntax issues with my Code Block.
In terms of troubleshooting - I’m missing a ‘}’ somewhere and my List.Create isn’t functioning but beyond that i’m a little stumped.
Ah brilliant, thanks Dimitar. I’m still getting the first error message of:
Error “}” expected, so I’m assuming it’s something to do with my ‘def’ but for the life of me can’t figure it out as my syntax is the same as the Tips and Tricks version.
There really shouldn’t be a need for a semicolon there. I noticed that you’re defining your points as pt1,2,3 but you’re adding them to the list as ptS1,2,3, that will definately cause some issues as well.
Hello all. As a follow up, I’ve now got code that functions reasonably well. The problem is if I connect the ‘sweep’ profile into my generator it either crashes or takes a very long time (10+ mins) to populate a sweep over a path… which shouldn’t happen.
Does anyone have any idea why this would happen?
Also, is there a way to push this path out to Revit as model lines or reference lines? So I could do the sweep in Revit. Ideally it would be able to be put into an In-Place Model so that I could control it with the ‘Railing’ category but so far (As per Andrea’s suggestion) I can only push it into a ‘Generic Model’ family.
Your function returns a PolyCurve. Unfortunately it seems that solid constructors freak out when you feed them a non-planar PC. I’m not sure what’s the best alternative here. You could extract the individual curves and create a solid at each and then unify them, but that seems to end up pretty choppy at the curve connections. Or you could try running a NURBSCurve through your points, but that will give you a curvy/groovy looking railing.
Also if you just want to export the PC to Revit lines, extract the PC’s curves and feed them into a “ModelCurve.ByCurve” node.
I’ve tried a Nurbscurve with a degree of 1 which gives a non-curvaceous line (Win) but still runs into the same issue with performance (Lose).
Maybe parsing it to Revit Lines and back in is the best option. Unless I can parse out the linework into a Generic Model family file and simply use it to create a Sweep in Revit?