C3D-CHECKLTYPE · Check easement/sewer linetypes (read-only) done
Linetype+color for SEWER_LINE, SEWER_EASEMENT, WATER_EASEMENT so the legend sample matches exactly.
C# payload
// READ-ONLY: what linetype/color does the actual SEWER_EASEMENT_TEXT / easement geometry use,
// and the SEWER_LINE (outfall sewer), so the legend sample lines match exactly.
using System;
using Autodesk.AutoCAD.DatabaseServices;
var db = Db;
using (var tr = db.TransactionManager.StartTransaction())
{
var lt = (LayerTable)tr.GetObject(db.LayerTableId, OpenMode.ForRead);
foreach (var n in new[]{"SEWER_LINE","SEWER_EASEMENT","SEWER_EASEMENT_TEXT","WATER_EASEMENT"})
{
if (!lt.Has(n)) { Log($"{n}: layer does not exist"); continue; }
var l = (LayerTableRecord)tr.GetObject(lt[n], OpenMode.ForRead);
var ltbl = (LinetypeTableRecord)tr.GetObject(l.LinetypeObjectId, OpenMode.ForRead);
Log($"{n}: linetype='{ltbl.Name}' color={l.Color.ColorIndex} lw={l.LineWeight}");
}
// any actual geometry entity on SEWER_EASEMENT or SEWER_LINE?
var ms = (BlockTableRecord)tr.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(db), OpenMode.ForRead);
foreach (ObjectId id in ms)
{
var e = tr.GetObject(id, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
if (e == null) continue;
if (string.Equals(e.Layer,"SEWER_LINE",StringComparison.OrdinalIgnoreCase) || string.Equals(e.Layer,"SEWER_EASEMENT",StringComparison.OrdinalIgnoreCase))
Log($" entity on {e.Layer}: {e.GetType().Name} linetype='{e.Linetype}'");
}
tr.Commit();
}
Result
Log
SEWER_LINE: linetype='Continuous' color=3 lw=ByLineWeightDefault SEWER_EASEMENT: linetype='Continuous' color=4 lw=ByLineWeightDefault SEWER_EASEMENT_TEXT: linetype='Continuous' color=7 lw=ByLineWeightDefault WATER_EASEMENT: linetype='Continuous' color=4 lw=ByLineWeightDefault entity on SEWER_LINE: Polyline linetype='ByLayer'
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.