C3D-PTSTYLE · Point styles and TBC group settings done
Read-only: available point styles, every point group with its point/label style overrides, and the style + layer on a sample of TBC points.
C# payload
// READ-ONLY: how the TBC points get their colour - point styles available, and what the TBC
// point group + the points themselves are currently using.
var cd = CivilDoc;
Log("=== point styles in the drawing ===");
foreach (ObjectId id in cd.Styles.PointStyles) {
var st = Tx.GetObject(id, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Styles.PointStyle;
if (st == null) continue;
Log(" '" + st.Name + "'");
}
Log("=== point groups ===");
foreach (ObjectId id in cd.PointGroups) {
var pg = Tx.GetObject(id, OpenMode.ForRead) as PointGroup;
if (pg == null) continue;
uint[] nums; try { nums = pg.GetPointNumbers(); } catch { nums = new uint[0]; }
string ps = "(none)", ls = "(none)";
bool po = false, lo = false;
try { po = pg.IsPointStyleOverridden; if (!pg.PointStyleId.IsNull) {
var s2 = Tx.GetObject(pg.PointStyleId, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Styles.PointStyle;
if (s2 != null) ps = s2.Name; } } catch {}
try { lo = pg.IsPointLabelStyleOverridden; if (!pg.PointLabelStyleId.IsNull) {
var s3 = Tx.GetObject(pg.PointLabelStyleId, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Styles.LabelStyle;
if (s3 != null) ls = s3.Name; } } catch {}
Log(" '" + pg.Name + "' pts=" + nums.Length + " pointStyle='" + ps + "' override=" + po +
" labelStyle='" + ls + "' override=" + lo);
}
Log("=== a few TBC points: their own style + layer ===");
int shown = 0;
foreach (ObjectId id in cd.CogoPoints) {
var cp = Tx.GetObject(id, OpenMode.ForRead) as CogoPoint;
if (cp == null) continue;
var d = (cp.RawDescription ?? "").ToUpper();
if (!d.Contains("TBC")) continue;
string sn = "(none)";
try { if (!cp.StyleId.IsNull) {
var s4 = Tx.GetObject(cp.StyleId, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Styles.PointStyle;
if (s4 != null) sn = s4.Name; } } catch {}
Log(" pt " + cp.PointNumber + " layer='" + cp.Layer + "' style='" + sn + "' '" + cp.RawDescription + "'");
if (++shown >= 5) break;
}
Result
Log
=== point styles in the drawing === 'Horizontal Curve Point' 'Water Shutoff' 'Benchmark' 'Gas Valve' 'Vertical Curve Point' 'Guy Pole' 'Bound' 'Shrub - 5ft' 'STA' 'Iron Pin [LARGE]' 'Catch Basin' 'Storm Sewer Manhole' 'Sign (single pole)' 'Gas METER' 'Tree' 'Utility Pole' 'Well' 'Sanitary Sewer Manhole' 'Iron Pin' 'Hydrant (proposed)' 'Basic' 'Drill Hole' 'Water Valve' 'Standard' 'Test Pit' 'Hydrant (existing)' === point groups === 'TBC' pts=184 pointStyle='Test Pit' override=True labelStyle='(none)' override=True 'CL' pts=27 pointStyle='Drill Hole' override=False labelStyle='Point#-Elevation-Description [HANDICAP]' override=False 'IPA' pts=0 pointStyle='Iron Pin [LARGE]' override=False labelStyle='Northing and Easting' override=False 'NORTHING_EASTING' pts=0 pointStyle='Iron Pin [LARGE]' override=False labelStyle='Northing and Easting' override=False 'UTIL' pts=16 pointStyle='Test Pit' override=False labelStyle='Description Only' override=False 'CP' pts=0 pointStyle='Iron Pin' override=False labelStyle='(none)' override=False 'GAS VALVE' pts=0 pointStyle='Gas METER' override=False labelStyle='Description Only' override=False 'IPF NS' pts=0 pointStyle='Iron Pin' override=False labelStyle='Description Only' override=False 'MH' pts=25 pointStyle='Storm Sewer Manhole' override=False labelStyle='Elevation and Description' override=False 'DI CB' pts=15 pointStyle='Catch Basin' override=False labelStyle='Elevation and Description' override=False 'TREES' pts=0 pointStyle='Tree' override=False labelStyle='Description Only' override=False 'PP' pts=2 pointStyle='Utility Pole' override=False labelStyle='(none)' override=False 'FH' pts=5 pointStyle='Hydrant (existing)' override=False labelStyle='(none)' override=False 'WV' pts=9 pointStyle='Water Valve' override=False labelStyle='(none)' override=False 'FF' pts=0 pointStyle='Basic' override=False labelStyle='Elevation and Description' override=False '_All Points' pts=568 pointStyle='Basic' override=False labelStyle='Point#-Elevation-Description' override=False 'No Display' pts=568 pointStyle='(none)' override=False labelStyle='(none)' override=False 'CON' pts=51 pointStyle='(none)' override=False labelStyle='(none)' override=False 'TOPO' pts=568 pointStyle='Basic' override=False labelStyle='Point#-Elevation-Description' override=False 'FENCE' pts=0 pointStyle='Basic' override=False labelStyle='Point#-Elevation-Description' override=False 'POB' pts=0 pointStyle='Drill Hole' override=False labelStyle='Northing and Easting' override=False 'GAS' pts=0 pointStyle='Test Pit' override=False labelStyle='Description Only' override=False 'WALL ELEV' pts=6 pointStyle='Standard' override=False labelStyle='Elevation and Description' override=False 'WALL' pts=6 pointStyle='Test Pit' override=False labelStyle='(none)' override=False 'BUILDING' pts=9 pointStyle='Basic' override=False labelStyle='Description Only' override=False === a few TBC points: their own style + layer === pt 100 layer='0' style='(none)' 'TBC' pt 103 layer='0' style='(none)' 'TBC' pt 104 layer='0' style='(none)' 'TBC' pt 105 layer='0' style='(none)' 'TBC' pt 106 layer='0' style='(none)' 'TBC'
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.