@Alexander.Rivilis I am using a similar code to change the annotative property. But whenever I use it, the dimensions do not show up in the drawing. I am plotting other block attributes as well.
The code, I am using is below:
using (Transaction acTrans = theDb.TransactionManager.StartTransaction())
{
pBlockTbl = acTrans.GetObject(theDb.BlockTableId, OpenMode.ForWrite) as BlockTable;
pModelSpaceTblRcd = acTrans.GetObject(pBlockTbl[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
//pBlockTbl.Dispose();
// Prepare dimension
string tempDimensionTextToPlot = string.Format("{0:0.00}", (rightDist - leftDist));
pDimension = new AlignedDimension(
new Point3d(leftDist, originElev, 0),
new Point3d(rightDist, originElev, 0),
new Point3d(leftDist + ((rightDist - leftDist) / 2), originElev + elevDeltaToDimLine, 0),
tempDimensionTextToPlot,
idDimensionStyleStandard);
//change
pDimension.DimensionStyle = idDimensionStyleStandard;
pDimension.LayerId = idLayerDimension;
pDimension.Annotative = AnnotativeStates.True;
// Add dimension to database
pModelSpaceTblRcd.AppendEntity(pDimension);
acTrans.AddNewlyCreatedDBObject(pDimension, true);
// Finished with this dimension
//pDimension.Dispose();
acTrans.Commit();
}