这块确实是稍有点复杂,获取anno对象的方式如下,标尺类型是AnnPolyRulerObject
- AnnAutomation ann= (AnnAutomation)cell.AutomationObject;
- foreach(AnnObject obj in ann.Container.Children)
- {
- if (obj is AnnPolyRulerObject) {
- AnnLabel label;
- ((AnnPolyRulerObject)obj).Labels.TryGetValue("RulerLength", out label);
- if(label!=null)
- MessageBox.Show(label.Text.ToString());
- }
- }
复制代码 |