Difference between revisions of "API Panel.LinkBar.GetBarPos"
Line 39: | Line 39: | ||
* Declare a variable 'result' of type HANDLE | * Declare a variable 'result' of type HANDLE | ||
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Panel.LinkBar.GetBarPos(linkbar)</pre> | * Add to a calculation icon: <pre class="brush:[cpp]">result = ::Panel.LinkBar.GetBarPos(linkbar)</pre> | ||
− | |||
− |
Latest revision as of 11:54, 16 January 2023
![]() |
GetBarPos |
Gets the position the bar is located at | |
![]() |
LinkBar |
The handle to the bar to read | |
![]() |
Return |
Detailed description
Gets the scale, orientation and center point of the link bar. The position is always specified in world coordinates.
The X and Y scales will equal the width specified by API Panel.LinkBar.SetBarGfx. The Z scale is half the distance between the start and end points of the link. All values are always positive.
The coordinates of the position are always located in the center of the link. Therefore the distance from the coordinates of the bar position to either the start or end is equal to the scale Z.
For the rotation of the position, the only axis that may be accurately relied on is the Z. Rotation around this axis is undefined so the X and Y axis of the position may vary, as these can not be reliably extracted from the start or end positions with 100% reliability.
In the diagram, the blue line representing Z will always point from the start towards the end position. If the start positions coordinates are equal to the end position, and the previous orientation will be used, which will be the world orientation if the link is created with a shared start and end position.
Examples
Calling in a calculation
- Declare a variable 'result' of type HANDLE
- Add to a calculation icon:
result = ::Panel.LinkBar.GetBarPos(linkbar)