← Inbox

C3D-0600 · Read Pinewood Trail label + road linework done

Read-only: text containing PINEWOOD in model/layouts, and road-layer linework in model space.

Script file
C3D-0600.cs
Target
261003 - 236 Pinewood Trail.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

var bt=(BlockTable)Tx.GetObject(Db.BlockTableId,OpenMode.ForRead);
foreach(ObjectId sid in bt){
  var b=(BlockTableRecord)Tx.GetObject(sid,OpenMode.ForRead); if(!b.IsLayout) continue;
  string ln=((Layout)Tx.GetObject(b.LayoutId,OpenMode.ForRead)).LayoutName;
  foreach(ObjectId id in b){
    var o=Tx.GetObject(id,OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity; if(o==null) continue;
    string t=null; if(o is MText) t=((MText)o).Contents; else if(o is DBText) t=((DBText)o).TextString;
    if(t!=null && t.ToUpper().Contains("PINEWOOD")){ var e=o.GeometricExtents; Log("["+ln+"] "+o.GetType().Name+" h="+o.Handle+" layer="+o.Layer+" '"+t+"' h="+(o is MText?((MText)o).TextHeight:((DBText)o).Height).ToString("F2")+" rot="+((o is MText?((MText)o).Rotation:((DBText)o).Rotation)*180/Math.PI).ToString("F1")+" at=("+e.MinPoint.X.ToString("F1")+","+e.MinPoint.Y.ToString("F1")+")"); }
    var u=o.Layer.ToUpper();
    if(ln=="Model" && (o is Polyline||o is Line||o is Arc) && (u.Contains("ROAD")||u.Contains("EPVM")||u.Contains("CNTR")||u.Contains("R/W")||u.Contains("ROW"))){ var e=o.GeometricExtents; Log("  ROAD "+o.GetType().Name+" h="+o.Handle+" layer="+o.Layer+" ext=("+e.MinPoint.X.ToString("F1")+","+e.MinPoint.Y.ToString("F1")+")-("+e.MaxPoint.X.ToString("F1")+","+e.MaxPoint.Y.ToString("F1")+")"+(o is Polyline?" nv="+((Polyline)o).NumberOfVertices+" len="+((Polyline)o).Length.ToString("F1"):"")); }
  }
}

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\261003 - 236 Pinewood Trail, Dawsonville, GA 30534, USA\261003 - 236 Pinewood Trail.dwg
Message
Executed C3D-0600 (0 entities touched).
Entities
—
Duration
1692 ms
Civil 3D
25.0.0.0

Log

  ROAD Polyline h=2102B layer=SS-V-ROAD-EPVM ext=(2323552.2,1582506.7)-(2323708.3,1582569.9) nv=8 len=169.0
  ROAD Polyline h=2102C layer=SS-V-ROAD-EPVM ext=(2323555.6,1582525.6)-(2323713.8,1582590.3) nv=5 len=171.3
  ROAD Polyline h=21157 layer=SS-V-ROAD-CNTR ext=(2323557.3,1582516.3)-(2323711.2,1582578.5) nv=8 len=166.6
[Model] DBText h=21331 layer=V-BNDY-42 'PINEWOOD S/D - PB 15/231 SHT 2 OF 3' h=2.50 rot=0.0 at=(2324492.2,1582415.8)
[Model] DBText h=21333 layer=V-BNDY-42 'RECORD CALLS MISS 12.25 FT - CURVE ON PINEWOOD TR. CLOSED BY CHORD (VERIFY LAYER)' h=2.50 rot=0.0 at=(2324440.6,1582405.8)
[Model] DBText h=21365 layer=V-BNDY-41 'PINEWOOD S/D - PB 15/231 SHT 2 OF 3' h=2.50 rot=0.0 at=(2324516.6,1582815.9)
[Model] DBText h=21368 layer=V-BNDY-41 'PINEWOOD TRAIL 60' R/W (NORTH)' h=2.50 rot=0.0 at=(2324524.1,1582800.9)
[Model] DBText h=21397 layer=V-BNDY-41 'PINEWOOD S/D - PB 15/231' h=2.50 rot=0.0 at=(2323456.9,1582363.5)
[Model] DBText h=2139A layer=V-BNDY-41 'PINEWOOD TRAIL 60' R/W (NORTH)' h=2.50 rot=0.0 at=(2323451.3,1582348.5)
[Model] DBText h=213D9 layer=V-BNDY-42 'PINEWOOD S/D - PB 15/231 SHT 2 OF 3' h=2.50 rot=0.0 at=(2323672.8,1582383.1)
[Model] DBText h=213DB layer=V-BNDY-42 'RECORD CALLS MISS 12.25 FT - CURVE ON PINEWOOD TR. CLOSED BY CHORD (VERIFY LAYER)' h=2.50 rot=0.0 at=(2323621.2,1582373.1)
[Model] DBText h=218EE layer=V-BNDY-TEXT 'LOT 41 PINEWOOD S/D PB 15/231 - 236 PINEWOOD TRAIL - JOB 261003' h=5.00 rot=0.0 at=(2323248.3,1581474.4)

Notes

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

No notes yet.