VS.Return()
VS.Return() is a class that defines a line connecting two shapes:
A Return is created by adding one to a VS.Document():
myReturn=myDocument.AddReturn(StartID,EndID);
To create a Return line between shapes, you'll need to supply the StartID and EndID of the shapes you are connecting. The ID property of a shape is set using the VS.Shape.SetID() method.
A Return line touches a shape perpendicular to one of its sides.The SetStartDirection() and SetEndDirection() methods specify which side to connect for each end of the line. By default, Returns touch the bottom side of a shape.
Multiple return lines attached to the same shape at the same side will automatically adjust their position slightly so they won't overlap each other.
All of these methods return the Return object and so they can be chained together.
- Curved() - Switches the Return line style from segmented to curved
- SetBehindID() - sets the z-order of the return
- SetEndArrow() - Overrides the arrow setting at the point where the Return line touches the end shape
- SetEndDirection() - Overrides the side of the ending shape that the Return touches
- SetFillColor() - Overrides the background color of any text label on the Return
- SetLineColor() - Overrides the color of the Return line
- SetLinePattern() - Overrides the pattern of the Return line
- SetLineThickness() - Overrides the thickness of the Return line
- SetLineType() - Sets the type of line for the return (Straight, Curved or Standard)
- SetStartArrow() - Overrides the arrow setting at the point that the Return line leaves the start shape
- SetStartDirection() - Overrides the side of the starting shape that the Return touches
- SetTextBold() - Overrides the bold state of any label on the Return line
- SetTextColor() -Overrides the color of text labels on the Return line
- SetTextFont() - Overrides the font of text labels on the Return line
- SetTextItalic() - Overrides the bold state of any label on the Return line
- SetTextSize() - Overrides the font size of text labels on the Return line
- SetTextUnderline() - Overrides the underlined state of any label on the Return line
Example
myReturn=myReturn.Curved();
Syntax
myReturn=myReturn.Curved();
Usage
This method makes the Return line curved instead of segmented.
myReturn=myReturn.SetBehindID(24);
Syntax
myReturn=myReturn.SetBehindID(ShapeID);
Usage
Normally returns sit above shapes in the z-order (back to front order of shapes).
This method allows you to place a return behind a particular shape defined by its ID set using the shape SetID method.
Example
myReturn=myReturn.SetEndArrow(VS.Arrowheads.Filled);
Syntax
myReturn=myReturn.SetEndArrow(arrowhead);
Usage
This method overrides the arrowhead at the end of the Return line that touches the end shape. For a detailed list of arrowhead styles available, read the VSON markup reference guide. Options include: None, Filled, LineArrow, Fancy, FilledCircle, EmptyCircle, Diamond, etc.
Example
myReturn=myReturn.SetEndDirection(VS.Directions.Top);
Syntax
myReturn=myReturn.SetEndDirection(arrowhead);
Usage
This method overrides side of the ending shape that the Return line touches.You can choose: Top, Bottom, Left, Right. By default, the line connects at the bottom.
Example
myReturn=myReturn.SetFillColor("#FF0000");
Syntax
myReturn=myReturn.SetFillColor(color);
Usage
This method overrides the default background color for text labels on the Return line.
A color can be:
- A string specifying an RGB literal in HTML format - "#FF00FF"
- A string specifying an RGBA literal in HTML format - "#FF00FF80" - where the last byte is an opacity
- A string specifying the name of a standard color defined by the VS.Document() SetColors() method
Example
myReturn=myReturn.SetLineColor("#FF0000");
Syntax
myReturn=myReturn.SetLineColor (color);
Usage
This method overrides the line color for the Return line.
A color can be:
- A string specifying an RGB literal in HTML format - "#FF00FF"
- A string specifying an RGBA literal in HTML format - "#FF00FF80" - where the last byte is an opacity
- A string specifying the name of a standard color defined by the VS.Document() SetColors() method
Example
myReturn=myReturn.SetLinePattern(VS.LinePatterns.Dotted);
Syntax
myReturn=myReturn.SetLinePattern(linepattern);
Usage
This method overrides the default pattern for the return line. The default setting is Solid, but you can also choose Dashed or Dotted.
Example
myReturn=myReturn.SetLineThickness(4);
Syntax
myReturn=myReturn.SetLineThickness(thickness);
Usage
This method overrides the default thickness for the return line set in 1/100" increments.
Example
myReturn=myReturn.SetLineType(VS.ReturnLineTypes.Straight);
Syntax
myReturn=myReturn.SetLineType(LineType);
Usage
This method makes the Return line either curved or straight rather that segmented.
Example
myReturn=myReturn.SetStartArrow(VS.Arrowheads.Filled);
Syntax
myReturn=myReturn.SetStartArrow(arrowhead);
Usage
This method sets the arrowhead at the start of the Return line that touches the start shape. For a detailed list of arrowhead styles available, read the VSON markup reference guide. Options include: None, Filled, LineArrow, Fancy, FilledCircle, EmptyCircle, Diamond, etc.
Example
myReturn=myReturn.SetStartDirection(VS.Directions.Right);
Syntax
myReturn=myReturn.SetStartDirection(arrowhead);
Usage
This method overrides the side of the starting shape that the Return line touches. By default, the line starts at the bottom of the shape.
Example
myReturn=myReturn.SetTextBold(true);
Syntax
myReturn=myReturn.SetTextColor(color);
Usage
This method overrides the bold setting for text labels on the Return line. To set a label to bold, set the method to true.
Example
myReturn=myReturn.SetTextColor("#FF0000");
Syntax
myReturn=myReturn.SetTextColor(color);
Usage
This method overrides the default text color setting for text labels on the Return line.
A color can be:
- A string specifying an RGB literal in HTML format - "#FF00FF"
- A string specifying an RGBA literal in HTML format - "#FF00FF80" - where the last byte is an opacity
- A string specifying the name of a standard color defined by the VS.Document() SetColors() method
Example
myReturn=myReturn.SetTextFont("Copperplate");
Syntax
myReturn=myReturn.SetTextFont(fontname);
Usage
This method overrides the default font type setting for text labels on the Return line.
Example
myReturn=myReturn.SetTextItalic(true);
Syntax
myReturn=myReturn.SetTextItalic(italic);
Usage
This method overrides the italic setting for text labels on the Return line. To set a label italic, set the method to true.
Example
myReturn=myReturn.SetTextSize(18);
Syntax
myReturn=myReturn.SetTextSize(textsize);
Usage
This method overrides the default text size setting for text labels on the Return line. Uses point sizes.
Example
myReturn=myReturn.SetTextUnderline(true);
Syntax
myReturn=myReturn.SetTextUnderline(underline);
Usage
This method overrides the default underline setting for text labels on the Return line.