AGI STK Objects 11 Send comments on this topic.
LocationData Property (IAgSensor)
See Also  Example





Description

Get location data for the sensor. The sensor's center point is invalid; all other points are valid choices for the location data.

Property type

Read-only property

Syntax

[Visual Basic .NET]
Public Property LocationData() As IAgLocationData

[C#]
public IAgLocationData LocationData {get;}

[Managed C++]
public: __property IAgLocationData^ get_LocationData();

[Unmanaged C++]
public: HRESULT get_LocationData(
IAgLocationData ** ppRetVal
);

[Java]
public IAgLocationData getLocationData();

Example

Define fixed location
[C#] Copy Code
// Set sensor's location to fixed 
sensor.SetLocationType(AgESnLocation.eSnFixed); 
 
// Configure sensor location 
IAgPosition pos = sensor.LocationData as IAgPosition; 
pos.AssignCartesian(595.20, -110.124.6); 
 

Define location from Vector Geometry Tool point
[C#] Copy Code
// Set location type to VGT 
sensor.SetLocationType(AgESnLocation.eSnLocationCrdnPoint); 
 
// Get IAgLocationCrdnPoint interface 
IAgLocationCrdnPoint vgtPoint = sensor.LocationData as IAgLocationCrdnPoint; 
 
// point sensor to an already existing object 
vgtPoint.PointPath = "Facility/Facility1 Center"
 

Define fixed location
[Visual Basic .NET] Copy Code
' Set sensor's location to fixed
sensor.SetLocationType(AgESnLocation.eSnFixed)

' Configure sensor location
Dim pos As IAgPosition = TryCast(sensor.LocationData, IAgPosition)
pos.AssignCartesian(595.2, -110.12, 4.6)

Define location from Vector Geometry Tool point
[Visual Basic .NET] Copy Code
' Set location type to VGT
sensor.SetLocationType(AgESnLocation.eSnLocationCrdnPoint)

' Get IAgLocationCrdnPoint interface
Dim vgtPoint As IAgLocationCrdnPoint = TryCast(sensor.LocationData, IAgLocationCrdnPoint)

' point sensor to an already existing object
vgtPoint.PointPath = "Facility/Facility1 Center"

See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1