OpenVSPAPI  3.20.0
Functions
Sub-Surface Functions

Functions related to Sub-Surfaces are defined in this group.

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

Functions

string AddSubSurf (const string &in geom_id, int type, int surfindex=0)
 
void DeleteSubSurf (const string &in geom_id, const string &in sub_id)
 
void DeleteSubSurf (const string &in sub_id)
 
string GetSubSurf (const string &in geom_id, int index)
 
string[] GetSubSurf (const string &in geom_id, const string &in name)
 
void SetSubSurfName (const string &in geom_id, const string &in sub_id, const string &in name)
 
void SetSubSurfName (const string &in sub_id, const string &in name)
 
string GetSubSurfName (const string &in geom_id, const string &in sub_id)
 
string GetSubSurfName (const string &in sub_id)
 
int GetSubSurfIndex (const string &in sub_id)
 
string[] GetSubSurfIDVec (const string &in geom_id)
 
string[] GetAllSubSurfIDs ()
 
int GetNumSubSurf (const string &in geom_id)
 
int GetSubSurfType (const string &in sub_id)
 
string[] GetSubSurfParmIDs (const string &in sub_id)
 

Detailed Description

Function Documentation

◆ AddSubSurf()

string AddSubSurf ( const string &in  geom_id,
int  type,
int  surfindex = 0 
)

Add a sub-surface to the specified Geom

string wid = AddGeom( "WING", "" ); // Add Wing
// Note: Parm Group for SubSurfaces in the form: "SS_" + type + "_" + count (initialized at 1)
string ss_line_id = AddSubSurf( wid, SS_LINE ); // Add Sub Suface Line
SetParmVal( wid, "Const_Line_Value", "SubSurface_1", 0.4 ); // Change Location
See also
SUBSURF_TYPE
Parameters
[in]geom_idGeom ID
[in]typeSub-surface type enum (i.e. SS_RECTANGLE)
[in]surfindexMain surface index (default: 0)
Returns
Sub-surface ID

◆ DeleteSubSurf() [1/2]

void DeleteSubSurf ( const string &in  geom_id,
const string &in  sub_id 
)

Delete the specified sub-surface

string wid = AddGeom( "WING", "" ); // Add Wing
string ss_line_id = AddSubSurf( wid, SS_LINE ); // Add Sub Suface Line
string ss_rec_id = AddSubSurf( wid, SS_RECTANGLE ); // Add Sub Surface Rectangle
Print("Delete SS_Line\n");
DeleteSubSurf( wid, ss_line_id );
num_ss = GetNumSubSurf( wid );
num_str = string("Number of SubSurfaces: ") + num_ss + string("\n");
Print( num_str );
Parameters
[in]geom_idGeom ID
[in]sub_idSub-surface ID

◆ DeleteSubSurf() [2/2]

void DeleteSubSurf ( const string &in  sub_id)

Delete the specified sub-surface

string wid = AddGeom( "WING", "" ); // Add Wing
string ss_line_id = AddSubSurf( wid, SS_LINE ); // Add Sub Suface Line
string ss_rec_id = AddSubSurf( wid, SS_RECTANGLE ); // Add Sub Surface Rectangle
Print("Delete SS_Line\n");
DeleteSubSurf( ss_line_id );
num_ss = GetNumSubSurf( wid );
num_str = string("Number of SubSurfaces: ") + num_ss + string("\n");
Print( num_str );
Parameters
[in]sub_idSub-surface ID

◆ GetAllSubSurfIDs()

string [] GetAllSubSurfIDs ( )

Get a vector of all sub-surface IDs for the entire model

Returns
Array of sub-surface IDs

◆ GetNumSubSurf()

int GetNumSubSurf ( const string &in  geom_id)

Get the number of sub-surfaces for the specified Geom

string wid = AddGeom( "WING", "" ); // Add Wing
string ss_line_id = AddSubSurf( wid, SS_LINE ); // Add Sub Suface Line
string ss_rec_id = AddSubSurf( wid, SS_RECTANGLE ); // Add Sub Surface Rectangle
int num_ss = GetNumSubSurf( wid );
string num_str = string("Number of SubSurfaces: ") + num_ss + string("\n");
Print( num_str );
Parameters
[in]geom_idGeom ID
Returns
Number of Sub-surfaces

◆ GetSubSurf() [1/2]

