C3D-TBCUNDO · Clear SS-V-ROAD-CURB layer error
Erase everything on layer SS-V-ROAD-CURB so the straight-chord curb polylines can be redrawn as splines through the same TBC points.
C# payload
// Erase everything on layer SS-V-ROAD-CURB (user confirmed OK to clear entirely) so the straight-chord
// polylines from C3D-TBCDRAW can be redrawn as splines through the same TBC points.
using System;
using System.Collections.Generic;
using Autodesk.AutoCAD.DatabaseServices;
const string LAYER = "SS-V-ROAD-CURB";
var toErase = new List<ObjectId>();
foreach (ObjectId id in ModelSpace)
{
var ent = Tx.GetObject(id, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
if (ent == null) continue;
if (ent.Layer == LAYER) toErase.Add(id);
}
Log($"Found {toErase.Count} entities on '{LAYER}' to erase.");
int erased = 0;
foreach (var id in toErase)
{
var ent = Tx.GetObject(id, OpenMode.ForWrite) as Autodesk.AutoCAD.DatabaseServices.Entity;
ent.Erase();
erased++;
}
Log($"Erased {erased}.");
Result
Log
Found 90 entities on 'SS-V-ROAD-CURB' to erase.
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.