Search:     Advanced search

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

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

 

Description:

Requests the user to select a rectangle 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 rectangle. All parameters are optional. Resulting rectangle can also be accessed by using the ResultPointX, ResultPointY, ResultPointX2, ResultPointY2 functions.

Notes:

Example creates a Area at the GetRect location. Copy and paste script(s) 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,X1,Y2,NewSection);
AddPoint(NewSegment,X2,Y2,NewSection);
AddPoint(NewSegment,X2,Y1,NewSection)

Visual Basic Example:

ATab = CurrentTab
X1 = 0
Y1 = 0
X2 = 0
Y2 = 0
GetRect(X1,Y1,X2,Y2,"Draw Area")
NewSegment = NewItem(ATab)
SetDigitizerType(NewSegment,"Area")
SetItemProperty(NewSegment,"Name","Test Area")
NewSection = AddSection(NewSegment)
AddPoint(NewSegment,X1,Y1,NewSection)
AddPoint(NewSegment,X1,Y2,NewSection)
AddPoint(NewSegment,X2,Y2,NewSection)
AddPoint(NewSegment,X2,Y1,NewSection)


Enterprise and Developer editions

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