C3D-0131 · READ-ONLY: linework snapshot AFTER manual edits [SNAP-AFTER] done
Second snapshot of every polyline, line and arc outside layer 0 with full vertex coordinates, per-vertex bulge, closed flag, length and area, to diff against the pre-edit baseline and capture the arc and closure conventions the user applied by hand. No changes.
C# payload
// READ-ONLY SNAPSHOT of all linework, for diffing against a second snapshot after the user's
// manual edits (arcs via bulges, closed buildings, re-drawn sections).
//
// Captures per polyline: handle, layer, closed flag, vertex count, length, area if closed, and
// EVERY vertex with its BULGE - the bulge is what turns a straight segment into an arc, so it is
// the field that proves an edit happened. Nothing is modified.
var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForRead);
Log("SNAPSHOT drawing: " + Db.Filename);
int n = 0, arcs = 0, closed = 0;
foreach (ObjectId id in ms) {
Autodesk.AutoCAD.DatabaseServices.DBObject o;
try { o = Tx.GetObject(id, OpenMode.ForRead); } catch { continue; }
var ent = o as Autodesk.AutoCAD.DatabaseServices.Entity;
if (ent == null) continue;
var pl = o as Polyline;
var ln = o as Line;
var ar = o as Arc;
if (pl == null && ln == null && ar == null) continue;
string lay; try { lay = ent.Layer; } catch { continue; }
if (lay == "0") continue; // points/blocks live there; linework does not
n++;
if (pl != null) {
if (pl.Closed) closed++;
int nb = 0;
for (int i = 0; i < pl.NumberOfVertices; i++) if (Math.Abs(pl.GetBulgeAt(i)) > 1e-9) nb++;
if (nb > 0) arcs++;
Log(String.Format("POLY [{0}] {1} closed={2} verts={3} len={4:F3} area={5:F3} arcsegs={6}",
pl.Handle, lay, pl.Closed, pl.NumberOfVertices, pl.Length, pl.Closed ? pl.Area : 0.0, nb));
for (int i = 0; i < pl.NumberOfVertices; i++) {
var v = pl.GetPoint2dAt(i);
Log(String.Format(" V {0} {1:F4} {2:F4} bulge={3:F6}", i, v.X, v.Y, pl.GetBulgeAt(i)));
}
} else if (ln != null) {
Log(String.Format("LINE [{0}] {1} len={2:F3} {3:F4},{4:F4} -> {5:F4},{6:F4}",
ln.Handle, lay, ln.Length, ln.StartPoint.X, ln.StartPoint.Y, ln.EndPoint.X, ln.EndPoint.Y));
} else {
Log(String.Format("ARC [{0}] {1} r={2:F3} len={3:F3} centre={4:F4},{5:F4}",
ar.Handle, lay, ar.Radius, ar.Length, ar.Center.X, ar.Center.Y));
}
}
Log("");
Log("SNAPSHOT TOTALS: entities=" + n + " closed polylines=" + closed + " polylines with arc segments=" + arcs);
Result
Log
SNAPSHOT drawing: C:\Users\sanja\OneDrive\_SurveyDisco\260802 - 4082 Sweetbriar Ln, Forest Park, GA 30297, USA\260802 - 4082 Sweetbriar Ln.dwg POLY [20AD7] SS-V-ROAD-CNTR closed=False verts=3 len=187.556 area=0.000 arcsegs=0 V 0 2238231.9730 1325302.3760 bulge=0.000000 V 1 2238219.0610 1325270.8120 bulge=0.000000 V 2 2238164.5240 1325127.3775 bulge=0.000000 POLY [20AD8] SS-V-ROAD-CNTR closed=False verts=8 len=191.853 area=0.000 arcsegs=0 V 0 2238247.3300 1325258.8210 bulge=0.000000 V 1 2238270.1940 1325245.3390 bulge=0.000000 V 2 2238295.3760 1325226.3080 bulge=0.000000 V 3 2238315.7150 1325209.3060 bulge=0.000000 V 4 2238319.8060 1325205.1570 bulge=0.000000 V 5 2238340.2280 1325181.0830 bulge=0.000000 V 6 2238356.6930 1325159.5920 bulge=0.000000 V 7 2238377.4800 1325122.2160 bulge=0.000000 POLY [20AD9] SS-V-ROAD-CURB closed=False verts=4 len=193.164 area=0.000 arcsegs=0 V 0 2238150.2048 1325128.6713 bulge=0.000000 V 1 2238193.9930 1325240.9330 bulge=0.000000 V 2 2238207.5960 1325275.4690 bulge=0.000000 V 3 2238220.5470 1325308.5720 bulge=0.000000 POLY [20ADB] SS-V-ROAD-CURB closed=False verts=9 len=176.259 area=0.000 arcsegs=1 V 0 2238366.3900 1325113.7110 bulge=0.000000 V 1 2238357.0880 1325133.3980 bulge=0.024290 V 2 2238344.2040 1325154.0180 bulge=0.000000 V 3 2238331.0420 1325172.5560 bulge=0.000000 V 4 2238311.5980 1325195.2670 bulge=0.000000 V 5 2238307.7550 1325199.3850 bulge=0.000000 V 6 2238288.0860 1325216.7030 bulge=0.000000 V 7 2238264.8800 1325233.8790 bulge=0.000000 V 8 2238250.3390 1325242.3300 bulge=0.000000 POLY [20ADC] SS-V-ROAD-CURB closed=False verts=3 len=153.516 area=0.000 arcsegs=1 V 0 2238250.3390 1325242.3300 bulge=0.442505 V 1 2238218.0960 1325229.7990 bulge=0.000000 V 2 2238176.1115 1325123.1974 bulge=0.000000 POLY [20ADD] SS-V-ROAD-CURB closed=False verts=10 len=229.800 area=0.000 arcsegs=1 V 0 2238387.7660 1325130.7040 bulge=0.000000 V 1 2238370.0430 1325162.5600 bulge=0.000000 V 2 2238368.0550 1325165.8550 bulge=0.000000 V 3 2238351.4930 1325189.1020 bulge=0.000000 V 4 2238328.6940 1325215.6130 bulge=0.000000 V 5 2238325.4450 1325219.0870 bulge=0.000000 V 6 2238303.2480 1325237.8560 bulge=0.000000 V 7 2238277.5060 1325257.0050 bulge=0.000000 V 8 2238251.6550 1325271.1000 bulge=-0.351622 V 9 2238244.4926 1325298.5341 bulge=0.000000 POLY [20ADE] V-STRC-WALL closed=False verts=2 len=102.948 area=0.000 arcsegs=0 V 0 2238288.1370 1325091.5650 bulge=0.000000 V 1 2238192.0170 1325128.4341 bulge=0.000000 POLY [20AE0] X-DRIV-CONC closed=False verts=5 len=106.058 area=0.000 arcsegs=2 V 0 2238258.9117 1325118.0646 bulge=0.000000 V 1 2238196.3140 1325145.0660 bulge=0.158468 V 2 2238184.6500 1325144.4770 bulge=0.000000 V 3 2238190.1460 1325158.6880 bulge=0.072807 V 4 2238199.1040 1325152.7690 bulge=0.000000 POLY [20AE2] X-DRIV-CONC closed=False verts=2 len=15.237 area=0.000 arcsegs=0 V 0 2238190.1460 1325158.6880 bulge=0.000000 V 1 2238184.6500 1325144.4770 bulge=0.000000 POLY [20AE3] X-DRIV-CONC closed=False verts=2 len=68.777 area=0.000 arcsegs=0 V 0 2238199.1045 1325152.7686 bulge=0.000000 V 1 2238262.7959 1325126.8133 bulge=0.000000 POLY [20AE4] X-DRIV-CONC closed=False verts=2 len=9.571 area=0.000 arcsegs=0 V 0 2238262.7960 1325126.8130 bulge=0.000000 V 1 2238258.9120 1325118.0650 bulge=0.000000 POLY [20AE5] X-DRIV-CONC closed=False verts=5 len=95.011 area=0.000 arcsegs=0 V 0 2238246.6590 1325145.2150 bulge=0.000000 V 1 2238255.6312 1325169.6896 bulge=0.000000 V 2 2238276.4590 1325160.4790 bulge=0.000000 V 3 2238265.6600 1325137.2880 bulge=0.000000 V 4 2238246.6590 1325145.2150 bulge=0.000000 POLY [20AE6] SS-V-ROAD-EPVM closed=False verts=5 len=37.446 area=0.000 arcsegs=0 V 0 2238237.0070 1325154.4450 bulge=0.000000 V 1 2238238.9992 1325153.2448 bulge=0.000000 V 2 2238233.0418 1325138.4314 bulge=0.000000 V 3 2238230.3946 1325139.5815 bulge=0.000000 V 4 2238237.0070 1325154.4450 bulge=0.000000 POLY [20AFC] V-STRC-WALL closed=False verts=2 len=102.948 area=0.000 arcsegs=0 V 0 2238287.6874 1325090.8927 bulge=0.000000 V 1 2238191.5674 1325127.7618 bulge=0.000000 POLY [20AFE] BLOCK_LEGEND closed=True verts=4 len=229.078 area=89.672 arcsegs=0 V 0 2238288.1370 1325091.5646 bulge=0.000000 V 1 2238287.6874 1325090.8927 bulge=0.000000 V 2 2238181.4834 1325131.5787 bulge=0.000000 V 3 2238181.9330 1325132.2510 bulge=0.000000 POLY [20B0E] SS-X-FENCE closed=False verts=2 len=75.190 area=0.000 arcsegs=0 V 0 2238353.3795 1325129.1451 bulge=0.000000 V 1 2238288.3229 1325091.4475 bulge=0.000000 POLY [20B11] SS-BOUNDARY closed=True verts=4 len=448.942 area=12573.774 arcsegs=1 V 0 2238288.1135 1325091.8867 bulge=0.000000 V 1 2238346.6733 1325126.3188 bulge=0.162427 V 2 2238232.7806 1325236.9227 bulge=0.000000 V 3 2238191.2339 1325128.8560 bulge=0.000000 SNAPSHOT TOTALS: entities=17 closed polylines=2 polylines with arc segments=5
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.