C3D-0034 · READ-ONLY: enumerate parcels, areas and area labels [PARCEL-AREA-2] done
Why does the 30' S.S.E. parcel label 12600.25 sq ft when the outline measures 24157.56? Lists every site/parcel with area and bbox, and every parcel area label with the parcel it actually points at. No changes.
C# payload
// READ-ONLY. Enumerate every site, every parcel, its area, and every parcel area label with the
// parcel it actually points at.
//
// The question: the 30' S.S.E. parcel labels 12600.25 sq ft but the enclosed shape measures
// 24157.56. Either the label belongs to a different parcel than the outline (site topology split
// the easement at a crossing), or there are more parcels here than expected. Nothing is modified.
var civil = CivilApplication.ActiveDocument;
Log("SITES: " + civil.GetSiteIds().Count);
foreach (ObjectId sid in civil.GetSiteIds()) {
var site = (Site)Tx.GetObject(sid, OpenMode.ForRead);
var pids = site.GetParcelIds();
Log("");
Log("SITE \"" + site.Name + "\" parcels=" + pids.Count);
foreach (ObjectId pid in pids) {
var p = (Parcel)Tx.GetObject(pid, OpenMode.ForRead);
double area = 0.0;
try { area = p.Area; } catch { }
var ext = p.GeometricExtents;
Log(String.Format(" [{0}] \"{1}\" num={2} area={3:F2} layer={4} bbox {5:F1}x{6:F1}",
p.ObjectId.Handle, p.Name, p.Number, area, p.Layer,
ext.MaxPoint.X - ext.MinPoint.X, ext.MaxPoint.Y - ext.MinPoint.Y));
}
}
int nlbl = 0;
var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForRead);
foreach (ObjectId id in ms) {
var pal = Tx.GetObject(id, OpenMode.ForRead) as ParcelAreaLabel;
if (pal == null) continue;
nlbl++;
string pname = "?";
double parea = 0.0;
try {
var par = (Parcel)Tx.GetObject(pal.FeatureId, OpenMode.ForRead);
pname = par.Name; parea = par.Area;
} catch { }
Log(String.Format("AREA LABEL [{0}] -> parcel \"{1}\" area={2:F2} at {3:F2},{4:F2}",
pal.ObjectId.Handle, pname, parea, pal.LabelLocation.X, pal.LabelLocation.Y));
}
Log("parcel area labels: " + nlbl);
Result
Log
SITES: 7
SITE "{DBBA330E-324D-4F34-97479ABEBDCF917D}|2" parcels=0
SITE "{DBBA330E-324D-4F34-97479ABEBDCF917D}|3" parcels=0
SITE "{DBBA330E-324D-4F34-97479ABEBDCF917D}" parcels=0
SITE "PROPERTY LINE" parcels=1
[2E1EC] "Property : 1" num=1 area=178277.49 layer=C-PROP bbox 626.8x529.4
SITE "{DBBA330E-324D-4F34-97479ABEBDCF917D}|4" parcels=0
SITE "SEWER EASEMENT" parcels=3
[2EE83] "Basic : 5" num=5 area=11557.31 layer=SS-BOUNDARY bbox 463.6x167.7
[2EE57] "30' S.S.E." num=3 area=12600.25 layer=C-PROP bbox 614.2x212.9
[2EEDA] "20' S.S.E" num=6 area=12082.39 layer=C-PROP bbox 461.5x332.2
SITE "{DBBA330E-324D-4F34-97479ABEBDCF917D}|1" parcels=0
parcel area labels: 0Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.