The following group of API functions deals with set manipulation. Click here to return to the main page.
More...
◆ CopyPasteSet()
void vsp::CopyPasteSet |
( |
int | copyIndex, |
|
|
int | pasteIndex ) |
|
extern |
Copies all the states of a geom set and pastes them into a specific set based on passed in indexs
string fuseid =
AddGeom(
"FUSELAGE",
"" );
if ( flag_value != true) { Print( "---> Error: API CopyPasteSet " ); }
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
void CopyPasteSet(int copyIndex, int pasteIndex)
bool GetSetFlag(const std::string &geom_id, int set_index)
void SetSetFlag(const std::string &geom_id, int set_index, bool flag)
- Parameters
-
[in] | copyIndex | Copy Index |
[in] | pasteIndex | Paste Index |
◆ GetGeomSet()
std::vector< std::string > vsp::GetGeomSet |
( |
const std::string & | name | ) |
|
|
extern |
Get an array of Geom IDs for the specified set name
array<string> @geom_arr2 =
GetGeomSet(
"SetFromScript" );
if ( geom_arr1.size() != geom_arr2.size() ) { Print( "---> Error: API GetGeomSet " ); }
void SetSetName(int index, const std::string &name)
std::vector< std::string > GetGeomSet(const std::string &name)
std::vector< std::string > GetGeomSetAtIndex(int index)
- Parameters
-
[in] | name | const string set name |
- Returns
- array<string> array of Geom IDs
◆ GetGeomSetAtIndex()
std::vector< std::string > vsp::GetGeomSetAtIndex |
( |
int | index | ) |
|
|
extern |
Get an array of Geom IDs for the specified set index
array<string> @geom_arr2 =
GetGeomSet(
"SetFromScript" );
if ( geom_arr1.size() != geom_arr2.size() ) { Print( "---> Error: API GetGeomSet " ); }
- See also
- SET_TYPE
- Parameters
-
- Returns
- Array of Geom IDs
◆ GetNumSets()
Get the total number of defined sets. Named sets are used to group components and read/write on them. The number of named sets will be 10 for OpenVSP versions up to 3.17.1 and 20 for later versions.
if (
GetNumSets() <= 0 ) { Print(
"---> Error: API GetNumSets " ); }
- Returns
- Number of sets
◆ GetSetFlag()
bool vsp::GetSetFlag |
( |
const std::string & | geom_id, |
|
|
int | set_index ) |
|
extern |
Check if a Geom is in the set at the specified set index
string fuseid =
AddGeom(
"FUSELAGE",
"" );
if ( !
GetSetFlag( fuseid, 3 ) ) { Print(
"---> Error: API Set/Get Set Flag " ); }
- Parameters
-
[in] | geom_id | string Geom ID |
[in] | set_index | Set index |
- Returns
- True if geom is in the set, false otherwise
◆ GetSetIndex()
int vsp::GetSetIndex |
( |
const std::string & | name | ) |
|
|
extern |
Get the set index for the specified set name
if (
GetSetIndex(
"SetFromScript" ) != 3 ) { Print(
"ERROR: GetSetIndex" ); }
int GetSetIndex(const std::string &name)
- Parameters
-
- Returns
- Set index
◆ GetSetName()
std::string vsp::GetSetName |
( |
int | index | ) |
|
|
extern |
Get the name of a set at specified index
print("---> Error: API Get/Set Set Name")
std::string GetSetName(int index)
- See also
- SET_TYPE
- Parameters
-
- Returns
- Set name
◆ SetSetFlag()
void vsp::SetSetFlag |
( |
const std::string & | geom_id, |
|
|
int | set_index, |
|
|
bool | flag ) |
|
extern |
Set whether or not a Geom is a member of the set at specified set index
string fuseid =
AddGeom(
"FUSELAGE",
"" );
if ( !
GetSetFlag( fuseid, 3 ) ) { Print(
"---> Error: API Set/Get Set Flag " ); }
- Parameters
-
[in] | geom_id | string Geom ID |
[in] | set_index | Set index |
[in] | flag | Flag that indicates set membership |
◆ SetSetName()
void vsp::SetSetName |
( |
int | index, |
|
|
const std::string & | name ) |
|
extern |
Set the name of a set at specified index
if (
GetSetName( 3 ) !=
"SetFromScript" ) { Print(
"---> Error: API Get/Set Set Name " ); }
- See also
- SET_TYPE
- Parameters
-
[in] | index | Set index |
[in] | name | Set name |