C3D-BOLTEDFIX · Redefine SSMH_BOLTED as a plain circle done
Remove the donut geometry from the SSMH_BOLTED block, replace with a simple gray circle. All existing inserts update automatically (block redefinition).
C# payload
// Redefine SSMH_BOLTED as a plain circle (gray) — remove the donut, keep it simple.
using System;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Colors;
const double R = 5.0;
const string BLK_BOLTED = "SSMH_BOLTED";
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForWrite);
if (!bt.Has(BLK_BOLTED)) { Log($"block '{BLK_BOLTED}' not found"); return; }
var btr = (BlockTableRecord)Tx.GetObject(bt[BLK_BOLTED], OpenMode.ForWrite);
// erase everything currently in the block definition
var toErase = new System.Collections.Generic.List<ObjectId>();
foreach (ObjectId id in btr) toErase.Add(id);
foreach (var id in toErase)
{
var e = (Autodesk.AutoCAD.DatabaseServices.Entity)Tx.GetObject(id, OpenMode.ForWrite);
e.Erase();
}
// plain circle, gray
var c = new Circle(Point3d.Origin, Vector3d.ZAxis, R);
c.Color = Color.FromColorIndex(ColorMethod.ByAci, 8);
btr.AppendEntity(c);
Tx.AddNewlyCreatedDBObject(c, true);
Log($"SSMH_BOLTED redefined as a plain circle (r={R}, gray). All existing inserts update automatically.");
Result
Log
SSMH_BOLTED redefined as a plain circle (r=5, gray). All existing inserts update automatically.
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.