OpenVSPAPI  3.36.0
Functions
Parm Container Functions

All Parms in OpenVSP are stored in Parm Containers. The functions in this group can be used to work with Parm Containers through the API.

Click here to return to the main page. More...

Functions

string[] FindContainers ()
 
string[] FindContainersWithName (const string &in name)
 
string FindContainer (const string &in name, int index)
 
string GetContainerName (const string &in parm_container_id)
 
string[] FindContainerGroupNames (const string &in parm_container_id)
 
string[] FindContainerParmIDs (const string &in parm_container_id)
 
string GetVehicleID ()
 
int GetNumUserParms ()
 
int GetNumPredefinedUserParms ()
 
string[] GetAllUserParms ()
 
string GetUserParmContainer ()
 
string AddUserParm (int type, const string &in name, const string &in group)
 
void DeleteUserParm (const string &in parm_id)
 
void DeleteAllUserParm ()
 

Detailed Description

Function Documentation

◆ AddUserParm()

string AddUserParm ( int  type,
const string &in  name,
const string &in  group 
)

Function to add a new user Parm of input type, name, and group

string length = AddUserParm( PARM_DOUBLE_TYPE, "Length", "Design" );
SetParmValLimits( length, 10.0, 0.001, 1.0e12 );
SetParmDescript( length, "Length user parameter" );
See also
PARM_TYPE
Parameters
[in]typeParm type enum (i.e. PARM_DOUBLE_TYPE)
[in]nameParm name
[in]groupParm group
Returns
Parm ID

◆ DeleteAllUserParm()

void DeleteAllUserParm ( )

Get the user parm container ID

◆ DeleteUserParm()

void DeleteUserParm ( const string &in  parm_id)

Get the user parm container ID

if ( id_arr.size() > n )
{
DeleteUserParm( id_arr[n] );
}

◆ FindContainer()

string FindContainer ( const string &in  name,
int  index 
)

Get the ID of a Parm Container with specified name at input index

//===== Get Vehicle Parm Container ID ====//
string veh_id = FindContainer( "Vehicle", 0 );
See also
FindContainersWithName
Parameters
[in]nameParm Container name
[in]indexParm Container index
Returns
Parm Container ID

◆ FindContainerGroupNames()

string [] FindContainerGroupNames ( const string &in  parm_container_id)

Get an array of Parm group names included in the specified Container

string user_ctr = FindContainer( "UserParms", 0 );
array<string> @grp_arr = FindContainerGroupNames( user_ctr );
Print( "---> UserParms Container Group IDs: " );
for ( int i = 0; i < int( grp_arr.size() ); i++ )
{
string message = "\t" + grp_arr[i] + "\n";
Print( message );
}
Parameters
[in]parm_container_idParm Container ID
Returns
Array of Parm group names

◆ FindContainerParmIDs()

string [] FindContainerParmIDs ( const string &in  parm_container_id)

Get an array of Parm IDs included in the specified Container

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
//==== Get Structure Name and Parm Container ID ====//
string parm_container_name = GetFeaStructName( pod_id, struct_ind );
string parm_container_id = FindContainer( parm_container_name, struct_ind );
//==== Get and List All Parms in the Container ====//
array<string> parm_ids = FindContainerParmIDs( parm_container_id );
for ( uint i = 0; i < uint(parm_ids.length()); i++ )
{
string name_id = GetParmName( parm_ids[i] ) + string(": ") + parm_ids[i] + string("\n");
Print( name_id );
}
Parameters
[in]parm_container_idParm Container ID
Returns
Array of Parm IDs

◆ FindContainers()

string [] FindContainers ( )

Get an array of all Parm Container IDs

Print( "---> API Parm Container IDs: " );
for ( int i = 0; i < int( ctr_arr.size() ); i++ )
{
string message = "\t" + ctr_arr[i] + "\n";
Print( message );
}
Returns
Array of Parm Container IDs

◆ FindContainersWithName()

string [] FindContainersWithName ( const string &in  name)

Get an array of Parm Container IDs for Containers with the specified name

array<string> @ctr_arr = FindContainersWithName( "UserParms" );
if ( ctr_arr.size() > 0 ) { Print( ( "UserParms Parm Container ID: " + ctr_arr[0] ) ); }
Parameters
[in]nameParm Container name
Returns
Array of Parm Container IDs

◆ GetAllUserParms()

string [] GetAllUserParms ( )

Get the vector of id's for all user parameters

Print( "---> User Parm IDs: " );
for ( int i = 0; i < int( id_arr.size() ); i++ )
{
string message = "\t" + id_arr[i] + "\n";
Print( message );
}
Returns
Array of user parameter ids

◆ GetContainerName()

string GetContainerName ( const string &in  parm_container_id)

Get the name of the specified Parm Container

string veh_id = FindContainer( "Vehicle", 0 );
if ( GetContainerName( veh_id ) != "Vehicle" ) { Print( "---> Error: API GetContainerName" ); }
Parameters
[in]parm_container_idParm Container ID
Returns
Parm Container name

◆ GetNumPredefinedUserParms()

int GetNumPredefinedUserParms ( )

Get the number of pre-defined user parameters

Returns
Number of pre-defined user Parms

◆ GetNumUserParms()

int GetNumUserParms ( )

Get the number of user parameters

int n = GetNumUserParms();
Returns
Number of user Parms

◆ GetUserParmContainer()

string GetUserParmContainer ( )

Get the user parm container ID

string up_id = GetUserParmContainer();
Returns
User parm container ID

◆ GetVehicleID()

string GetVehicleID ( )

Get the ID of the Vehicle Parm Container

//===== Get Vehicle Parm Container ID ====//
string veh_id = GetVehicleID();
Returns
Vehicle ID
GetVehicleID
string GetVehicleID()
FindContainersWithName
string[] FindContainersWithName(const string &in name)
FindContainerParmIDs
string[] FindContainerParmIDs(const string &in parm_container_id)
DeleteUserParm
void DeleteUserParm(const string &in parm_id)
GetNumPredefinedUserParms
int GetNumPredefinedUserParms()
GetContainerName
string GetContainerName(const string &in parm_container_id)
FindContainerGroupNames
string[] FindContainerGroupNames(const string &in parm_container_id)
DeleteAllUserParm
void DeleteAllUserParm()
GetParmName
string GetParmName(const string &in parm_id)
GetFeaStructName
string GetFeaStructName(const string &in geom_id, int fea_struct_ind)
GetAllUserParms
string[] GetAllUserParms()
FindContainers
string[] FindContainers()
GetUserParmContainer
string GetUserParmContainer()
string
AngelScript ScriptExtension for representing the C++ std::string.
Definition: openvsp_as.h:192
FindContainer
string FindContainer(const string &in name, int index)
SetParmDescript
void SetParmDescript(const string &in parm_id, const string &in desc)
SetParmValLimits
double SetParmValLimits(const string &in parm_id, double val, double lower_limit, double upper_limit)
array
AngelScript ScriptExtension for representing the C++ std::vector.
Definition: openvsp_as.h:249
AddGeom
string AddGeom(const string &in type, const string &in parent=string())
AddUserParm
string AddUserParm(int type, const string &in name, const string &in group)
Print
void Print(const string &in data, bool new_line=true)
GetNumUserParms
int GetNumUserParms()
PARM_DOUBLE_TYPE
@ PARM_DOUBLE_TYPE
Definition: openvsp_as.h:1978
AddFeaStruct
int AddFeaStruct(const string &in geom_id, bool init_skin=true, int surfindex=0)