← Inbox

C3D-0597 · TOPO: outer boundary from X-BOUNDARY done

Add X-BOUNDARY polyline 20F9E to surface TOPO as a non-destructive outer boundary so it only shows inside the property; rebuild and read back.

Script file
C3D-0597.cs
Target
261001 - 5040 Rolling Rock Dr.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

TinSurface s=null;
foreach(ObjectId sid in CivilDoc.GetSurfaceIds()){ var t=Tx.GetObject(sid,OpenMode.ForRead) as TinSurface; if(t!=null && t.Name=="TOPO") s=t; }
if(s==null){ Log("TOPO not found"); return; }
var bid=Db.GetObjectId(false,new Handle(Convert.ToInt64("20F9E",16)),0);
var bp=(Polyline)Tx.GetObject(bid,OpenMode.ForRead);
Log("boundary poly h=20F9E layer="+bp.Layer+" closed="+bp.Closed+" area="+bp.Area.ToString("F0"));
bool has=false;
for(int i=0;i<s.BoundariesDefinition.Count;i++) if(s.BoundariesDefinition[i].BoundaryType==Autodesk.Civil.SurfaceBoundaryType.Outer) has=true;
if(has){ Log("SKIP - TOPO already has an outer boundary"); }
else {
  s.UpgradeOpen();
  var ids=new ObjectIdCollection(); ids.Add(bid);
  s.BoundariesDefinition.AddBoundaries(ids,0.1,Autodesk.Civil.SurfaceBoundaryType.Outer,true);
  s.Rebuild();
}
var p=s.GetGeneralProperties();
Log("TOPO boundaries="+s.BoundariesDefinition.Count+" pts="+p.NumberOfPoints+" ext=("+p.MinimumCoordinateX.ToString("F1")+","+p.MinimumCoordinateY.ToString("F1")+")-("+p.MaximumCoordinateX.ToString("F1")+","+p.MaximumCoordinateY.ToString("F1")+") (verified)");
var e=bp.GeometricExtents; Log("boundary ext=("+e.MinPoint.X.ToString("F1")+","+e.MinPoint.Y.ToString("F1")+")-("+e.MaxPoint.X.ToString("F1")+","+e.MaxPoint.Y.ToString("F1")+")");
Ed.Regen();

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\261001 - 5040 Rolling Rock Dr, Sugar Hill, GA 30518, USA\261001 - 5040 Rolling Rock Dr.dwg
Message
Executed C3D-0597 (0 entities touched).
Entities
—
Duration
601 ms
Civil 3D
25.0.0.0

Log

boundary poly h=20F9E layer=X-BOUNDARY closed=True area=15001
TOPO boundaries=1 pts=132 ext=(2333720.5,1491923.1)-(2333911.1,1492073.0) (verified)
boundary ext=(2333720.4,1491923.1)-(2333911.1,1492073.0)

Notes

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

No notes yet.