VS.Return()

VS.Return() is a class that defines a line connecting two shapes:

VisualScript return

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.

VisualScript return line

VS.Return() Methods

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
  • 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
  • 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

Curved()

Example

myReturn=myReturn.Curved();

Syntax

myReturn=myReturn.Curved();

Usage

This method makes the Return line curved instead of segmented.

Change the line to curved

SetEndArrow()

Example

myReturn=myReturn.SetEndArrow(VS.Arrowheads.Filled);

Change the end arrow style

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.

SetEndDirection()

Example

myReturn=myReturn.SetEndDirection(VS.Directions.Top);

Change the direction of the line

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.

SetFillColor()

Example

myReturn=myReturn.SetFillColor("#FF0000");

Change the fill color

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

SetLineColor()

Example

myReturn=myReturn.SetLineColor("#FF0000");

Change the line color of the return

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

SetLinePattern()

Example

myReturn=myReturn.SetLinePattern(VS.LinePatterns.Dotted);

Change the pattern of the return line

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.

SetLineThickness()

Example

myReturn=myReturn.SetLineThickness(4);

Change the line thickness for a return

Syntax

myReturn=myReturn.SetLineThickness(thickness);

Usage

This method overrides the default thickness for the return line set in 1/100" increments.

SetStartArrow()

Example

myReturn=myReturn.SetStartArrow(VS.Arrowheads.Filled);

VisualScript return start arrow

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.

SetStartDirection()

Example

myReturn=myReturn.SetStartDirection(VS.Directions.Right);

VisualScript return start direction

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.

SetTextBold()

Example

myReturn=myReturn.SetTextBold(true);

VisualScript return text bold

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.

SetTextColor()

Example

myReturn=myReturn.SetTextColor("#FF0000");

VisualScript return text color

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

SetTextFont()

Example

myReturn=myReturn.SetTextFont("Copperplate");

VisualScript return text font

Syntax

myReturn=myReturn.SetTextFont(fontname);

Usage

This method overrides the default font type setting for text labels on the Return line.

SetTextItalic()

Example

myReturn=myReturn.SetTextItalic(true);

VisualScript return text italic

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.

SetTextSize()

Example

myReturn=myReturn.SetTextSize(18);

VisualScript return text size

Syntax

myReturn=myReturn.SetTextSize(textsize);

Usage

This method overrides the default text size setting for text labels on the Return line. Uses point sizes.

SetTextUnderline()

Example

myReturn=myReturn.SetTextUnderline(true);

VisualScript return text underline

Syntax

myReturn=myReturn.SetTextUnderline(underline);

Usage

This method overrides the default underline setting for text labels on the Return line.