AGI STK Objects 11 Send comments on this topic.
SetLocationType Method (IAgSensor)
See Also  Example
LocationType





Description

The sensor's location type, a member of the AgESnLocation enumeration.

Syntax

[Visual Basic .NET]
Public Sub SetLocationType( _
   ByVal LocationType As AgESnLocation _
) 

[C#]
public void SetLocationType(
AgESnLocation LocationType
);

[Managed C++]
public: void SetLocationType(
AgESnLocation LocationType
);

[Java]
public  setLocationType(
AgESnLocation LocationType
);

[Unmanaged C++]
public: HRESULT SetLocationType(
AgESnLocation LocationType
);

Parameters

LocationType
Member Value Description
eSnFixed 0 Fixed: the location of the sensor is defined using a fixed displacement vector with respect to the parent objects body frame.
eSn3DModel 1 3D Model: the location of the sensor is defined using the sensor's 3D Graphics Vertex Offset properties.
eSn3DModelWithScale 2 3D Model with Scale: the location of the sensor is defined using the sensor's 3D Graphics Vertex Offset properties. Location is computed using the scaled model defined for visualization.
eSnCenter 3 Center: the sensor is located at the center of its parent object.
eSnLocationCrdnPoint 4 Point: the sensor's location is based upon a Vector Geometry Tool point.

Example

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 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