← Inbox

C3D-READCURB2 · Read whats on the curb layer done

Read-only: every entity on SS-V-ROAD-CURB with vertex count, length, and endpoints. Entity fully qualified to avoid ambiguous reference.

Script file
C3D-READCURB2.cs
Target
active document · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

// READ-ONLY: read what is actually on SS-V-ROAD-CURB in the drawing right now.
// Entity is ambiguous (AutoCAD vs Civil namespaces both imported by host) - fully qualify it.
const string LAYER = "SS-V-ROAD-CURB";
int n = 0;
foreach (ObjectId id in ModelSpace)
{
    var ent = Tx.GetObject(id, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
    if (ent == null || ent.Layer != LAYER) continue;
    n++;
    var p3 = ent as Polyline3d;
    if (p3 != null)
    {
        var vs = new List<Point3d>();
        foreach (ObjectId vid in p3)
        {
            var v = Tx.GetObject(vid, OpenMode.ForRead) as PolylineVertex3d;
            if (v != null) vs.Add(v.Position);
        }
        double len = 0;
        for (int i = 1; i < vs.Count; i++) len += vs[i].DistanceTo(vs[i-1]);
        var s0 = vs.Count > 0 ? vs[0] : Point3d.Origin;
        var s1 = vs.Count > 0 ? vs[vs.Count-1] : Point3d.Origin;
        Log($"P3D h={ent.Handle} verts={vs.Count} len={len:F1} start=({s0.X:F2},{s0.Y:F2}) end=({s1.X:F2},{s1.Y:F2})");
    }
    else
    {
        Log($"{ent.GetType().Name} h={ent.Handle}");
    }
}
Log($"Total {n} entities on {LAYER}.");

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260709 - 1512 Bass Rd, Macon, GA 31210, USA\260709 - 1512 Bass Rd.dwg
Message
Executed C3D-READCURB2 (0 entities touched).
Entities
Duration
339 ms
Civil 3D
25.0.0.0

Log

Line h=1C90F
Line h=1C910
Polyline h=1D0AC
FeatureLine h=1D0AF
FeatureLine h=1D0B0
FeatureLine h=1D0B1
FeatureLine h=1D0B6
Line h=1D0B7
Polyline h=1D0B9
Polyline h=1D0BA
Polyline h=1D0BD
Polyline h=1D0BE
Polyline h=1D0BF
FeatureLine h=1D0C0
FeatureLine h=1D0C1
Line h=1D0C8
Polyline h=1D0C9
Polyline h=1D0CA
FeatureLine h=1D0CB
Line h=1D0DD
Line h=1D0DE
Polyline h=1D0DF
FeatureLine h=1D140
FeatureLine h=1D174
FeatureLine h=1D178
Line h=1D17A
Line h=1D31F
Line h=1D320
Line h=1D321
Line h=1D322
Line h=1D323
Site h=1D3D5
Hatch h=1D446
Wipeout h=1D6A6
AlignedDimension h=1EB1A
AlignedDimension h=1EB34
AlignedDimension h=1EB4E
AlignedDimension h=1EB68
AlignedDimension h=1EB82
AlignedDimension h=1EB9C
AlignedDimension h=1EBB6
FeatureLine h=1EF7C
Polyline h=1EF80
Polyline h=1EF81
Polyline h=1EF8A
Polyline h=1EF8B
Polyline h=1EF8C
Polyline h=1EF8D
Line h=1EF96
Line h=1EF97
Line h=1EF98
Line h=1EF99
AlignedDimension h=1F38B
AlignedDimension h=1F3A5
AlignedDimension h=1F3BF
Line h=1F575
Line h=1F576
P3D h=20CE2 verts=5 len=90.9 start=(2428141.27,1064465.53) end=(2428135.26,1064529.86)
P3D h=20CE9 verts=4 len=45.0 start=(2428098.86,1064560.50) end=(2428085.57,1064577.81)
P3D h=20CEF verts=8 len=63.1 start=(2427895.79,1064547.77) end=(2427855.39,1064505.01)
P3D h=20CF9 verts=8 len=70.5 start=(2427983.53,1064712.47) end=(2428016.97,1064742.06)
P3D h=20D03 verts=2 len=3.2 start=(2428023.77,1064744.33) end=(2428026.93,1064744.86)
P3D h=20D07 verts=2 len=10.3 start=(2428041.49,1064735.59) end=(2428044.86,1064725.90)
P3D h=20D0B verts=8 len=25.4 start=(2428065.81,1064742.28) end=(2428076.77,1064761.61)
P3D h=20D15 verts=8 len=93.8 start=(2428083.96,1064764.03) end=(2428169.43,1064773.43)
P3D h=20D1F verts=7 len=68.5 start=(2428059.46,1064777.83) end=(2428109.64,1064812.99)
P3D h=20D28 verts=2 len=8.2 start=(2428152.42,1064827.01) end=(2428152.06,1064835.18)
P3D h=20D2C verts=8 len=72.5 start=(2428107.41,1064820.85) end=(2428061.11,1064824.00)
P3D h=20D36 verts=4 len=54.0 start=(2428052.68,1064821.24) end=(2428001.48,1064804.29)
P3D h=20D3C verts=5 len=51.8 start=(2427994.88,1064802.03) end=(2427960.05,1064772.15)
P3D h=20D43 verts=7 len=39.0 start=(2427993.49,1064774.78) end=(2428010.92,1064761.89)
P3D h=20D4C verts=2 len=24.4 start=(2428017.25,1064763.88) end=(2428040.34,1064771.62)
P3D h=20D50 verts=15 len=103.6 start=(2427983.14,1064820.25) end=(2428064.48,1064848.86)
P3D h=20D61 verts=17 len=108.9 start=(2427933.18,1064803.66) end=(2427932.71,1064730.11)
P3D h=20D74 verts=19 len=256.9 start=(2427885.49,1064728.61) end=(2427733.10,1064718.22)
P3D h=20D89 verts=10 len=115.5 start=(2427753.24,1064651.18) end=(2427778.32,1064665.46)
P3D h=20D95 verts=11 len=107.7 start=(2427796.19,1064605.18) end=(2427805.76,1064573.24)
P3D h=20DB8 verts=7 len=103.4 start=(2427889.22,1064480.15) end=(2427950.76,1064484.57)
P3D h=20DC1 verts=9 len=34.5 start=(2427915.77,1064450.71) end=(2427942.84,1064453.12)
P3D h=20DCC verts=12 len=123.9 start=(2427976.43,1064514.09) end=(2427976.67,1064469.87)
P3D h=20DDA verts=22 len=118.7 start=(2428009.98,1064526.05) end=(2428058.41,1064522.83)
P3D h=20DF2 verts=5 len=74.0 start=(2427999.30,1064444.49) end=(2428042.37,1064502.49)
P3D h=20DF9 verts=5 len=35.8 start=(2427981.34,1064423.05) end=(2428006.87,1064399.52)
P3D h=20E00 verts=14 len=59.4 start=(2428045.95,1064370.83) end=(2428068.04,1064371.91)
P3D h=20E10 verts=6 len=57.9 start=(2428104.89,1064444.99) end=(2428123.35,1064442.77)
P3D h=20E18 verts=7 len=104.4 start=(2428111.61,1064367.07) end=(2428169.77,1064452.57)
P3D h=20E21 verts=6 len=26.7 start=(2428196.65,1064492.69) end=(2428221.37,1064498.72)
P3D h=20E29 verts=5 len=104.3 start=(2428301.11,1064567.16) end=(2428221.85,1064499.40)
P3D h=20E30 verts=16 len=191.7 start=(2427809.34,1064557.12) end=(2427852.74,1064488.51)
Line h=20F1A
Line h=20F1B
Line h=20F1C
Line h=20F1D
Line h=20F1E
Line h=20F1F
Line h=20F20
Line h=20F21
Line h=20F22
Line h=20F23
Line h=20F24
Line h=20F25
Line h=20F26
Line h=20F27
Line h=20F28
Line h=20F29
Line h=20F2C
Line h=20F2D
Total 107 entities on SS-V-ROAD-CURB.

Notes

What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.

No notes yet.