Is there a Civil 3D API equivalent to the JOINFEATURE command (Join Feature Lines)?

Is there a Civil 3D API equivalent to the JOINFEATURE command (Join Feature Lines)?

rampseeker
Advocate Advocate
471 Views
4 Replies
Message 1 of 5

Is there a Civil 3D API equivalent to the JOINFEATURE command (Join Feature Lines)?

rampseeker
Advocate
Advocate

I’m trying to find a way to implement the same behavior as the Civil 3D JOINFEATURE (Join Feature Lines) command in the .NET API.

Specifically, when I have two FeatureLine objects, I want to join them into a single FeatureLine exactly like JOINFEATURE does. However, I can’t find any exposed API method/class for this, no matter how much I search.

Is JOINFEATURE functionality exposed anywhere in AeccDbMgd? If not, is there any recommended workaround to achieve the same result programmatically?

Thanks!

0 Likes
Accepted solutions (1)
472 Views
4 Replies
Replies (4)
Message 2 of 5

AdammReilly
Collaborator
Collaborator
Accepted solution

There is no direct correspondence to that feature command in the API, Essentially you need to extract all the data from the second feature line and justice append it to the first. Once you've added all of the data from the second or 3rd or 4th... feature line then you will delete those and you will end up with just the first feature line edited as if all of the feature lines were joined.

Adam Reilly
Civil 3D 2026
Creator A16 AI+ A3HVFG
Windows 11 Pro
AMD Ryzen AI 9 365 w/ Radeon 880M
LinkedIn
Group Leader badge
Austin CADD User Group
LinkedIn | Discord
Civil 3D Certified Professional
0 Likes
Message 3 of 5

rampseeker
Advocate
Advocate

Is there a way to obtain the 3D curve geometry from a FeatureLine?
According to the documentation, FeatureLine does not seem to expose any method or property that returns its internal Curve, so I’d like to confirm if there is an intended way to access it.

featureline class 

0 Likes
Message 4 of 5

rampseeker
Advocate
Advocate

I’ve solved it. I generated the 2D layout of the feature line first, then assigned the elevation to each point.

private static Polyline Build2DPolylineFromFeatureLine(FeatureLine fl)
{
    var piPts = fl.GetPoints(FeatureLinePointType.PIPoint);
    if (piPts == null || piPts.Count < 2)
        throw new InvalidOperationException("PIPoint not enough.");
    var pl = new Polyline();
    pl.SetDatabaseDefaults();

    for (int i = 0; i < piPts.Count; i++)
        pl.AddVertexAt(i, new Point2d(piPts[i].X, piPts[i].Y), 0.0, 0.0, 0.0);

    for (int i = 0; i < piPts.Count - 1; i++)
    {
        double bulge = 0.0;
        try { bulge = fl.GetBulge(i); } catch { bulge = 0.0; }
        pl.SetBulgeAt(i, bulge);
    }

    return pl;
}
0 Likes
Message 5 of 5

AdammReilly
Collaborator
Collaborator

The alternative would be to call the FeatureLine.Explode() method but that's a more complex operation to deal with.

But what you did works very well and has less trouble 🙂

Adam Reilly
Civil 3D 2026
Creator A16 AI+ A3HVFG
Windows 11 Pro
AMD Ryzen AI 9 365 w/ Radeon 880M
LinkedIn
Group Leader badge
Austin CADD User Group
LinkedIn | Discord
Civil 3D Certified Professional
0 Likes