C3DO-0879 · 251205: read pins, boundary geometry, groups, layouts (read-only) [C3D-SOREAD1205B] error
Read-only: pin/CP points, max point number, point group draw order, boundary polylines/parcel segments, layouts with viewports and paper-space text.
C# payload
string F(double v)=>v.ToString("0.####");
var civ=CivilDoc;
Log("FILE "+Db.Filename);
uint maxn=0;
foreach(ObjectId pid in civ.CogoPoints){ var cp=(Autodesk.Civil.DatabaseServices.CogoPoint)Tx.GetObject(pid,OpenMode.ForRead); if(cp.PointNumber>maxn) maxn=cp.PointNumber;
string d=(cp.RawDescription??"").ToUpper().Trim();
if(d.StartsWith("IP")||d.StartsWith("CP")||d.StartsWith("1")||d.Contains("PIN")||d.Contains("R\\W")||d.Contains("RW")||d.StartsWith("OTP")||d.StartsWith("CTP")||d.StartsWith("RB")||d.StartsWith("POB"))
Log("PT "+cp.PointNumber+","+cp.Northing.ToString("0.0000")+","+cp.Easting.ToString("0.0000")+","+cp.Elevation.ToString("0.000")+","+cp.RawDescription+" | "+cp.Layer); }
Log("MAX PT "+maxn);
Log("== DRAWORDER"); int i=0;
foreach(ObjectId id in civ.PointGroups.DrawOrder){ var g=(Autodesk.Civil.DatabaseServices.PointGroup)Tx.GetObject(id,OpenMode.ForRead); string q=""; try{ q=g.GetQuery().QueryString; }catch{}
Log("["+(i++)+"] "+g.Name+" n="+g.PointsCount+" q="+(q.Length>140?q.Substring(0,140):q)); }
var bt=(BlockTable)Tx.GetObject(Db.BlockTableId,OpenMode.ForRead);
var ms=(BlockTableRecord)Tx.GetObject(bt[BlockTableRecord.ModelSpace],OpenMode.ForRead);
foreach(ObjectId id in ms){ var o=Tx.GetObject(id,OpenMode.ForRead);
if(o is Polyline p && (p.Layer.Contains("BOUNDARY")||p.Layer.StartsWith("C-PROP")||p.Layer=="SS-0-FRAME")){ string s=""; for(int k=0;k<p.NumberOfVertices;k++){ var v=p.GetPoint2dAt(k); s+=F(v.X)+","+F(v.Y)+(p.GetBulgeAt(k)!=0?"(b"+F(p.GetBulgeAt(k))+")":"")+" "; } Log("PL "+p.Handle+" ["+p.Layer+"] closed="+p.Closed+" "+s); }
if(o is Line l && (l.Layer.Contains("BOUNDARY")||l.Layer.StartsWith("C-PROP"))) Log("LN "+l.Handle+" ["+l.Layer+"] "+F(l.StartPoint.X)+","+F(l.StartPoint.Y)+" -> "+F(l.EndPoint.X)+","+F(l.EndPoint.Y)+" len "+F(l.Length));
if(o is Autodesk.Civil.DatabaseServices.ParcelSegment ps){ Log("PSEG "+ps.Handle+" ["+ps.Layer+"] "+F(ps.StartPoint.X)+","+F(ps.StartPoint.Y)+" -> "+F(ps.EndPoint.X)+","+F(ps.EndPoint.Y)+" len "+F(ps.StartPoint.DistanceTo(ps.EndPoint))); }
}
Log("== LAYOUTS");
var ld=(DBDictionary)Tx.GetObject(Db.LayoutDictionaryId,OpenMode.ForRead);
foreach(DBDictionaryEntry de in ld){ var lay=(Layout)Tx.GetObject(de.Value,OpenMode.ForRead); if(lay.ModelType) continue;
Log("LAYOUT "+lay.LayoutName+" tab "+lay.TabOrder+" paper "+lay.CanonicalMediaName+" dev "+lay.PlotConfigurationName+" rot "+lay.PlotRotation+" style "+lay.CurrentStyleSheet);
var psr=(BlockTableRecord)Tx.GetObject(lay.BlockTableRecordId,OpenMode.ForRead);
foreach(ObjectId id in psr){ var o=Tx.GetObject(id,OpenMode.ForRead);
if(o is Viewport vp) Log(" VP "+id.Handle+" num "+vp.Number+" scale 1:"+F(1/vp.CustomScale)+" ctr "+F(vp.CenterPoint.X)+","+F(vp.CenterPoint.Y)+" w "+F(vp.Width)+" h "+F(vp.Height)+" view "+F(vp.ViewCenter.X)+","+F(vp.ViewCenter.Y)+" twist "+F(vp.TwistAngle*180/Math.PI));
else if(o is BlockReference br) Log(" BLK "+br.Name+" at "+F(br.Position.X)+","+F(br.Position.Y));
else if(o is MText mt) Log(" MT "+id.Handle+" at "+F(mt.Location.X)+","+F(mt.Location.Y)+" w "+F(mt.ActualWidth)+" h "+F(mt.ActualHeight)+" att "+mt.Attachment); } }
var tsr=(TextStyleTable)Tx.GetObject(Db.TextStyleTableId,OpenMode.ForRead); Log("SIMPLEX "+tsr.Has("SIMPLEX"));
Result
Log
FILE C:\Users\sanja\OneDrive\_SurveyDisco\251205 - 157 Scenic Hwy N, Lawrenceville, GA 30046, USA\251205 - 157 Scenic Hwy N.dwg PT 143,1435090.3652,2350705.9311,1066.145,IPF 1 IN OTP DISTRB | 0 PT 145,1435145.8097,2350761.0747,1068.815,IPF I 3\4 OTP | 0 PT 195,1435066.8515,2350707.9772,1064.410,1 FT CAP | 0 PT 341,1434840.4906,2350506.3688,1061.037,1 FT CAP | 0 PT 360,1434903.1422,2350563.9158,1062.516,1 TF CAP | 0 PT 373,1434872.7525,2350645.5027,1064.744,1 FT CAP | 0 PT 435,1434771.8066,2350480.5497,1061.515,IPF 1\2 RBF DISTRB | 0 PT 455,1434739.7455,2350501.9532,1064.447,R\W | 0 PT 573,1434940.4994,2350786.8797,1069.109,IPF 1\2 CAPPED RB | 0 PT 575,1434781.2452,2350497.6893,1061.510,IPP | 0 PT 576,1434817.8437,2350461.9271,1061.510,IPP | 0 PT 577,1434971.3123,2350599.3363,1061.510,CP | 0 PT 578,1434877.3052,2350672.1251,1061.510,CP | 0 MAX PT 578 == DRAWORDER [0] CP n=2 q=(RawDescription='CP') AND '' NOT (PointNumber=205) [1] GAS VALVE n=1 q=(PointNumber=538) [2] UTIL n=10 q=(RawDescription='*FLAG*' OR RawDescription='LP' OR RawDescription='CO' OR RawDescription='WM' OR RawDescription='A\C' OR RawDescription='cle [3] WALL n=0 q=(RawDescription='*WALL*') [4] IPF NS n=6 q=(RawDescription='IPP' OR RawDescription='*IPF*' OR RawDescription='SPIKE' OR RawDescription='*IPS*' OR RawDescription='CTP' OR RawDescriptio [5] MH n=11 q=(RawDescription='*MH*' OR RawDescription='*CB*' OR RawDescription='*SEWER*') AND '' NOT (PointNumber=268) [6] DI CB n=5 q=(RawDescription='*DI*' OR RawDescription='*CB*') [7] TREES n=0 q=(RawDescription='*HW*') [8] WALL ELEV n=0 q=(RawDescription='*WALL*') AND '' NOT (PointNumber=131-137 OR PointNumber=173-176 OR PointNumber=187-189 OR PointNumber=199-200 OR PointNumbe [9] PP n=11 q=(RawDescription='*PP*') [10] FH n=1 q=(RawDescription='FH') [11] WV n=0 q=(RawDescription='WV') [12] POB n=0 q=(RawDescription='POB') AND '' NOT (PointNumber=205) [13] FF n=1 q=(RawDescription='FF*') AND '' NOT (PointNumber=135 OR PointNumber=136 OR PointNumber=137 OR PointNumber=84) [14] No Display n=479 q=(PointNumber>0) [15] CON n=59 q=(RawDescription='*CON*') [16] Display [SPECIFIC] n=93 q=(RawDescription='A/C' OR RawDescription='CHIMNEY' OR RawDescription='POWER METER' OR RawDescription='*DWY*' OR RawDescription='*SW*' OR RawD [17] TOPO n=475 q=(PointNumber>0) AND '' NOT (RawDescription='CP' OR RawDescription='IPP') [18] TBC n=119 q=(RawDescription='*TBC*') [19] FENCE n=31 q=(RawDescription='*FC*' OR RawDescription='*FL*') [20] NORTHING_EASTING n=4 q=(RawDescription='IPP' OR RawDescription='CP') [21] CL n=19 q=(RawDescription='*CL*') [22] GAS n=30 q=(RawDescription='*GAS*') [23] BUILDING n=6 q=(RawDescription='LP' OR RawDescription='*BLDG*' OR RawDescription='*HC*') [24] _All Points n=479 q=(PointNumber>0)
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.