Beispiel #1
0
        private void OnSelectElement(SelectionChangeArgs args)
        {
            if (!args.IsHighlightMode())
            {
                SelectedShapeQuery query = new SelectedShapeQuery();
                renderView.QuerySelection(query);
                var ids = query.GetIds();
                if (ids.Length > 0)
                {
                    var shape = query.GetGeometry();

                    if (shape != null)
                    {
                        GeomCurve curve = new GeomCurve();
                        if (curve.Initialize(shape))
                        {
                            TopoShapeProperty property = new TopoShapeProperty();
                            property.SetShape(shape);
                            var str = String.Format("Length:{0}", property.EdgeLength());
                            toolStripStatusLabel2.Text = str;

                            return;
                        }
                    }
                }
                else
                {
                    toolStripStatusLabel2.Text = "";
                }
            }
        }