static public void AddIssue(Database database, string delta, string issue, string date, string description, string by, string check) { using (Transaction trans = database.TransactionManager.StartTransaction()) { string blockName = "01P046"; BlockTable bt = (BlockTable)trans.GetObject(database.BlockTableId, OpenMode.ForRead); if (bt.Has(blockName)) { BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[blockName], OpenMode.ForRead); ObjectIdCollection blockRefIds = btr.GetBlockReferenceIds(false, false); if (blockRefIds.Count > 0) { BlockReference br = (BlockReference)trans.GetObject(blockRefIds[0], OpenMode.ForRead); int attCount = br.AttributeCollection.Count; for (int i = 0; i < attCount; i += 6) { AttributeReference ar; if (ar.TextString.Trim() == "") { ar = (AttributeReference)trans.GetObject(br.AttributeCollection[i], OpenMode.ForWrite); ar.TextString = delta; ar = (AttributeReference)trans.GetObject(br.AttributeCollection[i + 1], OpenMode.ForWrite); ar.TextString = issue; ar = (AttributeReference)trans.GetObject(br.AttributeCollection[i + 2], OpenMode.ForWrite); ar.TextString = date; ar = (AttributeReference)trans.GetObject(br.AttributeCollection[i + 3], OpenMode.ForWrite); ar.TextString = description; ar = (AttributeReference)trans.GetObject(br.AttributeCollection[i + 4], OpenMode.ForWrite); ar.TextString = by; ar = (AttributeReference)trans.GetObject(br.AttributeCollection[i + 5], OpenMode.ForWrite); ar.TextString = check; break; } } } } trans.Commit(); } }