C3D-260619-GEO · Geometry for redline 2 and 12 done
Read-only: SS-HERO TRACT A lines with azimuths, the bearing-label blocks on TRACT A ANNO, land lot lines, and IPF/IPS control points for the POB tie.
C# payload
// READ-ONLY: geometry needed for redline #12 (POB label + tie) and #2 (bearing quadrants).
// #12 deed POB is described as ~ on the N line of LL 143, ~75' W of the NE corner.
// #2 needs the Tract "A" bearing labels - find what carries them now (they are BlockReferences
// on SS-HERO TRACT A ANNO since the user exploded the parcel labels).
var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForRead);
Log("=== SS-HERO TRACT A geometry (the tract A lines) ===");
foreach (ObjectId id in ms)
{
var e = Tx.GetObject(id, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
if (e == null || e.Layer != "SS-HERO TRACT A") continue;
var ln = e as Line;
if (ln != null) {
double dx = ln.EndPoint.X-ln.StartPoint.X, dy = ln.EndPoint.Y-ln.StartPoint.Y;
double az = System.Math.Atan2(dx,dy)*180.0/System.Math.PI; if (az<0) az+=360;
Log(" Line h=" + e.Handle + " (" + ln.StartPoint.X.ToString("F2") + "," + ln.StartPoint.Y.ToString("F2") + ") -> (" +
ln.EndPoint.X.ToString("F2") + "," + ln.EndPoint.Y.ToString("F2") + ") len=" + ln.Length.ToString("F2") +
" az=" + az.ToString("F4"));
continue;
}
var pl = e as Polyline;
if (pl != null) {
Log(" Polyline h=" + e.Handle + " verts=" + pl.NumberOfVertices + " len=" + pl.Length.ToString("F2") + " closed=" + pl.Closed);
for (int i = 0; i < pl.NumberOfVertices; i++) {
var p = pl.GetPoint2dAt(i);
Log(" v" + i + " (" + p.X.ToString("F2") + "," + p.Y.ToString("F2") + ")");
}
continue;
}
Log(" " + e.GetType().Name + " h=" + e.Handle);
}
Log("=== SS-HERO TRACT A ANNO contents (the bearing labels, #2) ===");
foreach (ObjectId id in ms)
{
var br = Tx.GetObject(id, OpenMode.ForRead) as BlockReference;
if (br == null || br.Layer != "SS-HERO TRACT A ANNO") continue;
var def = (BlockTableRecord)Tx.GetObject(br.BlockTableRecord, OpenMode.ForRead);
var texts = new List<string>();
foreach (ObjectId cid in def) {
var ce = Tx.GetObject(cid, OpenMode.ForRead);
var t1 = ce as DBText; if (t1 != null) texts.Add(t1.TextString);
var t2 = ce as MText; if (t2 != null) texts.Add(t2.Contents.Replace("\u005CP"," | "));
}
Log(" BlockRef h=" + br.Handle + " block='" + def.Name + "' at (" + br.Position.X.ToString("F2") + "," + br.Position.Y.ToString("F2") + ")");
foreach (var t in texts) Log(" \"" + t + "\"");
}
Log("=== land lot lines / LL 143 north line (for the POB tie) ===");
foreach (ObjectId id in ms)
{
var e = Tx.GetObject(id, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
if (e == null || e.Layer != "SS-BOUNDARY LAND LOT") continue;
var ln = e as Line;
if (ln != null) Log(" Line h=" + e.Handle + " (" + ln.StartPoint.X.ToString("F2") + "," + ln.StartPoint.Y.ToString("F2") + ") -> (" +
ln.EndPoint.X.ToString("F2") + "," + ln.EndPoint.Y.ToString("F2") + ") len=" + ln.Length.ToString("F2"));
var pl = e as Polyline;
if (pl != null) {
Log(" Polyline h=" + e.Handle + " verts=" + pl.NumberOfVertices + " len=" + pl.Length.ToString("F2"));
for (int i = 0; i < pl.NumberOfVertices && i < 12; i++) { var p = pl.GetPoint2dAt(i); Log(" v" + i + " (" + p.X.ToString("F2") + "," + p.Y.ToString("F2") + ")"); }
}
var mt = e as MText; if (mt != null) Log(" MText h=" + e.Handle + " at (" + mt.Location.X.ToString("F2") + "," + mt.Location.Y.ToString("F2") + ") '" + mt.Contents.Replace("\u005CP"," | ") + "'");
}
Log("=== IPF/IPS control points near the NE (POB reference) ===");
var cdoc = CivilDoc;
foreach (ObjectId pid in cdoc.CogoPoints)
{
var p = Tx.GetObject(pid, OpenMode.ForRead) as CogoPoint;
if (p == null) continue;
var d = (p.RawDescription ?? "").ToUpper();
if (!(d.Contains("IPF") || d.Contains("IPS") || d.Contains("CTP") || d.Contains("OTP") || d.Contains("POB"))) continue;
Log(" PT " + p.PointNumber + " (" + p.Easting.ToString("F2") + "," + p.Northing.ToString("F2") + ") '" + p.RawDescription + "'");
}
Result
Log
=== SS-HERO TRACT A geometry (the tract A lines) ===
Polyline h=22726 verts=5 len=840.00 closed=True
v0 (2165127.01,1330653.36)
v1 (2164917.01,1330653.39)
v2 (2164878.17,1330447.01)
v3 (2165078.00,1330438.89)
v4 (2165127.01,1330653.36)
Line h=22737 (2166868.33,1330720.27) -> (2166658.33,1330720.29) len=210.00 az=270.0067
Line h=22738 (2166658.33,1330720.29) -> (2166619.50,1330513.91) len=210.00 az=190.6574
Line h=22739 (2166609.90,1330462.90) -> (2166803.73,1330437.52) len=195.49 az=97.4588
Line h=2273A (2166819.33,1330505.79) -> (2166868.33,1330720.27) len=220.00 az=12.8697
Line h=2273B (2166868.33,1330720.27) -> (2166868.33,1330720.27) len=0.00 az=0.0000
Line h=22749 (2166609.90,1330462.90) -> (2166619.50,1330513.91) len=51.91 az=10.6574
=== SS-HERO TRACT A ANNO contents (the bearing labels, #2) ===
BlockRef h=226DC block='*U200' at (0.00,0.00)
"N10\U+00B0 39' 27"E | 210.00'"
BlockRef h=226E2 block='*U201' at (0.00,0.00)
"S89\U+00B0 59' 36"E"
"210.00'"
BlockRef h=226E8 block='*U202' at (0.00,0.00)
"S12\U+00B0 52' 11"W"
"220.00'"
BlockRef h=226EE block='*U203' at (0.00,0.00)
"N87\U+00B0 40' 24"W"
"200.00'"
BlockRef h=22700 block='*U206' at (0.00,0.00)
"S89\U+00B0 59' 36"E"
"55.89'"
BlockRef h=22706 block='*U207' at (0.00,0.00)
"S10\U+00B0 39' 27"W"
"210.00'"
=== land lot lines / LL 143 north line (for the POB tie) ===
MText h=20CB3 at (2166470.17,1330824.36) 'L.L. 142'
MText h=20CB4 at (2166694.89,1330833.24) 'L.L. 126'
MText h=20CB5 at (2166472.44,1330692.53) 'L.L. 143'
MText h=20CB6 at (2166695.45,1330692.52) 'L.L. 125'
Line h=21052 (2166604.61,1331173.39) -> (2166604.61,1329681.45) len=1491.94
Line h=21053 (2165816.44,1330757.40) -> (2166977.28,1330757.40) len=1160.84
Polyline h=2296A verts=4 len=100.16
v0 (2166675.05,1330838.18)
v1 (2166714.92,1330838.18)
v2 (2166714.92,1330827.97)
v3 (2166675.05,1330827.97)
Polyline h=2296B verts=4 len=104.16
v0 (2166674.55,1330838.68)
v1 (2166715.42,1330838.68)
v2 (2166715.42,1330827.47)
v3 (2166674.55,1330827.47)
Polyline h=22974 verts=4 len=100.16
v0 (2166675.31,1330697.83)
v1 (2166715.19,1330697.83)
v2 (2166715.19,1330687.62)
v3 (2166675.31,1330687.62)
Polyline h=22975 verts=4 len=104.16
v0 (2166674.81,1330698.33)
v1 (2166715.69,1330698.33)
v2 (2166715.69,1330687.12)
v3 (2166674.81,1330687.12)
Polyline h=2297E verts=4 len=100.16
v0 (2166452.29,1330697.48)
v1 (2166492.16,1330697.48)
v2 (2166492.16,1330687.27)
v3 (2166452.29,1330687.27)
Polyline h=2297F verts=4 len=104.16
v0 (2166451.79,1330697.98)
v1 (2166492.66,1330697.98)
v2 (2166492.66,1330686.77)
v3 (2166451.79,1330686.77)
Polyline h=22988 verts=4 len=100.16
v0 (2166450.25,1330829.38)
v1 (2166490.12,1330829.38)
v2 (2166490.12,1330819.17)
v3 (2166450.25,1330819.17)
Polyline h=22989 verts=4 len=104.16
v0 (2166449.75,1330829.88)
v1 (2166490.62,1330829.88)
v2 (2166490.62,1330818.67)
v3 (2166449.75,1330818.67)
Line h=229EB (2165443.88,1330750.10) -> (2166985.69,1330750.10) len=1541.81
=== IPF/IPS control points near the NE (POB reference) ===
PT 479 (2166608.70,1330889.78) 'IPF 2 IN OTP'
PT 506 (2166529.85,1330757.40) 'IPF 1 IN CTP'
PT 508 (2166393.50,1330090.88) 'IPF'
PT 510 (2166424.92,1330759.69) 'IPF'
PT 522 (2166609.13,1330752.55) 'IPF'
PT 524 (2166868.33,1330720.27) 'IPS'
PT 525 (2166658.33,1330720.29) 'IPS'
PT 526 (2166602.44,1330720.30) 'IPS'
PT 527 (2166604.72,1330750.10) 'IPS'
PT 532 (2166803.73,1330437.52) 'IPS'
PT 533 (2166609.90,1330462.90) 'IPS'Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.