ellipse circle cirlce kind Nicole Scholz How can I change the shape of an ellipse?

How can I only draw an arc or only a section of an ellipse?

In this example three ellipses are painted.

With the method CircleKind the shape of an ellipse can be changed.

/* Retrieve the Desktop object, we need its XComponentLoader interface to load a new documentv*/ oDesktop = UNO.createDesktop() -- get the UNO Desktop service object xComponentLoader = oDesktop~{%see com.sun.star.frame.XDesktop%XDesktop}~{%see com.sun.star.frame.XComponentLoader%XComponentLoader} -- get componentLoader interface /* open the blank file */ url = "private:factory/sdraw" xDrawComponent = xComponentLoader~loadComponentFromURL(url, "_blank", 0, - .UNO~noProps) /* need document's factory to be able to insert created objects */ xDocumentFactory = xDrawComponent~{%see com.sun.star.lang.XMultiServiceFactory%XMultiServiceFactory} /* get draw page by index */ xDrawPage = xDrawComponent~{%see com.sun.star.drawing.XDrawPagesSupplier%XDrawPagesSupplier}~getDrawPages~getByIndex(0)~{%see com.sun.star.drawing.XDrawPage%XDrawPage} /* create a circle and add it to the shape */ xCircle = xDocumentFactory~createInstance("{%see com.sun.star.drawing.EllipseShape}")~{%see com.sun.star.drawing.XShape%xShape} xCircle~setPosition(.bsf~new("{%see com.sun.star.awt.Point}", 2000, 2000)) xCircle~setSize(.bsf~new("{%see com.sun.star.awt.Size}", 5000, 5000)) xDrawPage~add(xCircle) /* create a circle and add it to the shape */ xCircle1 = xDocumentFactory~createInstance("{%see com.sun.star.drawing.EllipseShape}")~{%see com.sun.star.drawing.XShape%xShape} xCircle1~setPosition(.bsf~new("{%see com.sun.star.awt.Point}", 2000, 8000)) xCircle1~setSize(.bsf~new("{%see com.sun.star.awt.Size}", 8000, 5000)) xDrawPage~add(xCircle1) /* create a circle and add it to the shape */ xCircle2 = xDocumentFactory~createInstance("{%see com.sun.star.drawing.EllipseShape}")~{%see com.sun.star.drawing.XShape%xShape} xCircle2~setPosition(.bsf~new("{%see com.sun.star.awt.Point}", 2000, 15000)) xCircle2~setSize(.bsf~new("{%see com.sun.star.awt.Size}", 5000, 7000)) xDrawPage~add(xCircle2) /* set the colours of the circles */ xShapeProps1 = xCircle1~{%see com.sun.star.beans.XPropertySet%XPropertySet} xShapeProps1~setPropertyValue("FillColor", box("int", "FF7F24"x ~c2d)) -- colour the 1st circle orange xShapeProps = xCircle~{%see com.sun.star.beans.XPropertySet%XPropertySet} xShapeProps~setPropertyValue("FillColor", box("int", "8B2323"x ~c2d)) -- colour the 2nd circle dark red xShapeProps2 = xCircle2~{%see com.sun.star.beans.XPropertySet%XPropertySet} xShapeProps2~setPropertyValue("LineColor", box("int", "8B4513"x ~c2d)) -- colour the 3rd circle line brown /* change the shape of the circles */ call syssleep 1 /* 1st circle: show the cut circle connected by 2 lines */ xShapeProps~setPropertyValue("CircleStartAngle", box("int", "2000")) -- start angle 20 degrees xShapeProps~setPropertyValue("CircleEndAngle", box("int", "9000")) -- end angle 90 degrees xShapeProps~setPropertyValue("CircleKind", - bsf.getConstant("{%see com.sun.star.drawing.CircleKind}", "SECTION")) call syssleep 1 /* 2nd circle: show the cut circle connectet by 1 line */ xShapeProps1~setPropertyValue("CircleStartAngle", box("int", "10000")) -- start angle 100 degrees xShapeProps1~setPropertyValue("CircleEndAngle", box("int", "18000")) -- end angle 180 degrees xShapeProps1~setPropertyValue("CircleKind", - bsf.getConstant("{%see com.sun.star.drawing.CircleKind}", "CUT")) call syssleep 1 /* 3rd circle: show the circle with an open cut */ xShapeProps2~setPropertyValue("CircleStartAngle", box("int", "1000")) -- start angle 10 degrees xShapeProps2~setPropertyValue("CircleEndAngle", box("int", "18000")) -- end angle 180 degrees xShapeProps2~setPropertyValue("CircleKind", - bsf.getConstant("com.sun.star.drawing.CircleKind", "ARC")) ::requires UNO.cls -- get UNO support