← Inbox

C3D-0617 · Storm pipes A and B lines from surveyed structures done

Per the construction plans (C5.0/C6.0), draw one line per pipe between the surveyed structure points, upstream to downstream, on new layer V-STORM-PIPE: A4-A3-A2-A1 (18" ALTyp2) and B4-B3-B2-B1 (18" RCP). Line C (vault-OCS-JB C2-EX C1) not drawn - JB C2, EX C1 and the vault outlet were not shot.

Script file
C3D-0617.cs
Target
260612-C-Store As-Built Storm.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

string LAY="V-STORM-PIPE";
var lt=(LayerTable)Tx.GetObject(Db.LayerTableId,OpenMode.ForRead);
if(!lt.Has(LAY)){ lt.UpgradeOpen(); var l=new LayerTableRecord{Name=LAY,Color=Autodesk.AutoCAD.Colors.Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.ByAci,170)}; lt.Add(l); Tx.AddNewlyCreatedDBObject(l,true); Log("created layer "+LAY); }
var pts=new Dictionary<uint,CogoPoint>();
foreach(ObjectId id in CivilDoc.CogoPoints){ var p=(CogoPoint)Tx.GetObject(id,OpenMode.ForRead); pts[p.PointNumber]=p; }
var ms=(BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db),OpenMode.ForWrite);
var have=new List<Line>(); foreach(ObjectId id in ms){ var l=Tx.GetObject(id,OpenMode.ForRead) as Line; if(l!=null && l.Layer==LAY) have.Add(l); }
var runs=new[]{ new object[]{"STM A3 (A4-A3) 18\"",1109u,1108u}, new object[]{"STM A2 (A3-A2) 18\"",1108u,1107u}, new object[]{"STM A1 (A2-A1) 18\"",1107u,1139u},
                new object[]{"STM B3 (B4-B3) 18\" RCP",1110u,1082u}, new object[]{"STM B2 (B3-B2) 18\" RCP",1082u,346u}, new object[]{"STM B1 (B2-B1) 18\" RCP",346u,1102u} };
foreach(var r in runs){
  string nm=(string)r[0]; uint a=(uint)r[1], b=(uint)r[2];
  if(!pts.ContainsKey(a)||!pts.ContainsKey(b)){ Log(nm+": point missing"); continue; }
  var pa=new Point3d(pts[a].Easting,pts[a].Northing,0); var pb=new Point3d(pts[b].Easting,pts[b].Northing,0);
  if(have.Any(l=>l.StartPoint.DistanceTo(pa)<0.01&&l.EndPoint.DistanceTo(pb)<0.01)){ Log(nm+": already drawn - skipped"); continue; }
  var ln=new Line(pa,pb); ln.SetDatabaseDefaults(); ln.Layer=LAY; ms.AppendEntity(ln); Tx.AddNewlyCreatedDBObject(ln,true);
  Log(nm+": "+pts[a].RawDescription+" ("+a+") -> "+pts[b].RawDescription+" ("+b+") h="+ln.Handle+" len="+ln.Length.ToString("F2")+" (verified)");
}
Ed.Regen();

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\261004 - 5030 E Lake Pkwy, Stockbridge, GA 30281, USA\260612-C-Store As-Built Storm.dwg
Message
Executed C3D-0617 (0 entities touched).
Entities
—
Duration
398 ms
Civil 3D
25.0.0.0

Log

created layer V-STORM-PIPE
STM A3 (A4-A3) 18": DI A4 (1109) -> DI A3 (1108) h=30826 len=33.34 (verified)
STM A2 (A3-A2) 18": DI A3 (1108) -> DI A2 (1107) h=30827 len=122.60 (verified)
STM A1 (A2-A1) 18": DI A2 (1107) -> DI-RISER A1 (1139) h=30828 len=83.87 (verified)
STM B3 (B4-B3) 18" RCP: DI B4 (1110) -> DI B3 (1082) h=30829 len=92.41 (verified)
STM B2 (B3-B2) 18" RCP: DI B3 (1082) -> DI B2 (346) h=3082A len=89.95 (verified)
STM B1 (B2-B1) 18" RCP: DI B2 (346) -> DI-RISER B1 (1102) h=3082B len=62.99 (verified)

Notes

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

No notes yet.