Design File Functions¶
This group of functions is available for managing Design Variables through the API.
|
Read in and apply a design file (*.des) to the current OpenVSP project |
|
Write all design variables to a design file (*.des) |
|
Read in and apply a Cart3D XDDM file (*.xddm) to the current OpenVSP project |
|
Write all design variables to a Cart3D XDDM file (*.xddm) |
Get the number of design variables |
|
|
Add a design variable |
Delete all design variables |
|
|
Get the Parm ID of the specified design variable |
|
Get the XDDM type of the specified design variable |
Details¶
- openvsp.ReadApplyDESFile(file_name)[source]¶
Read in and apply a design file (*.des) to the current OpenVSP project
pid = AddGeom( "POD" ) Update() length = GetParm( pid, "Length", "Design" ) AddDesignVar( length, XDDM_VAR ) WriteDESFile( "TestDesignVars.des" ) ReadApplyDESFile( "TestDesignVars.des" )
- Parameters:
[in] – file_name string *.des input file
- openvsp.WriteDESFile(file_name)[source]¶
Write all design variables to a design file (*.des)
pid = AddGeom( "POD" ) Update() length = GetParm( pid, "Length", "Design" ) AddDesignVar( length, XDDM_VAR ) WriteDESFile( "TestDesignVars.des" )
- Parameters:
[in] – file_name string *.des output file
- openvsp.ReadApplyXDDMFile(file_name)[source]¶
Read in and apply a Cart3D XDDM file (*.xddm) to the current OpenVSP project
pid = AddGeom( "POD" ) Update() length = GetParm( pid, "Length", "Design" ) AddDesignVar( length, XDDM_VAR ) WriteXDDMFile( "TestDesignVars.xddm" ) ReadApplyXDDMFile( "TestDesignVars.xddm" )
- Parameters:
[in] – file_name string *.xddm input file
- openvsp.WriteXDDMFile(file_name)[source]¶
Write all design variables to a Cart3D XDDM file (*.xddm)
pid = AddGeom( "POD" ) Update() length = GetParm( pid, "Length", "Design" ) AddDesignVar( length, XDDM_VAR ) WriteXDDMFile( "TestDesignVars.xddm" )
- Parameters:
[in] – file_name string *.xddm output file
- openvsp.GetNumDesignVars()[source]¶
Get the number of design variables
pid = AddGeom( "POD" ) Update() length = GetParm( pid, "Length", "Design" ) AddDesignVar( length, XDDM_VAR ) assert GetNumDesignVars() == 1, "GetNumDesignVars did not count the variable"
- Return type:
int
- Returns:
int Number of design variables
- openvsp.AddDesignVar(parm_id, type)[source]¶
Add a design variable
pid = AddGeom( "POD" ) Update() length = GetParm( pid, "Length", "Design" ) AddDesignVar( length, XDDM_VAR ) assert GetNumDesignVars() == 1, "AddDesignVar did not add the variable"
See also: XDDM_QUANTITY_TYPE :param [in]: parm_id string Parm ID :param [in]: type int XDDM type enum (XDDM_VAR or XDDM_CONST)
- openvsp.DeleteAllDesignVars()[source]¶
Delete all design variables
pid = AddGeom( "POD" ) Update() length = GetParm( pid, "Length", "Design" ) AddDesignVar( length, XDDM_VAR ) DeleteAllDesignVars() assert GetNumDesignVars() == 0, "DeleteAllDesignVars left variables behind"
- openvsp.GetDesignVar(index)[source]¶
Get the Parm ID of the specified design variable
pid = AddGeom( "POD" ) Update() length = GetParm( pid, "Length", "Design" ) AddDesignVar( length, XDDM_VAR ) assert GetDesignVar( 0 ) == length, "GetDesignVar did not report the variable"
- Parameters:
[in] – index int Index of design variable
- Return type:
string
- Returns:
string Parm ID
- openvsp.GetDesignVarType(index)[source]¶
Get the XDDM type of the specified design variable
pid = AddGeom( "POD" ) Update() length = GetParm( pid, "Length", "Design" ) AddDesignVar( length, XDDM_VAR ) assert GetDesignVarType( 0 ) == XDDM_VAR, "GetDesignVarType did not report the type"
See also: XDDM_QUANTITY_TYPE :param [in]: index int Index of design variable :rtype: int :return: int XDDM type enum (XDDM_VAR or XDDM_CONST)