← Inbox

C3DO-0869 · 260714: read point groups, POB points, styles, layouts (read-only) [C3D-SOREAD] done

Read-only: point group draw order with styles/queries, POB group points (PNEZD), point/label style names, layouts + viewports.

Script file
C3DO-0869.cs
Target
260714 - 285 Huckaby Rd 22x17.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);
Log("== DRAWORDER");
int i=0;
foreach(ObjectId id in civ.PointGroups.DrawOrder){ var g=(Autodesk.Civil.DatabaseServices.PointGroup)Tx.GetObject(id,OpenMode.ForRead);
 string ps="-",ls="-"; try{ if(!g.PointStyleId.IsNull) ps=((Autodesk.Civil.DatabaseServices.Styles.StyleBase)Tx.GetObject(g.PointStyleId,OpenMode.ForRead)).Name; }catch{} try{ if(!g.PointLabelStyleId.IsNull) ls=((Autodesk.Civil.DatabaseServices.Styles.StyleBase)Tx.GetObject(g.PointLabelStyleId,OpenMode.ForRead)).Name; }catch{}
 string q=""; try{ q=g.GetQuery().QueryString; }catch{}
 Log("["+(i++)+"] "+g.Name+" n="+g.PointsCount+" ps="+ps+(g.IsPointStyleOverridden?"*":"")+" ls="+ls+(g.IsPointLabelStyleOverridden?"*":"")+" q="+q); }
Log("== POB GROUP POINTS");
foreach(ObjectId id in civ.PointGroups){ var g=(Autodesk.Civil.DatabaseServices.PointGroup)Tx.GetObject(id,OpenMode.ForRead); if(g.Name.ToUpper()!="POB") continue;
 foreach(uint n in g.GetPointNumbers()){ var cp=(Autodesk.Civil.DatabaseServices.CogoPoint)Tx.GetObject(civ.CogoPoints.GetPointByPointNumber(n),OpenMode.ForRead);
  Log("P "+cp.PointNumber+","+cp.Northing.ToString("0.0000")+","+cp.Easting.ToString("0.0000")+","+cp.Elevation.ToString("0.000")+","+cp.RawDescription+" | layer "+cp.Layer+" lbl "+F(cp.LabelLocation.X)+","+F(cp.LabelLocation.Y)); } }
Log("== POINT STYLES"); foreach(ObjectId s in civ.Styles.PointStyles){ Log("  "+((Autodesk.Civil.DatabaseServices.Styles.StyleBase)Tx.GetObject(s,OpenMode.ForRead)).Name); }
Log("== POINT LABEL STYLES"); foreach(ObjectId s in civ.Styles.LabelStyles.PointLabelStyles.LabelStyles){ Log("  "+((Autodesk.Civil.DatabaseServices.Styles.LabelStyle)Tx.GetObject(s,OpenMode.ForRead)).Name); }
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+" size "+F(lay.PlotPaperSize.X)+"x"+F(lay.PlotPaperSize.Y));
 var ps=(BlockTableRecord)Tx.GetObject(lay.BlockTableRecordId,OpenMode.ForRead);
 foreach(ObjectId id in ps){ var o=Tx.GetObject(id,OpenMode.ForRead);
  if(o is Viewport vp && vp.Number!=1) Log("  VP "+id.Handle+" 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)+" frz "+vp.GetFrozenLayers().Count);
  else if(o is BlockReference br) Log("  BLK "+br.Name+" "+id.Handle+" at "+F(br.Position.X)+","+F(br.Position.Y)+" layer "+br.Layer); } }
Log("CANNO "+Db.Cannoscale.Name+" ltscale "+Db.Ltscale+" psltscale "+Db.Psltscale);

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260714 - 285 Huckaby Rd, Brooks, GA 30205, USA\260714 - 285 Huckaby Rd 22x17.dwg
Message
Executed C3DO-0869 (0 entities touched).
Entities
—
Duration
1756 ms
Civil 3D
25.0.0.0

Log

