AGI STK Objects 11 Send comments on this topic.
IAgVOModelTransCollection Collection





Description

IAgVOModelTransCollection Interface. A collection of available transformations in the model.

Object Model

Public Properties

Public Property Count Returns a number of elements in the collection.
Public Property Item Returns a model transformation by name or at a specified position.
Public Property Name Name of the Model Transformation.

Example

Configure 3D model articulations
[C#] Copy Code
// Configure articulation 
IAgVOModelArtic modelArticulation = model.Articulation; 
modelArticulation.EnableDefaultSave = false
modelArticulation.EnableSaveArticFile = false
 
// Set our articulation and transformations 
// For this sample, these articulations exist for a default satellite model 
int levelOfDetail = 0
string articulation = "Satellite"
string transformation = "Size"
 
 
// Get the current transition value 
double currentTransVal = modelArticulation.GetTransValue(levelOfDetail, articulation, transformation); 
 
// Change the value 
double newTransVal = currentTransVal * 0.50
 
// Set our new transition value 
modelArticulation.SetTransValue(levelOfDetail, articulation, transformation, newTransVal); 
 

List all 3D model articulations
[C#] Copy Code
// Enumerating through the transformation collection is helpful if you do not 
// know what tranformations exist or their value ranges 
 
IAgVOModelArtic modelArticulation = model.Articulation; 
 
for (int lod = 0; lod < modelArticulation.LODCount; lod++) 

    // Get all articulations 
    // GetAvailableArticulations returns a one dimensional array of articulation names 
    Array articulations = modelArticulation.GetAvailableArticulations(lod); 
 
    // Enumerate through available articulations 
    for (int articulation = 0; articulation < articulations.Length; articulation++) 
    { 
        // We need the articulation string to call the GetAvailableTransformations function 
        String articulationString = articulations.GetValue(articulation) as String
 
        // Get all transformations 
        IAgVOModelTransCollection transformations = modelArticulation.GetAvailableTransformations(lod, articulationString); 
 
        // Enumerate through available transformations 
        foreach (IAgVOModelTrans trans in transformations) 
        { 
            Console.WriteLine("Name: {0}, Current {1}, Max {2}, Min {3}", trans.Name, trans.Value, trans.Max, trans.Min); 
        } 
    } 

 

Configure 3D model articulations
[Visual Basic .NET] Copy Code
' Configure articulation
Dim modelArticulation As IAgVOModelArtic = model.Articulation
modelArticulation.EnableDefaultSave = False
modelArticulation.EnableSaveArticFile = False

' Set our articulation and transformations
' For this sample, these articulations exist for a default satellite model
Dim levelOfDetail As Integer = 0
Dim articulation As String = "Satellite"
Dim transformation As String = "Size"


' Get the current transition value
Dim currentTransVal As Double = modelArticulation.GetTransValue(levelOfDetail, articulation, transformation)

' Change the value
Dim newTransVal As Double = currentTransVal * 0.5

' Set our new transition value
modelArticulation.SetTransValue(levelOfDetail, articulation, transformation, newTransVal)

List all 3D model articulations
[Visual Basic .NET] Copy Code
' Enumerating through the transformation collection is helpful if you do not
' know what tranformations exist or their value ranges

Dim modelArticulation As IAgVOModelArtic = model.Articulation

Dim lod As Integer = 0
While lod <>
    ' Get all articulations
    ' GetAvailableArticulations returns a one dimensional array of articulation names
    Dim articulations As Array = modelArticulation.GetAvailableArticulations(lod)

    ' Enumerate through available articulations
    Dim articulation As Integer = 0
    While articulation <>
        ' We need the articulation string to call the GetAvailableTransformations function
        Dim articulationString As [String] = TryCast(articulations.GetValue(articulation), [String])

        ' Get all transformations
        Dim transformations As IAgVOModelTransCollection = modelArticulation.GetAvailableTransformations(lod, articulationString)

        ' Enumerate through available transformations
        For Each trans As IAgVOModelTrans In transformations
            Console.WriteLine("Name: {0}, Current {1}, Max {2}, Min {3}", trans.Name, trans.Value, trans.Max, trans.Min)
        Next
        System.Math.Max(System.Threading.Interlocked.Increment(articulation),articulation - 1)
    End While
    System.Math.Max(System.Threading.Interlocked.Increment(lod),lod - 1)
End While

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1