acad-blocks
Installation
SKILL.md
AutoCAD Blocks and Attributes
Use this skill when creating block definitions, inserting block references, working with attributes, or reading dynamic block properties.
Block Definition (BlockTableRecord)
using (Transaction tr = db.TransactionManager.StartTransaction())
{
BlockTable bt = (BlockTable)tr.GetObject(
db.BlockTableId, OpenMode.ForWrite);
// Create a new block definition
BlockTableRecord blockDef = new BlockTableRecord();
blockDef.Name = "MyBlock";
blockDef.Origin = new Point3d(0, 0, 0);
blockDef.Comments = "A custom block";
blockDef.Units = UnitsValue.Millimeters;
blockDef.Explodable = true;