FILE C:\Users\sanja\OneDrive\_SurveyDisco\260714 - 285 Huckaby Rd, Brooks, GA 30205, USA\260714 - 285 Huckaby Rd 22x17.dwg
== DRAWORDER
[0] CP n=6 ps=Iron Pin ls=Description Only [IPF] q=(RawDescription='CP') AND '' NOT (PointNumber=205)
[1] UTIL n=5 ps=Test Pit ls=Description Only q=(RawDescription='*FLAG*' OR RawDescription='LP' OR RawDescription='CO' OR RawDescription='WM' OR RawDescription='WV' OR RawDescription='A/C' OR RawDescription='clean out' OR RawDescription='HAM*' OR RawDescription='POWER*' OR PointNumber=102 OR PointNumber=200 OR PointNumber=229 OR PointNumber=502) AND '' NOT (PointNumber=205)
[2] IPF NS n=14 ps=Iron Pin ls=Description Only [IPF] q=(RawDescription='IPP' OR RawDescription='*IPF*' OR RawDescription='SPIKE' OR RawDescription='*IPS*' OR RawDescription='CTP' OR RawDescription='*OTP*' OR RawDescription='FENCE POST' OR RawDescription='ANGLE*' OR RawDescription='PIPE') AND '' NOT (PointNumber=205)
[3] PP n=1 ps=Utility Pole ls=- q=(RawDescription='*PP*')
[4] POB n=1 ps=Drill Hole ls=Northing and Easting q=(RawDescription='*POB*') AND '' NOT (PointNumber=205)
[5] MH n=0 ps=Storm Sewer Manhole ls=- q=(RawDescription='*MH*' OR RawDescription='*CB*' OR RawDescription='*SEWER*') AND '' NOT (PointNumber=470)
[6] FH n=0 ps=Hydrant (existing) ls=- q=(RawDescription='FH')
[7] FF n=1 ps=Basic ls=Elevation and Description q=(RawDescription='*ELEV*' OR RawDescription='*FF*') AND '' NOT (PointNumber=135 OR PointNumber=136 OR PointNumber=137 OR PointNumber=84)
[8] GAS n=2 ps=Test Pit ls=Description Only q=(RawDescription='*GAS*')
[9] TBC n=0 ps=Test Pit ls=- q=(RawDescription='*TBC*')
[10] No Display n=197 ps=- ls=- q=(PointNumber>0)
[11] BUILDING n=9 ps=Basic ls=Description Only q=(RawDescription='LP' OR RawDescription='*BLDG*' OR RawDescription='*HC*' OR PointNumber=159 OR PointNumber=162 OR PointNumber=171 OR PointNumber=183 OR PointNumber=193 OR PointNumber=199 OR PointNumber=206 OR PointNumber=208 OR PointNumber=223-224 OR PointNumber=260)
[12] NORTHING_EASTING n=0 ps=Iron Pin [LARGE] ls=Northing and Easting q=(RawDescription='IPP')
[13] FENCE n=45 ps=Basic ls=Point#-Elevation-Description q=(RawDescription='*FC*' OR RawDescription='*FL*' OR RawDescription='*dwy*')
[14] Display [SPECIFIC] n=81 ps=Basic ls=Description Only q=(RawDescription='A/C' OR RawDescription='CHIMNEY' OR RawDescription='POWER METER' OR RawDescription='*DWY*' OR RawDescription='*SW*' OR RawDescription='*FF*') AND '' NOT (RawDescription='LP')
[15] TOPO n=170 ps=Basic ls=Point#-Elevation-Description q=(PointNumber>0) AND '' NOT (RawDescription='*WALL*' OR RawDescription='IPP' OR RawDescription='CP' OR RawDescription='PL' OR RawDescription='*PORCH*' OR RawDescription='*STEP*' OR RawDescription='POB')
[16] WALL ELEV n=6 ps=Sign (single pole) ls=Elevation and Description q=(RawDescription='POB' OR PointNumber=139-140 OR PointNumber=143 OR PointNumber=158-159 OR PointNumber=175 OR PointNumber=210-213) AND '' NOT (PointNumber=205)
[17] TREES n=0 ps=Tree ls=Description Only q=(RawDescription='*HW*')
[18] WALL n=14 ps=Test Pit ls=Description Only q=(RawDescription='*WALL*')
[19] WM n=1 ps=Water Valve ls=- q=(RawDescription='WV')
[20] _All Points n=202 ps=Basic ls=Point#-Elevation-Description q=(PointNumber>0)
[21] CL n=13 ps=Basic ls=Point#-Elevation-Description q=(RawDescription='*CL*')
[22] EP n=24 ps=Test Pit ls=Description Only q=(RawDescription='*FLAG*' OR RawDescription='LP' OR RawDescription='CO' OR RawDescription='WM' OR RawDescription='WV' OR RawDescription='A/C' OR RawDescription='clean out' OR RawDescription='HAM*' OR RawDescription='POWER*' OR PointNumber>2000) AND '' NOT (PointNumber=205)
== POB GROUP POINTS
P 534,1207312.9316,2206379.5725,0.000,POB NAD83 GA West Zone | layer 0 lbl 2205941.108,1207575.81
== POINT STYLES
  STA
  Sign (single pole)
  Tree
  Iron Pin
  Bound
  Horizontal Curve Point
  Shrub - 5ft
  Storm Sewer Manhole
  Iron Pin [LARGE]
  Water Valve
  Water Shutoff
  Catch Basin
  Benchmark
  Utility Pole
  Well
  Test Pit
  Gas Valve
  Sanitary Sewer Manhole
  Drill Hole
  Vertical Curve Point
  Hydrant (proposed)
  Standard
  Hydrant (existing)
  Guy Pole
  Basic
  Gas METER
