Hi Partha,
I've tried modifying both the Min & Max points and I've tried scaling the label outline to no avail. The view label does not change size or location.
Jeremy's code does work to position views, but it doesn't address the labels.
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
Document activeDoc = commandData.Application.ActiveUIDocument.Document;
using (var trans = new Transaction(activeDoc))
{
trans.Start("Scale Viewport Label");
ViewSheet activeSheet = commandData.Application.ActiveUIDocument.ActiveView as ViewSheet;
Viewport firstViewPort = activeSheet.GetAllViewports().Select(activeDoc.GetElement).First() as Viewport;
Outline firstViewPortLabelOutline = firstViewPort.GetLabelOutline();
firstViewPortLabelOutline.Scale(2.0);
trans.Commit();
}
return Result.Succeeded;
}
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
Document activeDoc = commandData.Application.ActiveUIDocument.Document;
using (var trans = new Transaction(activeDoc))
{
trans.Start("Scale Viewport Label");
ViewSheet activeSheet = commandData.Application.ActiveUIDocument.ActiveView as ViewSheet;
Viewport firstViewPort = activeSheet.GetAllViewports().Select(activeDoc.GetElement).First() as Viewport;
Outline firstViewPortLabelOutline = firstViewPort.GetLabelOutline();
XYZ currentMinPoint = firstViewPortLabelOutline.MinimumPoint;
XYZ currentMaxPoint = firstViewPortLabelOutline.MaximumPoint;
XYZ newMinPoint = currentMinPoint + new XYZ(1, 1, 0);
XYZ newMaxPoint = currentMaxPoint + new XYZ(1, 1, 0);
firstViewPortLabelOutline.MinimumPoint = newMinPoint;
firstViewPortLabelOutline.MaximumPoint = newMaxPoint;
trans.Commit();
}
return Result.Succeeded;
}
--
Bobby C. Jones