Hello everyone!
I have a trouble with a description for my layer. Command in general works normaly, but description doesn't assign desired string. Who it is so?
Code:
public static void DrawM ()
{
Document acDoc = Application.DocumentManager.MdiActiveDocument;
Database acCurDb = acDoc.Database;
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction( ))
{
LayerTable acLyrTbl;
acLyrTbl = acTrans.GetObject(acCurDb.LayerTableId, OpenMode.ForRead) as LayerTable;
string LayerName = "-10-Formats";
string VLayerName = "-10-Viewports";
if (acLyrTbl.Has(LayerName) == false)
using (LayerTableRecord acLyrTblRec = new LayerTableRecord( ))
{
// Assign the layer the ACI color 3 and a name
acLyrTblRec.Color = Color.FromColorIndex(ColorMethod.ByAci, 7);
acLyrTblRec.Name = LayerName;
acLyrTblRec.Description = "Layer owned by 101 sector, only for GOST titles";
// Upgrade the Layer table for write
acLyrTbl.UpgradeOpen( );
// Append the new layer to the Layer table and the transaction
acLyrTbl.Add(acLyrTblRec);
acTrans.AddNewlyCreatedDBObject(acLyrTblRec, true);
}
acTrans.Commit;
}
}