Async2DPick
Return the object name or lat/lon coordinates of a point clicked in a 2D Graphics window
Syntax
Async2DPick <ScenarioPath> {State} <Parameter>
Description
The Async2DPick command may interrupt normal 2D Graphics window pick operations.
The Async2DPick Connect command allows you to click an object or point with the left mouse button in a 2D Graphics window and returns information regarding that object or point.
- Turn on Asynchronous mode using the ConControl Connect command.
- Send the Async2DPick command.
- Connect returns a message that contains information regarding the object or point clicked with the mouse in a 2D Graphics window.
Valid values for {State} are:
{State} | Description |
---|---|
Once | Returns the next instance path of the object single-clicked, then turns Off. |
On | Returns each instance path of the object single-clicked until {State} is changed to Off. |
Off | Turns Off feature so that no instance paths are returned. |
Broadcast | Returns each instance path of the object single-clicked until {State} is changed to Off. |
The <Parameter> value indicates what data should be returned. Valid values for <Parameter> are:
<Parameter> | Description |
---|---|
ObjectName | Returns the name of the object clicked in the 2D Graphics window. |
LatLon | Returns the latitude and longitude coordinates of the point clicked in the 2D Graphics window |
FirstHit | Returns information on the closest picked object. |
AllHits | Returns information on all picked items in order from closest to farthest away. |
UTM | Returns a string representing the UTM for the pick point. The UTM is specified by a zone identifier string, an easting distance, and a northing distance. This option is only valid on a map of the Earth. |
MGRS | Returns a string representing the MGRS for the pick point. This option is only valid on a map of the Earth. |
If FirstHit or AllHits is entered and an object is clicked then information returned is: "Object <ObjectPath> 2DWindowID <WinNumber>".
If FirstHit or AllHits is entered and a point on the map is clicked the following is returned: "Position Lat <Lat> Lon <Lon> 2DWindowID <WinNumber>"
If FirstHit or AllHits is entered and an object event is clicked then the event name will be included in the returned information: "Object <ObjectPath> EventID <EventName> "Position Lat <Lat> Lon <Lon> 2DWindowID <WinNumber>"
To prevent the Async2DPick command from returning multiple instances of the same object use the Graphics AsyncPickReturnUnique command.
Any Map created AFTER an Async2DPick Connect command has been sent can't be used to identify the cursor position.
Examples
To return all instance paths for objects clicked on in the second 2D Graphics window:
Return message
A return message similar to the one following is sent if you single-click on the Perth facility in a 2D Graphics window:AGI1421003 ACK 000005000100010011 ASYNC2DPICK AGI1421003 ACK 000005000100010048 /Application/STK/Scenario/Scenario1/Facility/Perth
Examples
To capture latitude and longitude points for picks (i.e., clicking a point):
Return message
Return messages similar to that shown here would be sent if Async2DPick is set to On and you clicked in the general vicinity of the Perth, Baikonur, WhiteSands, Wallops, and Santiago facilities (respectively) in the 2D Graphics window, as illustrated in the following examples:AGI421015ACK 000004000100010015 ASYNC2DPICK AGI421015ASYNC2DPICK000004000100010019 -29.74577 114.97537 AGI421015ASYNC2DPICK000004000100010017 49.57627 54.08867 AGI421015ASYNC2DPICK000004000100010019 35.08475 -107.29064 AGI421015ASYNC2DPICK000004000100010018 41.94915 -80.09852 AGI421015ASYNC2DPICK000004000100010019 -31.27119 -71.23153
Examples
To capture information on the nearest clicked point:
Return message
Return messages similar to that shown here would be sent the above Async2DPick was sent and you then clicked near the airBwAutoTerrainRegion aircraft in the 2D Graphics window 1:AGI421003ACK 000062000100010011 ASYNC2DPICK AGI421011ASYNC2DPICK 000062000100000085 Object /Application/STK/Scenario/testAOU/Aircraft/airBwAutoTerrainRegion 2DWindowID 1A return message similar to the one following is sent if you single-click on the map in a 2D Graphics window:
AGI1421003 ACK 000005000100010011 ASYNC2DPICK AGI421011ASYNC2DPICK 000062000100000051 Position Lat 35.322114 Lon -117.835419 2DWindowID 1A return message similar to the one following is sent if you single-click on an object event in 2D window 2:
AGI1421003 ACK 000005000100010011 ASYNC2DPICK AGI421011ASYNC2DPICK 000365000100000133 Object /Application/STK/Scenario/Scenario1/Satellite/Satellite1 EventId TimeEvent4 Position Lat 59.003368 Lon -53.253598 2DWindowID 2
Group membership
This command belongs to the following group(s):
Version
7.0