STK ObjectsSend comments on this topic.
IAgCvAssetListCollection Interface

Description

Asset List.

Public Methods

Public Method AddAdds a new element to the collection.
Public Method CanAssignAssetReturns true is you can assign an asset.
Public Method GetAssetFromPathRetrieves an element, given an object path.
Public Method IsAssetAssignedReturns true if an asset is already assigned.
Public Method RemoveRemoves an element from the collection given a ObjectPath.
Public Method RemoveAllRemoves all elements from the collection.
Public Method RemoveAtRemoves an element from the collection using specified index.

Public Properties

Public Property AvailableAssetsAvailable objects to assign as coverage assets.
Public Property CountReturns the number of elements in a collection.
Public Property ItemGiven an index, returns an element in the collection.

Example

Define a coverage definition assets
[C#]
IAgCvAssetListCollection assetCollection = coverageDefinition.AssetList;
string satAssetName = "Satellite/sat1";
string facAssetName = "Facility/North";

// Remove asset collection if necessary
assetCollection.RemoveAll();

IAgCvAssetListElement satAsset1 = null;

// AvailableAssets returns a one dimensional array of assets
if (Array.IndexOf(assetCollection.AvailableAssets, satAssetName) != -1)
{
    // Add assets to coverageDefinition
    if (assetCollection.CanAssignAsset(satAssetName))
    {
        satAsset1 = assetCollection.Add(satAssetName);

        // Configure asset element
        satAsset1.Required = true;
    }
}

// AvailableAssets returns a one dimensional array of assets
if (Array.IndexOf(assetCollection.AvailableAssets, facAssetName) != -1)
{
    // Add assets to coverageDefinition
    if (assetCollection.CanAssignAsset(facAssetName))
    {
        assetCollection.Add(facAssetName);
    }
}
Define a coverage definition assets
[Visual Basic .NET]
Dim assetCollection As IAgCvAssetListCollection = coverageDefinition.AssetList
Dim satAssetName As String = "Satellite/sat1"
Dim facAssetName As String = "Facility/North"

' Remove asset collection if necessary
assetCollection.RemoveAll()

Dim satAsset1 As IAgCvAssetListElement = Nothing

' AvailableAssets returns a one dimensional array of assets
If Array.IndexOf(assetCollection.AvailableAssets, satAssetName) <> -1 Then
	' Add assets to coverageDefinition
	If assetCollection.CanAssignAsset(satAssetName) Then
		satAsset1 = assetCollection.Add(satAssetName)

		' Configure asset element
		satAsset1.Required = True
	End If
End If

' AvailableAssets returns a one dimensional array of assets
If Array.IndexOf(assetCollection.AvailableAssets, facAssetName) <> -1 Then
	' Add assets to coverageDefinition
	If assetCollection.CanAssignAsset(facAssetName) Then
		assetCollection.Add(facAssetName)
	End If
End If
© 2024 Analytical Graphics, Inc. All Rights Reserved.