I would like to find out - without a macro from other programmers :-) the lenght of curve's
In corel i select a simple shape.
Why this not work?
1 2 3 4 5 6 7 8 9
private void Button_Click_1(object sender, RoutedEventArgs e) { corel.Shape selectedShape = corelApp.ActiveSelection; if (selectedShape.Type == corel.cdrShapeType.cdrCurveShape) { double l = selectedShape.Curve.Length; TB_LineLenght.Text = l.ToString(); } }
perhaps the selected shape is not a curve (cdrCurveShape), but a rectangle (cdrRectangleShape). And these are different types
You should use `ActiveShape` instead of `ActiveSelection` and `DisplayCurve.Length`...
no need to convert to and from a curve, you can just use Shape.DisplayCurve.Length with any simple shapes
Corect, I will delete the answer...
I cannot delete my own answer. Something has been changed here since my last attempt...