C3D-TB1READ · Read orphaned TB1 lines (read-only) done
Endpoints of the 2 TB1 lines above the landscape paper.
C# payload
// READ-ONLY: what are the 2 TB1 lines up at Y~16.5 (above the landscape paper)? Endpoints + length.
using System;
using Autodesk.AutoCAD.DatabaseServices;
var db = Db;
using (var tr = db.TransactionManager.StartTransaction())
{
var ld = (DBDictionary)tr.GetObject(db.LayoutDictionaryId, OpenMode.ForRead);
Layout lay = null;
foreach (DBDictionaryEntry e in ld)
{
var l = (Layout)tr.GetObject(e.Value, OpenMode.ForRead);
if (string.Equals(l.LayoutName, "11X17", StringComparison.OrdinalIgnoreCase)) { lay = l; break; }
}
var btr = (BlockTableRecord)tr.GetObject(lay.BlockTableRecordId, OpenMode.ForRead);
foreach (ObjectId id in btr)
{
var e = tr.GetObject(id, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
if (e == null || !string.Equals(e.Layer, "TB1", StringComparison.OrdinalIgnoreCase)) continue;
if (e is Line ln)
Log($"TB1 Line ({ln.StartPoint.X:0.00},{ln.StartPoint.Y:0.00})->({ln.EndPoint.X:0.00},{ln.EndPoint.Y:0.00}) len={ln.Length:0.00} h={e.Handle}");
else
Log($"TB1 {e.GetType().Name} h={e.Handle}");
}
tr.Commit();
}
Result
Log
TB1 Line (5.45,0.14)->(16.02,0.14) len=10.57 h=1C64 TB1 Line (5.43,16.52)->(5.45,0.14) len=16.37 h=1D56
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.