As a preface, I am using AutoCAD 2017 because it was the last year we could purchase a perpetual license. We are going to ride this puppy until the wheels fall off, but that means I can't use anything from the AutoCAD .net API that is more recent AND I am kind of stuck with .net version 5.0 as the highest. So far it hasn't been a big deal to be 6 years behind everyone else. At least I don't have to deal with any NEW bugs introduced by Autodesk until we eventually get into a subscription license.
My question is about creating a 2nd degree spline. I am trying to write a short little program that will layout a guardrail flare (or whatever parabolic flare is needed) using control points. I have a formula from Caltrans that gives me a series of points on the guardrail from a baseline tangent to the start of the flare, but splines using fit points sometimes don't offset well and are forced into a degree 3 curve instead of a parabola. My effort is mainly so I can dispute my business partner's claim that AutoCAD does not do parabolic flares like Microstation does (and he is actually correct), but I intend to show him it can be done using splines. Civil 3d seems to think parabolas are only useful for vertical curves and it doesn't provide the same functionality for horizontal curves.
I can create a parabola easy enough in a drawing, but I want to automate guardrail layouts, left turn bay transitions, and other parabolic flares/transition as I have done for most of the other tedious road stuff we do. I can't figure out how to create the same kind of parabola in .net as can be created in the drawing environment. The closest I can get is by using the spline constructor like this:
new spline(points array, start vector, end vector, degree, tolerance), but that still uses a best-fit method.
I have also found that it requires me to include at least one point on the parabolic arc. It would be so much easier to use the intersection of the start and end tangents (like the spline-cv command) , but as I said, the .net api does not seem to have this option. Trying to add the control point after instantiating a spline object with or without constructor points is also not giving me the results I want.
Anybody have any ideas about how to create a parabola with control points in .net?