← Inbox

C3DO-0880 · 251205: read pins, boundary geometry, groups, layouts (read-only) [C3D-SOREAD1205C] done

Read-only: pin/CP points, max point number, point group draw order, boundary polylines/parcel segments, layouts with viewports and paper-space text.

Script file
C3DO-0880.cs
Target
251205 - 157 Scenic Hwy N.dwg · model space
Author
claude
Approved
yes · read-only
Timeout
60s

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){ try{ 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))); }
 }catch(System.Exception ex){ Log("ERR "+id.Handle+" "+ex.Message); } }
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

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\251205 - 157 Scenic Hwy N, Lawrenceville, GA 30046, USA\251205 - 157 Scenic Hwy N.dwg
Message
Executed C3DO-0880 (0 entities touched).
Entities
—
Duration
649 ms
Civil 3D
25.0.0.0

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)
ERR 101C9 eNotApplicable
LN 20AC5 [SS-BOUNDARY MAG] 2351586.2606,1434988.391 -> 2351676.2606,1434988.391 len 90
LN 20AC8 [SS-BOUNDARY MAG] 2351676.2606,1434988.391 -> 2351662.405,1434839.0323 len 150
LN 20ACB [SS-BOUNDARY MAG] 2351662.405,1434839.0323 -> 2351657.26,1434783.5705 len 55.7
LN 20ACE [SS-BOUNDARY MAG] 2351657.26,1434783.5705 -> 2351544.1018,1434789.2368 len 113.3
LN 20AD2 [SS-BOUNDARY MAG] 2351512.6357,1434840.2448 -> 2351543.5543,1434846.2688 len 31.5
LN 20AD5 [SS-BOUNDARY MAG] 2351543.5543,1434846.2688 -> 2351586.2606,1434988.391 len 148.4
LN 20AE8 [SS-BOUNDARY MAG] 2351527.5551,1434988.391 -> 2351586.2606,1434988.391 len 58.7055
LN 20AE9 [SS-BOUNDARY MAG] 2351676.2606,1434988.391 -> 2351720.7915,1434988.391 len 44.5308
PL 20AF3 [SS-BOUNDARY] closed=True 2351517.8161,1434834.7168 2351548.5098,1434841.7983 2351586.3136,1434985.3024 2351676.2606,1434988.391 2351664.3002,1434783.039 2351551.0142,1434784.8187 
LN 20D6D [SS-BOUNDARY MAG] 2351676.2606,1434988.391 -> 2351664.4266,1434784.9613 len 203.7833
PL 20DF2 [SS-0-FRAME] closed=False 2351528.0913,1434849.702 2351537.2959,1434853.7023 2351539.0727,1434863.7649 2351541.0195,1434894.7063 2351547.4834,1434922.6842 2351553.6399,1434951.5616 
PL 20DF3 [SS-0-FRAME] closed=False 2351528.0913,1434849.702 2351529.2138,1434854.8322 2351531.4336,1434864.7555 2351533.1833,1434873.8769 2351501.029,1434892.4903 2351509.6687,1434902.8299 2351537.8239,1434895.1835 2351541.0195,1434894.7063 
PSEG 21676 [C-PROP-LINE] 2351517.8161,1434834.7168 -> 2351517.8161,1434834.7168 len 0
PL 21E84 [SS-BOUNDARY] closed=True 2350497.6893,1434781.2452 2350786.8797,1434940.4994 2350705.9311,1435090.3652 2350461.9271,1434817.8437 
PSEG 21E85 [C-PROP-LINE] 2350497.6893,1434781.2452 -> 2350497.6893,1434781.2452 len 0
LN 21E8B [SS-BOUNDARY MAG] 2350761.0747,1435145.8097 -> 2350403.1568,1434785.9388 len 509.7619
LN 21EA2 [SS-BOUNDARY] 2350786.8797,1434940.4994 -> 2350705.9311,1435090.3652 len 170.3304
LN 21EA3 [SS-BOUNDARY] 2350451.7329,1434827.6895 -> 2350448.1877,1434831.2154 len 5
LN 21FA0 [SS-BOUNDARY] 2350705.9311,1435090.3652 -> 2350592.6493,1434963.8438 len 169.8878
LN 21FEA [SS-BOUNDARY] 2350709.6562,1435087.0299 -> 2350705.9311,1435090.3652 len 6.8143
== LAYOUTS
LAYOUT 11X17 tab 1 paper ANSI_full_bleed_B_(11.00_x_17.00_Inches) dev AutoCAD PDF (General Documentation).pc3 rot Degrees000 style monochrome.ctb
  VP E1D8 num 1 scale 1:0.6505 ctr 4.189,8.9961 w 12.8778 h 9.6144 view 6.5675,6.8946 twist 0
  MT 158D1 at 4.9096,14.576 w 2.6581 h 0.3132 att TopLeft
  MT 1592B at 4.9116,16.5896 w 2.6181 h 1.8729 att TopLeft
  MT 1664C at 4.9004,14.2048 w 2.5064 h 0.6561 att TopLeft
  VP 1FDA0 num 2 scale 1:40 ctr 5.4915,8.519 w 10.5489 h 16.373 view 1180684.4372,692803.8207 twist 0
  BLK SS_LEGEND at 11.18,12.9737
  BLK SS_BLOCK_11X17 at 10.815,0.2874
  MT 214EB at 12.6349,16.3032 w 4.8762 h 2.581 att TopLeft
LAYOUT WIDE tab 2 paper ANSI_full_bleed_B_(11.00_x_17.00_Inches) dev AutoCAD PDF (General Documentation).pc3 rot Degrees090 style monochrome.ctb
  VP 1E655 num -1 scale 1:1 ctr 8.6837,4.6433 w 19.9111 h 12.8319 view 8.6837,4.6433 twist 0
  VP 1E658 num -1 scale 1:30.0001 ctr 8.5737,5.6191 w 16.7132 h 10.5732 view 2229223.2912,1338981.8256 twist 0
  MT 1E7B3 at 0.415,16.3597 w 2.5236 h 3.0108 att TopLeft
  BLK Water Valve at 0.5043,14.1573
  BLK Catch Basin at 0.5043,14.3451
  BLK Drainage MH at 0.5043,14.0294
  BLK Existing Hyd at 0.5043,13.895
  BLK STA at 0.5043,13.7016
SIMPLEX True

Notes

What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.

No notes yet.