Search:     Advanced search

GetLine(X,Y,X2,Y2,Hint)

Article ID: 287
Last updated: 24 Sep, 2010
Views: 968
Posted: 03 Dec, 2008
by Thomas B.
Updated: 24 Sep, 2010
by Murray D.

 

Description:

Requests the user to select a line on the currently selected page. Returns 1 for success and 0 for canceled. X, Y ,X2 and Y2 are variables that will receive the resulting line. All parameters are optional. Resulting line can also be accessed by using the ResultPointX, ResultPointY, ResultPointX2, ResultPointY2 functions.

Notes:

Example creates a segmented line at the GetLine location. Copy and paste Script into a new PlanSwift script.

Pascal Example:

ATab := CurrentTab;
X1 := 0;
Y1 := 0;
X2 := 0;
Y2 := 0;
GetLine(X1,Y1,X2,Y2,'Draw Line');
NewSegment := NewItem(ATab);
SetDigitizerType(NewSegment,'Segment');
SetItemProperty(NewSegment,'Name','Test Segment');
NewSection := AddSection(NewSegment);
AddPoint(NewSegment,X1,Y1,NewSection);
AddPoint(NewSegment,X2,Y2,NewSection);

Visual Basic Example:

ATab = CurrentTab;
X1 = 0
Y1 = 0
X2 = 0
Y2 = 0
GetLine(X1,Y1,X2,Y2,"Draw Line")
NewSegment = NewItem(ATab)
SetDigitizerType(NewSegment,"Segment")
SetItemProperty(NewSegment,"Name","Test Segment")
NewSection = AddSection(NewSegment)
AddPoint(NewSegment,X1,Y1,NewSection)
AddPoint(NewSegment,X2,Y2,NewSection)


Enterprise and Developer editions

This article was:  
Prev  Not what you're looking for? Suggest a topic  Next
GetPoint(X,Y,Hint)     GetRect(X,Y,X2,Y2,Hint)