version 6.0
DR GET LINE SPECS (area; scope; startH; startV; endH; endV)
Parameter | Type | Description | |
area | Longint | 4D Draw area | |
scope | Longint | -1=All | |
0=Selected | |||
>0=Object ID | |||
startH | Number | Horizontal position of start | |
startV | Number | Vertical position of start | |
endH | Number | Horizontal position of end | |
endV | Number | Vertical position of end |
Description
The command DR GET LINE SPECS returns into the startH, startV, endH, and endV variables the endpoints of the line in area described by scope.
If scope equals -1, the command returns endpoints for the first object in the document.
If scope equals 0, the command returns the endpoints for the first selected object.
If scope is greater than 0, it must be equal to a specific line's ID; the command returns that line's endpoints. If the object does not exist, DR GET LINE SPECS returns -32000 for each attribute, and DR Error returns error number 2. If the object described by scope is not a line, DR GET LINE SPECS returns -32000 for each attribute and DR Error returns error number 47.
startH and startV are the horizontal and vertical positions of the starting point of the line.
endH and endV are the horizontal and vertical positions of the ending point of the line.
When the user creates a line, the starting point is the point at which the user begins drawing the line and the end is where the mouse is released. As a consequence, the beginning of a line is not necessarily above or to the left of the end of the line. It is important to identify the beginning and ending of a line when adding endmarks.
All coordinates are expressed in base units according to the current position of the origin. Use the DR Base to scale function to convert from base units to scale units.
Example
The following example draws an oval around the selected line and brings the line to the front of the drawing:
DR GET LINE SPECS (area;0;startH;StartV;EndH;endV) If (0=DR Error ) Oval:=DR Draw oval (area;startH-0.25;startV-0.25;endH+0.25; endV+0.25;0) DR DO COMMAND (area;5001) ` Bring the line to the front Else ALERT("Please select a single line first!") End if
See Also
DR SET ENDMARKS, DR SET LINE SPECS.