Component Browser Connect
The Component Browser has a Connect command structure that is similar to Communications and Astrogator. This topic describes the command syntax for the Component Browser and explains how to retrieve the range of attributes and values that you can modify using these commands.
Component Browser Connect command syntax
A Component Browser Connect command has three building blocks: the command block, the attribute path, and the attribute block. Build the commands in this order:
<Command><Attribute Path><Attribute>
Together, these blocks tell Connect the operation you want to perform, where you want to perform it, and what attribute you want to perform it on. Each of these blocks is comprised of smaller elements, as explained in detail in the sections below. Each discussion of the syntax blocks includes the following command as a reference example:
ComponentBrowser */ SetValue "Central Bodies" "My Ganymede" "Shape.Oblate Spheroid.Rmin" 6370 km
Command
The command block of a Component Browser Connect command determines (1) the operation that it will perform when it executes and (2) the location, which is always the STK scenario, of the targeted object. Here is the reference example with the command block highlighted in bold:
ComponentBrowser */ SetValue "Central Bodies" "My Ganymede" "Shape.Oblate Spheroid.Rmin" 6370 km
There are three elements that make up the command block. You must separate each from the others by a single blank space:
<Prefix> {Scenario Path} <Operator>
Prefix
The prefix defines which type of object or property you are going to interact with. Use the prefix ComponentBrowser_RM with the GetValue, GetSource, and GetFilePath operators and use the prefix ComponentBrowser with the other operators.
Here is the reference example with the prefix highlighted in bold:
ComponentBrowser */ SetValue "Central Bodies" "My Ganymede" "Shape.Oblate Spheroid.Rmin" 6370 km
{Scenario Path}
All components are located at the scenario, so for all Component Browser Connect commands, the object path is the scenario path, */. Here is the reference example with the object path highlighted in bold:
ComponentBrowser */ SetValue "Central Bodies" "My Ganymede" "Shape.Oblate Spheroid.Rmin" 6370 km
Operator
The operator is the syntax element that determines the specific action that the command will execute. The following operators are available for Component Browser Connect commands:
Operator | Description |
---|---|
SetValue | Use this to set the value specified in the <Value> pointed to by the <AttributePath>. |
GetValue | Use this to get the value(s) pointed to by the <AttributePath>. If an attribute is not specified, the command returns all of the attributes for the entire component. If you do not specify a component, the command returns all of the components for the entire library. If you do not specify a library, the command returns all of the libraries available to the Component Browser. |
GetSource | Use this to get the source(s) pointed to by the <AttributePath>. |
GetFilePath | Use this to get the file path(s) pointed to by the <AttributePath>. |
Duplicate | Use this to create a copy of an existing component. |
Rename | Use this to rename a user-created component. |
Delete | Use this to delete a user-created component. |
AddItem | Use this to add a user-created component. Before using this operator, you must apply the Duplicate operator to copy an existing component to create the component you want to add. |
AddToUserCollection | Use this to add a user-created component to a collection in the Component Browser such that it is available for any scenario. Before using this operator, you must apply the Duplicate operator to copy an existing component to create the component you want to add. |
Import |
Use this to import a single component file from a source external to STK. You must specify the name and path of the external component file you are importing. The file contains sufficient metadata for STK to place it in the proper Component Type folder. If a component with the same name exists in the Component Browser, the command overwrites it with the external file. The format is then: Import <ExternalFilenamePath> |
ImportFolder |
Use this to import all matching-type components of an external folder into the folder of a certain component type in the Component Browser. You must specify the external folder path as well as the Component Type folder and optionally the Component Type subfolder, in that order. You also have the option to add on an overwrite behavior, with the choices of Overwrite to replace all components with the same name or Skip, to retain current components that have the same names as imported components. The format is then: ImportFolder <ExternalFolderPath> <ComponentTypeFolder/Component Subfolder> <OverwriteBehavior> |
Export |
Use this to export a single component file from your Component Browser to a folder external to STK. First you must specify both the the Component Type folder and the name of the specific component within that folder. Next you must specify the file path of the external folder that includes a name for the new component file. You can specify the extension of the new component file, or you can have the command assign a default extension that matches the component type. You can only export files that are not read only, which excludes preinstalled components and components that you placed in your User Collection. The format is then: Export <ComponentTypeFolder> <ComponentName> <ExternalFilenamePath> |
ExportFolder |
Use this to export some or all components of a certain component type in the Component Browser into an external folder. First you must specify the Component Type folder and optionally a subfolder. Then you must specify the external folder path. The command will only export files that are not read only, which excludes preinstalled components and components that you placed in your User Collection. You also have the option to add on an overwrite behavior, with the choices of Overwrite to replace all components with the same name or Skip, to retain the current components with the same name. The format is then: ExportFolder <ComponentTypeFolder/ComponentTypeSubfolder> <ExternalFolderPath> <OverwriteBehavior> |
Here is the reference example with the operator highlighted in bold:
ComponentBrowser */ SetValue "Central Bodies" "My Ganymede" "Shape.Oblate Spheroid.Rmin" 6370 km
Attribute Path
The attribute path of a Component Browser Connect command identifies the location, within the component libraries and individual components, of the targeted attribute. The exact syntax and length of the attribute path depends on the individual attribute. You must separate the component library and component name from surrounding command elements by spaces and enclose them in quotes if the name contains any spaces. If the targeted attribute is subordinate to other attributes of the component, then you should name those parent attributes in hierarchical order, separated by periods. If any parent attribute contains a space, then you must enclose the entire chain in quotes.
Here is the reference example with the attribute path highlighted in bold:
ComponentBrowser */ SetValue "Central Bodies" "My Ganymede" "Shape.Oblate Spheroid.Rmin" 6370 km
List Indexing
For GetValue and SetValue commands, you can add an index in the Attribute Path to access the particular row of interest. For example, to get the second beam's ID in a multibeam transmitter model, you would use the Attribute Path in this command:
ComponentBrowser _RM */ GetValue "Transmitter Models" "My Multibeam Transmitter Model" Model.AntennaSystem.AntennaBeams[1].BeamID
The indexing is zero based. Therefore, to access the second beam, you use an index of "1" in the Attribute Path; [0] is the default.
Attribute
The attribute block of a Component Browser Connect command identifies the attribute that the command will interact with and the value and units to be set, if applicable. The attribute block is comprised of three elements:
<Attribute> <Value> [{Unit}]
The attribute element is at the end of the attribute path and is the target of the command. The value element must be a valid setting for the attribute. The unit element is optional.
Here is the reference example with the attribute, value, and unit highlighted in bold:
ComponentBrowser */ SetValue "Central Bodies" "My Ganymede" "Shape.Oblate Spheroid.Rmin" 6370 km
Properties, Choices, and Size
There are three properties common to all attributes that you can use to retrieve information about them: Properties, Choices, and Size. You should place these properties at the end of the attribute path, separated from the attribute by a colon (e.g., :Choices). The Properties property retrieves the currently defined values of all of the properties of the attribute. The Choices property returns a list of all possible choices for non-Boolean attributes with specific arrays of values. The Size property returns the number of rows in the attribute's list, for attributes that can have rows of values. For example, the following command retrieves the values for the diameter of the Bessel Aperture Circular antenna component:
ComponentBrowser_RM */ GetValue "Antenna Models" "Bessel Aperture Circular" Diameter:Properties
The following command uses the original reference example to retrieve the values for the Rmin attribute:
ComponentBrowser_RM */ GetValue "Central Bodies" "My Ganymede" "Shape.Oblate Spheroid.Rmin":Properties
Examples
Retrieves a list of component libraries:
ComponentBrowser_RM */ GetValue
Creates a copy of the installed central body component "Charon" with the name "My Charon":
ComponentBrowser */ Duplicate "Central Bodies" Charon "My Charon"
Retrieves the value of the SurfaceTemperature attribute of the Simple Satcom atmospheric absorption model:
ComponentBrowser_RM */ GetValue "Atmospheric Absorption Models" "Simple Satcom" SurfaceTemperature
Retrieves the source of the "Copy of Dipole" attribute of the "Antenna Models" collection:
ComponentBrowser_RM */ GetSource "Antenna Models" "Copy of Dipole"
Retrieves the file path of the "Copy of Dipole" attribute of the "Antenna Models" collection:
ComponentBrowser_RM */ GetFilePath "Antenna Models" "Copy of Dipole"
Defines the radius of the sphere-shaped central body model "My Ganymede":
ComponentBrowser */ SetValue "Central Bodies" "My Ganymede" Shape.Sphere.R 2500000 m
Renames the "Copy of Dipole" antenna model component (the default name given to a duplicated component) to "My Dipole":
ComponentBrowser */ Rename "Antenna Models" "Copy of Dipole" "My Dipole"
Deletes the "My Earth J2" propagator component:
ComponentBrowser */ Delete "Propagators" "My Earth J2"
For the "Scattering Point Provider List" attribute, this duplicates the list called "Scattering_Point_Provider_List" and names the copy "MyPPL":
ComponentBrowser */ Duplicate "Scattering Point Provider List" Scattering_Point_Provider_List MyPPL
Adds a new item to the MyPPL scattering point provider list; you must do the previous Duplicate operation first:
ComponentBrowser */ AddItem "Scattering Point Provider List" MyPPL PointProviderList
Adds a new component, MyDipole, to the "Antenna Models" collection; you must do the Duplicate operation first:
ComponentBrowser */ Duplicate "Antenna Models" Dipole MyDipole
ComponentBrowser */ AddToUserCollection "Antenna Models" MyDipole
Imports a single component file:
ComponentBrowser */ Import "F:/Copy_of_Access.AsStateCalc"
Imports calculation object components to the Calculation Objects folder in the Components Browser, with the default of overwriting any with the same name:
ComponentBrowser */ ImportFolder "F:/ImportTest" "Calculation Objects"
Imports only calculation object components that belong in the Access subfolder of the Calculation Objects folder in the Components Browser, with the default of overwriting any with the same name:
ComponentBrowser */ ImportFolder "F:/ImportTest" "Calculation Objects/Access"
Imports calculation object components to the Calculation Objects folder in the Components Browser, skipping any with the same name:
ComponentBrowser */ ImportFolder "F:/ImportTest" "Calculation Objects" Skip
Exports the single component file "Copy_of_Access" from Calculation Objects folder and places it in the "F" folder with the file name and default extension "test.AsStateCalc":
ComponentBrowser */ Export "Calculation Objects" "Copy_of_Access" "F:/test"
Exports the single component file "Copy_of_Access" from Calculation Objects folder and places it in the "F" folder with the file name and prescribed extension "test.txt":
ComponentBrowser */ Export "Calculation Objects" "Copy_of_Access" "F:/test.txt"
Exports all qualifying calculation object components from Calculation Objects folder and places them in the "F:/ExportTest" folder, overwriting any with the same name:
ComponentBrowser */ ExportFolder "Calculation Objects" "F:/ExportTest"
Exports all qualifying calculation object components from the Access subfolder of the Calculation Objects folder and places them in the "F:/ExportTest" folder, overwriting any with the same name:
ComponentBrowser */ ExportFolder "Calculation Objects/Access" "F:/ExportTest"
Exports all qualifying calculation object components from Calculation Objects folder and places them in the "F:/ExportTest" folder, skipping any with the same name:
ComponentBrowser */ ExportFolder "Calculation Objects" "F:/ExportTest" Skip