Maybe
Use this code And arrange it as you like
https://forums.autodesk.com/t5/civil-3d-customization/get-section-points-problem/m-p/6000784
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Geometry;
using aGi = Autodesk.AutoCAD.GraphicsInterface;
using Autodesk.AutoCAD.Runtime;
using Autodesk.Civil.ApplicationServices;
using Autodesk.Civil.DatabaseServices;
using CivDb = Autodesk.Civil.DatabaseServices;
namespace Extensions_Section
{
public class Extensions_Section
{
[CommandMethod("testExtensions_Section")]
public void stExtensions_SectiondA()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
CivilDocument civdoc = CivilApplication.ActiveDocument;
Editor ed = doc.Editor;
PromptEntityOptions entOpts = new PromptEntityOptions("Select section:");
entOpts.SetRejectMessage("...not a section, try again.");
entOpts.AddAllowedClass(typeof(CivDb.Section), true);
PromptEntityResult entRes = ed.GetEntity(entOpts);
if (entRes.Status != PromptStatus.OK)
return;
using (Transaction tr = db.TransactionManager.StartTransaction())
{
CivDb.Section sec = (CivDb.Section)entRes.ObjectId.GetObject(OpenMode.ForRead);
var LL = sec.GetSectionLinks();
var LLPOINT = sec.GetValidSectionPoints();
tr.Commit();
}
}
}
public static class ExtensionsSection
{
public static IEnumerable<SectionPoint> GetValidSectionPoints(this CivDb.Section section)
{
var valid = new HashSet<Point3d>();
dynamic comSec = section.AcadObject; // AeccSection
dynamic comLinks = comSec.Links; // AeccSectionLinks
for (int i = 0; i < comLinks.Count; i++)
{
dynamic comLink = comLinks.Item(i); // AeccSectionLink
if (comLink.Type != 1)
{
valid.Add(new Point3d(comLink.StartPointX, comLink.StartPointY, comLink.StartPointZ));
valid.Add(new Point3d(comLink.EndPointX, comLink.EndPointY, comLink.EndPointZ));
}
}
return (from sp in section.SectionPoints
where valid.Contains(sp.Location)
select sp);
}
public static IEnumerable<Section.SectionLink> GetSectionLinks(this CivDb.Section section)
{
dynamic comSec = section.AcadObject; // AeccSection
dynamic comLinks = comSec.Links; // AeccSectionLinks
for (int i = 0; i < comLinks.Count; i++)
{
dynamic comLink = comLinks.Item(i); // AeccSectionLink
var start = (from sp in section.SectionPoints
where sp.Location.IsEqualTo(new Point3d(comLink.StartPointX, comLink.StartPointY, comLink.StartPointZ))
select sp).First();
var end = (from sp in section.SectionPoints
where sp.Location.IsEqualTo(new Point3d(comLink.EndPointX, comLink.EndPointY, comLink.EndPointZ))
select sp).First();
if (start != null && end != null)
{
yield return new Section.SectionLink(start, end, i, comLink.Type);
}
}
}
public static IEnumerable<Section.SectionLink> GetValidSectionLinks(this CivDb.Section section)
{
return (from sl in section.GetSectionLinks()
where sl.Type != SectionLinkType.NoDraw
select sl);
}
}
public static partial class Section
{
public class SectionLink
{
public SectionPoint StartPoint;
public SectionPoint EndPoint;
public readonly int Index;
public readonly SectionLinkType Type;
public SectionLink(SectionPoint startPoint, SectionPoint endPoint, int index, SectionLinkType type)
{
StartPoint = startPoint;
EndPoint = endPoint;
Index = index;
Type = type;
}
}
}
public enum SectionLinkType
{
None = 0, // aeccSectionLinkNone
NoDraw = 1, // aeccSectionLinkNoDraw
All = 2 // aeccSectionLinkAll
}
}