SetEndArrow
Sets the ending arrow of the stroke.
Syntax
expression.SetEndArrow(type, width, length);
expression - A variable that represents an ApiStroke class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| type | Required | LineEndType | The type of the ending arrow. | |
| width | Optional | LineEndSize | "medium" | The width of the ending arrow. |
| length | Optional | LineEndSize | "medium" | The length of the ending arrow. |
Returns
boolean
Example
Add an arrowhead to the end of a line in a presentation.
// How do I set the ending arrow of a line's stroke in a presentation?
// Create a line, retrieve its stroke, apply a stealth arrow to the end, and label the result in a presentation.
let presentation = Api.GetPresentation();
let slide = presentation.GetSlideByIndex(0);
let fill = Api.CreateSolidFill(Api.RGB(255, 200, 100));
let stroke = Api.CreateStroke(36000, Api.CreateSolidFill(Api.RGB(0, 0, 255)));
let line = Api.CreateShape("line", 100 * 36000, 50 * 36000, fill, stroke);
line.SetPosition(2000000, 1000000);
slide.AddObject(line);
let retrievedStroke = line.GetLine();
let result = retrievedStroke.SetEndArrow("stealth", "medium", "large");
let label = Api.CreateShape("rect", 120 * 36000, 30 * 36000, fill, Api.CreateStroke(0, Api.CreateNoFill()));
label.SetPosition(2000000, 3000000);
slide.AddObject(label);
label.GetDocContent().GetElement(0).AddText("End arrow set: " + result);