This group of functions provides file input and output interfacing through the API. Click here to return to the main page.
More...
◆ ExportFile()
std::string vsp::ExportFile |
( |
const std::string & | file_name, |
|
|
int | thick_set, |
|
|
int | file_type, |
|
|
int | subsFlag = 1, |
|
|
int | thin_set = vsp::SET_NONE ) |
|
extern |
Export a file from OpenVSP. Many formats are available, such as STL, IGES, and SVG. If a mesh is generated for a particular export, the ID of the MeshGeom will be returned. If no mesh is generated an empty string will be returned.
std::string ExportFile(const std::string &file_name, int thick_set, int file_type, int subsFlag=1, int thin_set=vsp::SET_NONE)
void DeleteGeom(const std::string &geom_id)
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
- See also
- EXPORT_TYPE
- Parameters
-
[in] | file_name | Export file name |
[in] | thick_set | Set index to export (i.e. SET_ALL) |
[in] | file_type | File type enum (i.e. EXPORT_IGES) |
[in] | subsFlag | Flag to tag subsurfaces if MeshGeom is created |
[in] | thin_set | Set index to export as degenerate geometry (i.e. SET_NONE) |
- Returns
- Mesh Geom ID if the export generates a mesh
◆ ImportFile()
std::string vsp::ImportFile |
( |
const std::string & | file_name, |
|
|
int | file_type, |
|
|
const std::string & | parent ) |
|
extern |
Import a file into OpenVSP. Many formats are available, such as NASCART, V2, and BEM). The imported Geom, mesh, or other object is inserted as a child of the specified parent. If no parent or an invalid parent is given, the import will be done at the top level.
- See also
- IMPORT_TYPE
- Parameters
-
[in] | file_name | Import file name |
[in] | file_type | File type enum (i.e. IMPORT_PTS) |
[in] | parent | Parent Geom ID (ignored with empty string) |
◆ InsertVSPFile()
void vsp::InsertVSPFile |
( |
const std::string & | file_name, |
|
|
const std::string & | parent_geom_id ) |
|
extern |
Insert an external OpenVSP project into the current project. All Geoms in the external project are placed as children of the specified parent. If no parent or an invalid parent is given, the Geoms are inserted at the top level.
- Parameters
-
[in] | file_name | string *.vsp3 filename |
[in] | parent_geom_id | string Parent geom ID (ignored with empty string) |
◆ ReadVSPFile()
void vsp::ReadVSPFile |
( |
const std::string & | file_name | ) |
|
|
extern |
Load an OpenVSP project from a VSP3 file
string fid =
AddGeom(
"FUSELAGE",
"" );
string fname = "example_fuse.vsp3";
Print( "\tSaving vehicle file to: ", false );
Print( fname );
Print( string( "--->Resetting VSP model to blank slate\n" ) );
void ReadVSPFile(const std::string &file_name)
void SetVSP3FileName(const std::string &file_name)
void WriteVSPFile(const std::string &file_name, int set=SET_ALL)
void Update(bool update_managers=true)
std::string GetVSPFileName()
- Parameters
-
[in] | file_name | *.vsp3 file name |
◆ SetBEMPropID()
void vsp::SetBEMPropID |
( |
const string & | prop_id | ) |
|
|
extern |
Set the ID of the propeller to be exported to a BEM file. Call this function before ExportFile.
string prop_id =
AddGeom(
"PROP" );
void SetBEMPropID(const string &prop_id)
- See also
- EXPORT_TYPE, ExportFile
- Parameters
-
[in] | prop_id | Propeller Geom ID |
◆ SetVSP3FileName()
void vsp::SetVSP3FileName |
( |
const std::string & | file_name | ) |
|
|
extern |
Set the file name of a OpenVSP project
string fid =
AddGeom(
"FUSELAGE",
"" );
string fname = "example_fuse.vsp3";
Print( "\tSaving vehicle file to: ", false );
Print( fname );
Print( string( "--->Resetting VSP model to blank slate\n" ) );
- Parameters
-
◆ WriteVSPFile()
void vsp::WriteVSPFile |
( |
const std::string & | file_name, |
|
|
int | set = SET_ALL ) |
|
extern |
Save the current OpenVSP project to a VSP3 file
string fid =
AddGeom(
"FUSELAGE",
"" );
string fname = "example_fuse.vsp3";
Print( "\tSaving vehicle file to: ", false );
Print( fname );
Print( string( "--->Resetting VSP model to blank slate\n" ) );
- Parameters
-
[in] | file_name | *.vsp3 file name |
[in] | set | Set index to write (i.e. SET_ALL) |