如何对已知块名的属性进行赋值啊
我现在调入一个块至当前模型空间后,如何用C#来对其属性赋值啊,请给出一个实例啊! Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;Database db = HostApplicationServices.WorkingDatabase;
Transaction trans = db.TransactionManager.StartTransaction();
//块表
BlockTable bt = (BlockTable)trans.GetObject(db.BlockTableId, OpenMode.ForWrite);
//块表记录
BlockTableRecord newBtr = new BlockTableRecord();
if ((bt.Has("块名")))
{
newBtr.Name = "MachineBlock";
newBtr.Origin = center;
}
newBtrId = bt.Add(newBtr);
trans.AddNewlyCreatedDBObject(newBtr, true);
trans.commit();
页:
[1]