string [] GetSubSurf ( const string &in  geom_id,
const string &in  name 
)

Get all sub-surface IDs with specified parent Geom and name

string wid = AddGeom( "WING", "" ); // Add Wing
string ss_rec_id = AddSubSurf( wid, SS_RECTANGLE ); // Add Sub Surface Rectangle
rec_name = GetSubSurfName( ss_rec_id );
id_vec = GetSubSurf( wid, rec_name );
string ID_str = string("IDs of subsurfaces named \"") + rec_name + string("\": ") + id_vec[0];
Print( ID_str );
Parameters
[in]geom_idGeom ID
[in]nameSub-surface name
Returns
Array of sub-surface IDs

◆ GetSubSurf() [2/2]

string GetSubSurf ( const string &in  geom_id,
int  index 
)

Get the ID of the specified sub-surface

string wid = AddGeom( "WING", "" ); // Add Wing
string ss_rec_1 = AddSubSurf( wid, SS_RECTANGLE ); // Add Sub Surface Rectangle #1
string ss_rec_2 = AddSubSurf( wid, SS_RECTANGLE ); // Add Sub Surface Rectangle #2
Print( ss_rec_2, false );
Print( " = ", false );
Print( GetSubSurf( wid, 1 ) );
Parameters
[in]geom_idGeom ID
[in]indexSub-surface index
Returns
Sub-surface ID

◆ GetSubSurfIDVec()

string [] GetSubSurfIDVec ( const string &in  geom_id)

Get a vector of all sub-surface IDs for the specified geometry

string wid = AddGeom( "WING", "" ); // Add Wing
string ss_line_id = AddSubSurf( wid, SS_LINE ); // Add Sub Suface Line
string ss_rec_id = AddSubSurf( wid, SS_RECTANGLE ); // Add Sub Surface Rectangle
string id_type_str = string( "SubSurface IDs and Type Indexes -> ");
for ( uint i = 0; i < uint(id_vec.length()); i++ )
{
id_type_str += id_vec[i];
id_type_str += string(": ");
id_type_str += GetSubSurfType(id_vec[i]);
id_type_str += string("\t");
}
id_type_str += string("\n");
Print( id_type_str );
Parameters
[in]geom_idGeom ID
Returns
Array of sub-surface IDs

◆ GetSubSurfIndex()

int GetSubSurfIndex ( const string &in  sub_id)

Get the index of the specified sub-surface in its parent Geom's sub-surface vector

string wid = AddGeom( "WING", "" ); // Add Wing
string ss_line_id = AddSubSurf( wid, SS_LINE ); // Add Sub Suface Line
string ss_rec_id = AddSubSurf( wid, SS_RECTANGLE ); // Add Sub Surface Rectangle
int ind = GetSubSurfIndex( ss_rec_id );
string ind_str = string("Index of SS_Rectangle: ") + ind + string("\n");
Print( ind_str );
Parameters
[in]sub_idSub-surface ID
Returns
Sub-surface index

◆ GetSubSurfName() [1/2]

string GetSubSurfName ( const string &in  geom_id,
const string &in  sub_id 
)

Get the name of the specified sub-surface

string wid = AddGeom( "WING", "" ); // Add Wing
string ss_rec_id = AddSubSurf( wid, SS_RECTANGLE ); // Add Sub Surface Rectangle
string rec_name = GetSubSurfName( wid, ss_rec_id );
string name_str = string("Current Name of SS_Rectangle: ") + rec_name + string("\n");
Print( name_str );
Parameters
[in]geom_idGeom ID
[in]sub_idSub-surface ID
Returns
Sub-surface name

◆ GetSubSurfName() [2/2]

string GetSubSurfName ( const string &in  sub_id)

Get the name of the specified sub-surface

string wid = AddGeom( "WING", "" ); // Add Wing
string ss_rec_id = AddSubSurf( wid, SS_RECTANGLE ); // Add Sub Surface Rectangle
string rec_name = GetSubSurfName( ss_rec_id );
string name_str = string("Current Name of SS_Rectangle: ") + rec_name + string("\n");
Print( name_str );
Parameters
[in]sub_idSub-surface ID
Returns
Sub-surface name

◆ GetSubSurfParmIDs()

string [] GetSubSurfParmIDs ( const string &in  sub_id)

Get the vector of Parm IDs for specified sub-surface