== POINT LABEL STYLES
  Description Only
  Elevation Only
  Description Only [IPF]
  Elevation and Description
  Northing and Easting
  Point#-Elevation-Description [HANDICAP]
  Point Number Only
  Point#-Elevation-Description
  Point# and Description
== LAYOUTS
LAYOUT 17X11 tab 4 paper ANSI_full_bleed_B_(17.00_x_11.00_Inches) dev AutoCAD PDF (High Quality Print).pc3 rot Degrees000 size 431.8x279.4
  BLK SS_BLOCK_17X11 20E5D at 16.67,0.33 layer BLOCK_TB2
  VP 20E73 scale 1:200 ctr 8.501,5.5 w 16.255 h 10.259 view 2204919.226,1206979.224 twist 0 frz 4
  BLK SS_LEGEND 20FB9 at 13.72,1.075 layer SS-BOUNDARY
  BLK SCALE200 2120A at 13.054,0.738 layer V-STRC-WALL
LAYOUT 22X17 (2) tab 1 paper ANSI_full_bleed_C_(22.00_x_17.00_Inches) dev AutoCAD PDF (High Quality Print).pc3 rot Degrees000 size 558.8x431.8
  BLK SS_BLOCK_22X17_TB 23735 at 21.67,0.33 layer BLOCK_TB2
  VP 23744 scale 1:1 ctr 13.929,8.119 w 32.618 h 16.75 view 13.929,8.119 twist 0 frz 0
  VP 23747 scale 1:200 ctr 11.001,8.501 w 21.255 h 16.259 view 2204919.226,1206979.224 twist 0 frz 3
  BLK SS_LEGEND 2387B at 18.72,1.075 layer SS-BOUNDARY
  BLK SCALE200 2387C at 18.054,0.738 layer V-STRC-WALL
LAYOUT COVER tab 3 paper ANSI_full_bleed_B_(17.00_x_11.00_Inches) dev AutoCAD PDF (High Quality Print).pc3 rot Degrees000 size 431.8x279.4
  BLK SS_BLOCK_17X11 225B4 at 16.67,0.33 layer BLOCK_TB2
  VP 225C3 scale 1:1 ctr -21.079,16.018 w 226.147 h 54.893 view -21.079,16.018 twist 0 frz 0
  VP 225C6 scale 1:200 ctr -3.953,-0.483 w 1.997 h 3.408 view 2203493.423,1206294.175 twist 0 frz 3
  BLK SIGNATURE 22D8B at -410.857,34.682 layer NOTES
  BLK SIGNATURE 22D8C at -412.848,35.433 layer NOTES
LAYOUT COVER (22) tab 2 paper ANSI_full_bleed_C_(22.00_x_17.00_Inches) dev AutoCAD PDF (High Quality Print).pc3 rot Degrees000 size 558.8x431.8
  BLK SS_BLOCK_22X17_TB 23891 at 21.67,0.33 layer BLOCK_TB2
  VP 238A0 scale 1:1 ctr 16.094,27.962 w 88.951 h 51.961 view 16.094,27.962 twist 0 frz 0
CANNO 1:100 ltscale 1 psltscale True

Notes

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

No notes yet.