Is an Iterative Solution Possible Within Dynamo (For C3D)

Hi All,

Sorry in advance that this is long, I’ve been trying to mull this one over for a long while.

I’m a novice in Dynamo, and have been using it for several months at this point. I’ve done a dozen or so scripts but I’ve been trying to implement one for awhile but keep running into so many roadblocks or things I presume will be issues.One of the major issues I’m not sure I understand how to tackle or if Dynamo can even support it, is doing an iterative solution that runs a part of the script, looks to see if something fails a check and then runs that same script again with slightly different parameters. Essentially a while loop that interacts with Dynamo nodes.

My main goal for this script is to automatically create parallel-style ADA (Americans with Disability Act for non-US residents) compliant curb ramps. Essentially our current process for designing one of these by hand is this:

  1. Take our sidewalk corridor and apply 3 assemblies to our curb ramp region.
    1. These curb ramp regions consist of a ramp down to the low point, a low point (landing zone), and a ramp back up to the sidewalk grade.
  2. Verify that the slopes are compliant (Less than 7.5% slope on the ramp run down to the low point).
  3. If not (this is where I would like to create an iterative process), adjust the ramp length (e.g the assembly stationing range in the corridor) to be up to 15ft long to meet the grading requirements.
    1. Worst case scenario we adjust the profile to get it to work, but I will not have this be apart of the script as that is asking for trouble.

I’ve tried to create a rough idea of this script already, but am having trouble getting the iterative part of it to work. My idea for the workflow/script is:

  1. Excel sheet has stationing to place ramps. - Got this working
  2. Script extracts stationing, places ramps - This works somewhat.
  3. Checks to see if ramp runs have a compliant slope (less than 7.5%)
    1. If less than 7.5%, ramp succeeds, no further action.
    2. If greater than 7.5%, extend ramp assembly by 0.5ft.
      1. If success, no further action.
      2. If fails again, repeat step 3 up until ramp either succeeds or reaches a maximum width.

Step 3 is where things get tough (makes sense, it’s the bulk of the script). I think there’s two reasons why my process is bad, but I would love to get some ideas on ways to do it better.

  1. Adding regions to an existing corridor is difficult. (e.g we have a sidewalk corridor that runs from station 0+00 to 5+00, inserting a region for the ramp from 0+15 to 0+30 spits out errors “The Start and End Station should not be within Another Region”
  2. C3D seems like it won’t be able to handle the iterative process of applying a new corridor region → checking if slopes fail/succeed → adjust the region again if it fails until it succeeds.
    1. I’ve played around with some Python scripts to try this but I’m not sure how to get it to loop while using the Dynamo nodes to adjust the corridor region station range, since those would be two separate nodes. Maybe feeding an output into its own input? Not sure.

Something I’ve thought of but didn’t want to invest the time in another potential failure without getting advice first is using feature lines instead of a corridor to create the ramp. I’ve seen others create them manually using feature lines as well as other programs do it automatically using them, but was hoping to have a script that integrates well into our already-existing workflow.

My main questions:

Any ideas or things you’ve seen to make this work? Is this even possible with Dynamo?

How to implement an iterative solution using Dynamo nodes?

Are feature lines better than corridor modification when working with Dynamo?

Thanks and appreciate any and all advice!!

I’ve attached my in-progress script, but it’s kind of been torn down as I’ve been doing a lot of trial and error to try and get it to work and it’s very specific to our workflow, but hopefully it can be a bit of a guide in what I’m trying to accomplish.

CurbRampCreator.dyn (72.5 KB)

If I am reading this right (I might not be and my CPU is working overtime on a GD sample tonight so I can’t check your graph directly) you’re doing the following:

  1. Read an excel file to identify the station ‘where a curb cut should be’
  2. Subtract 1/2 the width of the landing to get the ‘leading edge’ for the flat point of the curb cut
  3. Subtract a ‘length of slope’ value from the leading edge to find the ‘entry slope’ point of the ramp
  4. Take the original ramp station (step 1) and add 1/2 the width of the landing to get the ‘trailing edge’ for the flat point of the curb cut
  5. Take the trailing edge of the flat point and add a ‘length of slope’ value to the trailing edge station to find the ‘exit slope’ point of the ramp
  6. Build the assemblies based on the given values
  7. Check the slopes for compliance
  8. Redo steps 3, 5, 6, and 7 with new distances until you get a compliant and valid design

Instead why not do this:

  1. Read the ‘curb cut middle point’ from excel as before
  2. Add and subtract 1/2 of the curb cut width to get leading and trailing curb cut stations
  3. Get a line at the base of the existing curb for each side of the curb cut’s landing
  4. Project those lines by 75% of the allowable ramp slope (giving yourself construction tolerance) on the coordinate system of your ramp’s mid point along a plan distance of 15 units.
  5. Intersect the projected curve with the current profile geometry
  6. Get the station for the intersected point - this is your leading or trailing ramp station point.
  7. Build your assemblies from the leading ramp station to the leading curb cut station, then from leading curb cut station to trailing curb cut station, and then from trailing curb cut station station to the trailing ramp station.

Sure the intersection (step 6) won’t be ‘cheep’ from an early compute time, but in newer builds it’s surprisingly fast and you’ll only have to do the work once instead of getting the computer to play ‘guess where to start’ with your Civil 3D assembly limits.

Sorry for the late reply, was on vacation and spent a day trying to digest what you said.

Firstly, thanks for the awesome answer, I’m having trouble understanding it but I love working through this with someone more knowledgeable. You are reading it right, that’s the process I was going with. I want to try your method but want to make sure I’m understanding it properly and how to accomplish it.

Please excuse my “beautiful” art work of the steps you laid out but does this seem right?

Besides projecting the lines from where my diagram is showing (Should be projecting from the blue points and projects to the left and right from those, rather than the midpoint), it sounds like it would be a good process. But, I am confused on how to implement Step 4 → 5. Do I create a (practically infinite) line in CAD? How can I use Dynamo or a function in CAD to determine when it intersects with the profile? I imagine once I get that down I can figure out how to get the stationing, that part does seem too difficult process wise, I just am not sure about Civil3D/Dynamo’s tools to create the projecting line and finding the intersection point with the profile.

Thanks again, greatly appreciate the help!!! :slight_smile:

Depends on what you have that you’re projecting to.

Based on that sketch, I’m assuming you’ve got profiles but perhaps not yet surfaces?

If that’s the case, my Dynamo based method would be something like this:

  1. Get the profile at the bottom of the curb in Dynamo
  2. Get the coordinate system at the stations + [landingWidth/-2, landingWidth/2] based on your excel file.
  3. Get the origin of each of those coordinate systems.
  4. Extract the X axis of each coordiante system and rotate it about its Y axis by [180-x, x] where X is whatever your max slope is in degrees.
  5. Extract the polycurve of the profile (from step 1).
  6. Copy the profile geometry up by your curb height.
  7. Point.Project to project the points to the translated curve.
  8. Profile.StationOffsetAtPoi t to extract the stations for your transition points.

I do have an existing surface, and I could get somewhat of a finished surface, e.g the corridor surface. For the most part I’ll be working with at the very least an existing sidewalk, but for now most projects are implementing ramps on brand new sidewalks (that a corridor is modelling).

Either way, thanks I’ll try out your solution and see if I run into any problems I can’t figure out. Thanks again for all the guidance!