string wid = AddGeom( "WING", "" ); // Add Wing
string ss_line_id = AddSubSurf( wid, SS_LINE ); // Add Sub Suface Line
// Get and list all Parm info for SS_Line
array<string> parm_id_vec = GetSubSurfParmIDs( ss_line_id );
for ( uint i = 0; i < uint(parm_id_vec.length()); i++ )
{
string id_name_str = string("\tName: ") + GetParmName( parm_id_vec[i] ) + string(", Group: ") + GetParmDisplayGroupName( parm_id_vec[i] ) +
string(", ID: ") + parm_id_vec[i] + string("\n");
Print( id_name_str );
}
Parameters
[in]sub_idSub-surface ID
Returns
Array of Parm IDs

◆ GetSubSurfType()

int GetSubSurfType ( const string &in  sub_id)

Get the type for the specified sub-surface (i.e. SS_RECTANGLE)

string wid = AddGeom( "WING", "" ); // Add Wing
string ss_line_id = AddSubSurf( wid, SS_LINE ); // Add Sub Suface Line
string ss_rec_id = AddSubSurf( wid, SS_RECTANGLE ); // Add Sub Surface Rectangle
string id_type_str = string( "SubSurface IDs and Type Indexes -> ");
for ( uint i = 0; i < uint(id_vec.length()); i++ )
{
id_type_str += id_vec[i];
id_type_str += string(": ");
id_type_str += GetSubSurfType(id_vec[i]);
id_type_str += string("\t");
}
id_type_str += string("\n");
Print( id_type_str );
See also
SUBSURF_TYPE
Parameters
[in]sub_idSub-surface ID
Returns
Sub-surface type enum (i.e. SS_RECTANGLE)

◆ SetSubSurfName() [1/2]

void SetSubSurfName ( const string &in  geom_id,
const string &in  sub_id,
const string &in  name 
)

Set the name of the specified sub-surface

string wid = AddGeom( "WING", "" ); // Add Wing
string ss_rec_id = AddSubSurf( wid, SS_RECTANGLE ); // Add Sub Surface Rectangle
string new_name = string("New_SS_Rec_Name");
SetSubSurfName( wid, ss_rec_id, new_name );
Parameters
[in]geom_idGeom ID
[in]sub_idSub-surface ID
[in]nameSub-surface name

◆ SetSubSurfName() [2/2]

void SetSubSurfName ( const string &in  sub_id,
const string &in  name 
)

Set the name of the specified sub-surface

string wid = AddGeom( "WING", "" ); // Add Wing
string ss_rec_id = AddSubSurf( wid, SS_RECTANGLE ); // Add Sub Surface Rectangle
string new_name = string("New_SS_Rec_Name");
SetSubSurfName( ss_rec_id, new_name );
Parameters
[in]sub_idSub-surface ID
[in]nameSub-surface name
SetSubSurfName
void SetSubSurfName(const string &in geom_id, const string &in sub_id, const string &in name)
GetSubSurfParmIDs
string[] GetSubSurfParmIDs(const string &in sub_id)
DeleteSubSurf
void DeleteSubSurf(const string &in geom_id, const string &in sub_id)
GetParmDisplayGroupName
string GetParmDisplayGroupName(const string &in parm_id)
GetParmName
string GetParmName(const string &in parm_id)
GetSubSurf
string GetSubSurf(const string &in geom_id, int index)
SS_RECTANGLE
Definition: openvsp_as.h:1885
SetParmVal
double SetParmVal(const string &in parm_id, double val)
AddSubSurf
string AddSubSurf(const string &in geom_id, int type, int surfindex=0)
GetSubSurfType
int GetSubSurfType(const string &in sub_id)
string
AngelScript ScriptExtension for representing the C++ std::string.
Definition: openvsp_as.h:185
SS_LINE
Definition: openvsp_as.h:1884
array
AngelScript ScriptExtension for representing the C++ std::vector.
Definition: openvsp_as.h:244
AddGeom
string AddGeom(const string &in type, const string &in parent=string())
Print
void Print(const string &in data, bool new_line=true)
GetSubSurfIndex
int GetSubSurfIndex(const string &in sub_id)
GetSubSurfName
string GetSubSurfName(const string &in geom_id, const string &in sub_id)
GetNumSubSurf
int GetNumSubSurf(const string &in geom_id)
GetSubSurfIDVec
string[] GetSubSurfIDVec(const string &in geom_id)