[CommandMethod("testsetting")]
public void testsetting()
{
CivilDocument civdoc = (CivilDocument)CivilApplication.ActiveDocument;
using (AcDb.Transaction tr = AcDb.HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction())
{
LabelStyle labelStyle = (LabelStyle)tr.GetObject(civdoc.Styles.LabelStyles.PointLabelStyles.LabelStyles[0], AcDb.OpenMode.ForWrite);
var compId = labelStyle.AddComponent("TheBlock", LabelStyleComponentType.Block);
var comp = (LabelStyleBlockComponent)tr.GetObject(compId, AcDb.OpenMode.ForWrite);
comp.Block.BlockName.Value = "bound"; //must exist in the drawing
comp.Block.Attachment.Value = Autodesk.Civil.BlockAttachmentType.MiddleCenter;
comp.Block.XOffset.Value = (.1/12);
comp.Block.YOffset.Value = (.1/12);
tr.Commit();
}
}