Activate the tool to acquire the coordinates of a point.
Syntax: |
---|
DlxGraphixDocument.ToolPickPoint(toolId, nPoints, showMode = DlxApp.TOOLPICKPOINT_SHOWLAST, pointTitle = "", firstPoint = null) |
Parameters
Parameter | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
toolId | A numerical value that identifies the tool. This value is passed to the function that handles the OnToolPickPoint event. | ||||||||||
nPoints | Number of points to be acquired. Specify a value between 1 and 32. If you specify -1 you can acquire a variable number of points. | ||||||||||
showMode | Specify one of the following values:
|
||||||||||
pointTitle | The names of the points to be acquired separated by the newline character '\n'. It is shown in the tool menu and in the dialog box for entering the coordinates of the point. | ||||||||||
firstPoint | If you need to capture more than one point, you can specify the starting point. If you do not want to set the initial point, do not enter this parameter. |
Return Value
If the value of nPoint is 1 it returns a DlxPoint object with the coordinates of the point. Use IsValid to verify that the point is valid. If the value of nPoint is 2 it returns a DlxSegment object with the coordinates of the points. Use IsValid to verify that the segment is valid. If the value of nPoints is greater than 2 or is -1 an array of DlxPoint objects is returned. Check the length property of the array to determine the number of points returned.
Remarks
At each mouse movement, this tool generates the OnToolPickPoint event. Create a function to handle the OnToolPickPoint event if you want to customize the operation of the tool.
Example
See the script Draw spiral.clxjs.