OpenVSPAPI  3.23.0
Functions
Vehicle Functions

The Vehicle group of functions are high-level commands that pertain to the entire OpenVSP model.

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

Functions

void Update (bool update_managers=true)
 
void VSPExit (int error_code)
 
void ClearVSPModel ()
 
string GetVSPFileName ()
 

Detailed Description

Function Documentation

◆ ClearVSPModel()

void ClearVSPModel ( )

Clear the current OpenVSP model

string fid = AddGeom( "FUSELAGE", "" ); // Add Fuselage
//==== Reset Geometry ====//
Print( string( "--->Resetting VSP model to blank slate\n" ) );

◆ GetVSPFileName()

string GetVSPFileName ( )

Get the file name of the current OpenVSP project

string fid = AddGeom( "FUSELAGE", "" ); // Add Fuselage
string fname = "example_fuse.vsp3";
SetVSP3FileName( fname );
//==== Save Vehicle to File ====//
Print( "\tSaving vehicle file to: ", false );
Print( fname );
Returns
File name for the current OpenVSP project

◆ Update()

void Update ( bool  update_managers = true)

Update the entire vehicle and all lower level children. An input, which is true by default, is available to specify if managers should be updated as well. The managers are typically updated by their respective GUI, so must be updated through the API as well to avoid unexpected behavior.

string fid = AddGeom( "FUSELAGE", "" ); // Add Fuselage
string xsec_surf = GetXSecSurf( fid, 0 ); // Get First (and Only) XSec Surf
//==== Set Tan Angles At Nose/Tail
SetXSecTanAngles( GetXSec( xsec_surf, 0 ), XSEC_BOTH_SIDES, 90 );
SetXSecTanAngles( GetXSec( xsec_surf, num_xsecs - 1 ), XSEC_BOTH_SIDES, -90 );
Update(); // Force Surface Update
Parameters
update_managersFlag to indicate if managers should be updated

◆ VSPExit()

void VSPExit ( int  error_code)

Exit the program with a specific error code

Parameters
[in]error_codeError code
SetVSP3FileName
void SetVSP3FileName(const string &in file_name)
WriteVSPFile
void WriteVSPFile(const string &in file_name, int set)
SET_ALL
@ SET_ALL
Definition: openvsp_as.h:1870
XSEC_BOTH_SIDES
@ XSEC_BOTH_SIDES
Definition: openvsp_as.h:2202
GetXSec
string GetXSec(const string &in xsec_surf_id, int xsec_index)
ClearVSPModel
void ClearVSPModel()
Update
void Update(bool update_managers=true)
GetXSecSurf
string GetXSecSurf(const string &in geom_id, int index)
AddGeom
string AddGeom(const string &in type, const string &in parent=string())
SetXSecTanAngles
void SetXSecTanAngles(const string &in xsec_id, int side, double top, double right=- 1.0e12, double bottom=- 1.0e12, double left=- 1.0e12)
Print
void Print(const string &in data, bool new_line=true)
GetVSPFileName
string GetVSPFileName()