openvsp package¶
degen geom parse¶
parasite drag¶
surface patches¶
utilities¶
vsp¶
- openvsp.vsp.ABS = 0¶
Absolute position
- openvsp.vsp.ALIGN_BOTTOM = 6¶
Align to bottom
- openvsp.vsp.ALIGN_CENTER = 1¶
Align to center
- openvsp.vsp.ALIGN_LEFT = 0¶
Align to left
- openvsp.vsp.ALIGN_MIDDLE = 5¶
Align to middle
- openvsp.vsp.ALIGN_PIXEL = 3¶
Align to specified pixel
- openvsp.vsp.ALIGN_RIGHT = 2¶
Align to right
- openvsp.vsp.ALIGN_TOP = 4¶
Align to top
- openvsp.vsp.ALL_GDEV_TYPES = 32¶
Flag for all GDEV types
- openvsp.vsp.ALL_GEOM_SCREENS = 17¶
All geom screens
- openvsp.vsp.ANG_0 = 0¶
Zero deg
- openvsp.vsp.ANG_180 = 2¶
180 deg
- openvsp.vsp.ANG_270 = 3¶
270 deg
- openvsp.vsp.ANG_90 = 1¶
90 deg
- openvsp.vsp.ANG_DEG = 1¶
Degrees
- openvsp.vsp.ANG_RAD = 0¶
Radians
- openvsp.vsp.APPROX_CEDIT = 3¶
Approximate curve as Cubic Bezier
- openvsp.vsp.AREA_WSECT_DRIVER = 2¶
Area driver
- openvsp.vsp.AR_WSECT_DRIVER = 0¶
Aspect ratio driver
- openvsp.vsp.ATMOS_TYPE_HERRINGTON_1966 = 1¶
USAF 1966
- openvsp.vsp.ATMOS_TYPE_MANUAL_P_R = 2¶
Manual: pressure and density control
- openvsp.vsp.ATMOS_TYPE_MANUAL_P_T = 3¶
Manual: pressure and temperature control
- openvsp.vsp.ATMOS_TYPE_MANUAL_RE_L = 5¶
Manual: Reynolds number and length control
- openvsp.vsp.ATMOS_TYPE_MANUAL_R_T = 4¶
Manual: density and temperature control
- openvsp.vsp.ATMOS_TYPE_US_STANDARD_1976 = 0¶
US Standard Atmosphere 1976 (default)
- openvsp.vsp.ATTACH_ROT_COMP = 1¶
Rotation relative to parent body axes
- openvsp.vsp.ATTACH_ROT_EtaMN = 5¶
Rotation relative to wing parent eta volume coordinate frame
- openvsp.vsp.ATTACH_ROT_LMN = 4¶
Rotation relative to parent uniform volume coordinate frame
- openvsp.vsp.ATTACH_ROT_NONE = 0¶
No parent attachment for rotations
- openvsp.vsp.ATTACH_ROT_NUM_TYPES = 6¶
Number of rotation attachment types
- openvsp.vsp.ATTACH_ROT_RST = 3¶
Rotation relative to parent per-section volume coordinate frame
- openvsp.vsp.ATTACH_ROT_UV = 2¶
Rotation relative to parent surface coordinate frame
- openvsp.vsp.ATTACH_TRANS_COMP = 1¶
Translation relative to parent body axes
- openvsp.vsp.ATTACH_TRANS_EtaMN = 5¶
Translation relative to wing parent uniform eta volume coordinate frame
- openvsp.vsp.ATTACH_TRANS_LMN = 4¶
Translation relative to parent uniform volume coordinate frame
- openvsp.vsp.ATTACH_TRANS_NONE = 0¶
No parent attachment for translations
- openvsp.vsp.ATTACH_TRANS_NUM_TYPES = 6¶
Number of translation attachment types
- openvsp.vsp.ATTACH_TRANS_RST = 3¶
Translation relative to parent per-section volume coordinate frame
- openvsp.vsp.ATTACH_TRANS_UV = 2¶
Translation relative to parent surface coordinate frame
- openvsp.vsp.ATTROBJ_ADVLINK = 6¶
Adv Link
- openvsp.vsp.ATTROBJ_ATTR = 7¶
Attribute
- openvsp.vsp.ATTROBJ_COLLECTION = 8¶
Attribute Collection
- openvsp.vsp.ATTROBJ_FREE = 15¶
Unattached attribute
- openvsp.vsp.ATTROBJ_GEOM = 1¶
Geom
- openvsp.vsp.ATTROBJ_LINK = 5¶
Link
- openvsp.vsp.ATTROBJ_MEASURE = 4¶
Measure
- openvsp.vsp.ATTROBJ_MODE = 11¶
Mode
- openvsp.vsp.ATTROBJ_PARM = 0¶
Parm
- openvsp.vsp.ATTROBJ_SEC = 10¶
Wing Section
- openvsp.vsp.ATTROBJ_SET = 12¶
Geom Set
- openvsp.vsp.ATTROBJ_SUBSURF = 3¶
SubSurf
- openvsp.vsp.ATTROBJ_VARGROUP = 13¶
Var Preset Group
- openvsp.vsp.ATTROBJ_VARSETTING = 14¶
Var Preset Setting
- openvsp.vsp.ATTROBJ_VEH = 2¶
Vehicle
- openvsp.vsp.ATTROBJ_XSEC = 9¶
Cross Section
- openvsp.vsp.ATTR_COLLECTION_DATA = 8¶
Attribute collection data type
- openvsp.vsp.ATTR_GROUP_NONE = -1¶
No event (user attributes)
- openvsp.vsp.ATTR_GROUP_WATERMARK = 0¶
Watermark group
- openvsp.vsp.AVEC_WSECT_DRIVER = 4¶
Average chord driver
- openvsp.vsp.AddAdvLink(name)¶
Add an advanced link
pod = AddGeom( "POD", "" ) length = FindParm( pod, "Length", "Design" ) x_pos = GetParm( pod, "X_Rel_Location", "XForm" ) AddAdvLink( "ExampleLink" ) indx = GetLinkIndex( "ExampleLink" ) AddAdvLinkInput( indx, length, "len" ) AddAdvLinkOutput( indx, x_pos, "x" ) SetAdvLinkCode( indx, "x = 10.0 - len;" ) BuildAdvLinkScript( indx )
- Parameters:
[in] – name string Name for advanced link
- openvsp.vsp.AddAdvLinkInput(index, parm_id, var_name)¶
Add an input variable to an advanced link
pod = AddGeom( "POD", "" ) length = FindParm( pod, "Length", "Design" ) x_pos = GetParm( pod, "X_Rel_Location", "XForm" ) AddAdvLink( "ExampleLink" ) indx = GetLinkIndex( "ExampleLink" ) AddAdvLinkInput( indx, length, "len" ) AddAdvLinkOutput( indx, x_pos, "x" ) SetAdvLinkCode( indx, "x = 10.0 - len;" ) BuildAdvLinkScript( indx )
- Parameters:
[in] – index int Advanced link index
[in] – parm_id string Parameter ID for advanced link input variable
[in] – var_name string Name for advanced link input variable
- openvsp.vsp.AddAdvLinkOutput(index, parm_id, var_name)¶
Add an output variable to an advanced link
pod = AddGeom( "POD", "" ) length = FindParm( pod, "Length", "Design" ) x_pos = GetParm( pod, "X_Rel_Location", "XForm" ) AddAdvLink( "ExampleLink" ) indx = GetLinkIndex( "ExampleLink" ) AddAdvLinkInput( indx, length, "len" ) AddAdvLinkOutput( indx, x_pos, "x" ) SetAdvLinkCode( indx, "x = 10.0 - len;" ) BuildAdvLinkScript( indx )
- Parameters:
[in] – index int Advanced link index
[in] – parm_id string Parameter ID for advanced link output variable
[in] – var_name string Name for advanced link output variable
- openvsp.vsp.AddAllToVSPAEROControlSurfaceGroup(CSGroupIndex)¶
Add all available control surfaces to the control surface group at the specified index
wid = AddGeom( "WING", "" ) # Add Wing aileron_id = AddSubSurf( wid, SS_CONTROL ) # Add Control Surface Sub-Surface group_index = CreateVSPAEROControlSurfaceGroup() # Empty control surface group AddAllToVSPAEROControlSurfaceGroup( group_index )
- Parameters:
[in] – CSGroupIndex Index of the control surface group
- openvsp.vsp.AddAttributeBool(collID, attributeName, value)¶
Add a boolean attribute by name to an attribute collection
VehID = vsp.GetVehicleID() CollID = vsp.GetChildCollection( VehID ) AttrName = 'Example_Boolean_Attr' BoolValue = True vsp.AddAttributeBool( CollID, AttrName, BoolValue ) #==== Write Some Fake Test Results =====// # not implemented
- Parameters:
[in] – collID string ID of attribute collection
[in] – attributeName string name of new attribute
[in] – value boolean value of new attribute
- openvsp.vsp.AddAttributeDouble(collID, attributeName, value)¶
Add a double attribute by name to an attribute collection
VehID = vsp.GetVehicleID() CollID = vsp.GetChildCollection( VehID ) AttrName = 'Example_Double_Attr' DoubleValue = 3.14159 vsp.AddAttributeDouble( CollID, AttrName, DoubleValue ) #==== Write Some Fake Test Results =====// # not implemented
- Parameters:
[in] – collID string ID of attribute collection
[in] – attributeName string name of new attribute
[in] – value double value of new attribute
- openvsp.vsp.AddAttributeDoubleMatrix(collID, attributeName, value)¶
Add an Double Matrix attribute by name to an attribute collection use nested vectors/arrays of ints for matrix argument
VehID = vsp.GetVehicleID() CollID = vsp.GetChildCollection( VehID ) AttrName = 'Example_DoubleMat_Attr' DoubleMatrix = [[0.,1.5],[8.4,1.1566]] vsp.AddAttributeDoubleMatrix( CollID, AttrName, DoubleMatrix ) #==== Write Some Fake Test Results =====// # not implemented
- Parameters:
[in] – collID string ID of attribute collection
[in] – attributeName string name of new attribute
[in] – value Double matrix value of new attribute
- openvsp.vsp.AddAttributeGroup(collID, attributeName)¶
Add an empty Attribute Group-type attribute by name to an attribute collection
VehID = vsp.GetVehicleID() CollID = vsp.GetChildCollection( VehID ) AttrName = 'Example_Attr_Group' vsp.AddAttributeGroup( CollID, AttrName ) #==== Write Some Fake Test Results =====// # not implemented
- Parameters:
[in] – collID string ID of attribute collection
[in] – attributeName string name of new attribute group
- openvsp.vsp.AddAttributeInt(collID, attributeName, value)¶
Add a integer attribute by name to an attribute collection
VehID = vsp.GetVehicleID() CollID = vsp.GetChildCollection( VehID ) AttrName = 'Example_Int_Attr' IntValue = 55 vsp.AddAttributeInt( CollID, AttrName, IntValue ) #==== Write Some Fake Test Results =====// # not implemented
- Parameters:
[in] – collID string ID of attribute collection
[in] – attributeName string name of new attribute
[in] – value integer value of new attribute
- openvsp.vsp.AddAttributeIntMatrix(collID, attributeName, value)¶
Add an Int Matrix attribute by name to an attribute collection use nested vectors/arrays of ints for matrix argument
VehID = vsp.GetVehicleID() CollID = vsp.GetChildCollection( VehID ) AttrName = 'Example_IntMatrix_Attr' IntMatrix = [[1,5],[-8,0]] vsp.AddAttributeIntMatrix( CollID, AttrName, IntMatrix ) #==== Write Some Fake Test Results =====// # not implemented
- Parameters:
[in] – collID string ID of attribute collection
[in] – attributeName string name of new attribute
[in] – value int matrix value of new attribute
- openvsp.vsp.AddAttributeParm(collID, attributeName, parmID)¶
Add a parm attribute by name to an attribute collection
VehID = vsp.GetVehicleID() CollID = vsp.GetChildCollection( VehID ) pid = AddGeom( "POD", "" ) print( "---> Test Add Parm Attr" ) parm_array = GetGeomParmIDs( pid ) AttrName = 'Example_Parm_Attr' ParmID = parm_array[0]; vsp.AddAttributeParm( CollID, AttrName, ParmID ) #==== Write Some Fake Test Results =====// # not implemented
- Parameters:
[in] – collID string ID of attribute collection
[in] – attributeName string name of new attribute
[in] – value string value of new attribute
- openvsp.vsp.AddAttributeString(collID, attributeName, value)¶
Add a string attribute by name to an attribute collection
VehID = vsp.GetVehicleID() CollID = vsp.GetChildCollection( VehID ) AttrName = 'Example_String_Attr' StringValue = 'Example_String_Attr_DataVal' vsp.AddAttributeString( CollID, AttrName, StringValue ) #==== Write Some Fake Test Results =====// # not implemented
- Parameters:
[in] – collID string ID of attribute collection
[in] – attributeName string name of new attribute
[in] – value string value of new attribute
- openvsp.vsp.AddAttributeVec3d(collID, attributeName, value)¶
Add a Vec3d attribute by name to an attribute collection use vsp.vec3d() to create a vec3d object to pass into the args!
VehID = vsp.GetVehicleID() CollID = vsp.GetChildCollection( VehID ) AttrName = 'Example_Vec3D_Attr' Vec3dValue = vsp.vec3d( 0.5, 0.75, -0.4 ) vsp.AddAttributeVec3d( CollID, AttrName, [Vec3dValue] ) #==== Write Some Fake Test Results =====// # not implemented
- Parameters:
[in] – collID string ID of attribute collection
[in] – attributeName string name of new attribute
[in] – value Vec3d value of new attribute
- openvsp.vsp.AddBackground3D()¶
Add a Background3D to model
nbg = GetNumBackground3Ds() # Add Background3D bg_id = AddBackground3D() if GetNumBackground3Ds() != nbg + 1 : print( "ERROR: AddBackground3D" ) DelBackground3D( bg_id )
- Return type:
string
- Returns:
string ID for added Background3D
- openvsp.vsp.AddCFDSource(type, geom_id, surf_index, l1, r1, u1, w1, l2=0, r2=0, u2=0, w2=0)¶
Add a CFD Mesh default source for the indicated Geom. Note, certain input params may not be used depending on the source type
#==== Add Pod Geom ====// pid = AddGeom( "POD", "" ) AddCFDSource( POINT_SOURCE, pid, 0, 0.25, 2.0, 0.5, 0.5 ) # Add A Point Source
See also: CFD_MESH_SOURCE_TYPE :param [in]: type CFD Mesh source type( i.e.BOX_SOURCE ) :param [in]: geom_id string Geom ID :param [in]: surf_index Main surface index :param [in]: l1 Source first edge length :param [in]: r1 Source first radius :param [in]: u1 Source first U location :param [in]: w1 Source first W location :param [in]: l2 Source second edge length :param [in]: r2 Source second radius :param [in]: u2 Source second U location :param [in]: w2 Source second W location
- openvsp.vsp.AddDefaultSources()¶
Add default CFD Mesh sources for all Geoms
#==== Add Pod Geom ====// pid = AddGeom( "POD", "" ) AddDefaultSources() # 3 Sources: Def_Fwd_PS, Def_Aft_PS, Def_Fwd_Aft_LS
- openvsp.vsp.AddDesignVar(parm_id, type)¶
Add a design variable See also: XDDM_QUANTITY_TYPE :param [in]: parm_id string Parm ID :param [in]: type XDDM type enum (XDDM_VAR or XDDM_CONST)
- openvsp.vsp.AddExcrescence(excresName, excresType, excresVal)¶
Add an Excresence to the Parasite Drag Tool
AddExcrescence( "Miscellaneous", EXCRESCENCE_COUNT, 8.5 ) AddExcrescence( "Cowl Boattail", EXCRESCENCE_CD, 0.0003 )
See also: EXCRES_TYPE :param [in]: excresName Name of the Excressence :param [in]: excresType Excressence type enum (i.e. EXCRESCENCE_PERCENT_GEOM) :param [in]: excresVal Excressence value
- openvsp.vsp.AddFeaBC(fea_struct_id, type=-1)¶
Add an FEA BC to a Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ); #==== Add BC ====// bc_id = AddFeaBC( struct_id, FEA_BC_STRUCTURE )
See also: FEA_BC_TYPE :param [in]: string fea_struct_id FEA Structure ID :param [in]: string type FEA BC type enum ( i.e. FEA_BC_STRUCTURE ) :rtype: string :return: FEA BC ID
- openvsp.vsp.AddFeaMaterial()¶
Add an FEA Material the FEA Mesh material library. Materials are available across all Geoms and Structures.
#==== Create FeaMaterial ====// mat_id = AddFeaMaterial() SetParmVal( FindParm( mat_id, "MassDensity", "FeaMaterial" ), 0.016 )
- Return type:
string
- Returns:
FEA Material ID
- openvsp.vsp.AddFeaPart(geom_id, fea_struct_ind, type)¶
Add an FEA Part to a Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Add Bulkead ====// bulkhead_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE ) SetParmVal( FindParm( bulkhead_id, "IncludedElements", "FeaPart" ), FEA_SHELL_AND_BEAM ) SetParmVal( FindParm( bulkhead_id, "RelCenterLocation", "FeaPart" ), 0.15 )
See also: FEA_PART_TYPE :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind FEA Structure index :param [in]: type FEA Part type enum (i.e. FEA_RIB) :rtype: string :return: FEA Part ID
- openvsp.vsp.AddFeaProperty(property_type=0)¶
Add aa FEA Property the FEA Mesh property library. Properties are available across all Geoms and Structures. Currently only beam and shell properties are available. Note FEA_SHELL_AND_BEAM is not a valid property type.
#==== Create FeaProperty ====// prop_id = AddFeaProperty() SetParmVal( FindParm( prop_id, "Thickness", "FeaProperty" ), 0.01 )
See also: FEA_PART_ELEMENT_TYPE :param [in]: property_type FEA Property type enum (i.e. FEA_SHELL). :rtype: string :return: FEA Property ID
- openvsp.vsp.AddFeaStruct(geom_id, init_skin=True, surfindex=0)¶
Add an FEA Structure to a specified Geom Warning: init_skin should ALWAYS be set to true.
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – init_skin Flag to initialize the FEA Structure by creating an FEA Skin from the parent Geom’s OML at surfindex
[in] – surfindex Main surface index for the FEA Structure
- Return type:
int
- Returns:
FEA Structure index
- openvsp.vsp.AddFeaSubSurf(geom_id, fea_struct_ind, type)¶
Add an FEA SubSurface to a Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Add LineArray ====// line_array_id = AddFeaSubSurf( pod_id, struct_ind, SS_LINE_ARRAY ) SetParmVal( FindParm( line_array_id, "ConstLineType", "SS_LineArray" ), 1 ) # Constant W SetParmVal( FindParm( line_array_id, "Spacing", "SS_LineArray" ), 0.25 )
See also: SUBSURF_TYPE :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind FEA Structure index :param [in]: type FEA SubSurface type enum (i.e. SS_ELLIPSE) :rtype: string :return: FEA SubSurface ID
- openvsp.vsp.AddGeom(*args)¶
Add a new Geom of given type as a child of the specified parent. If no parent or an invalid parent is given, the Geom is placed at the top level
#==== Add Wing Geometry ====// wing_id = AddGeom( "WING" )
- Parameters:
[in] – type Geom type (i.e FUSELAGE, POD, etc.)
[in] – parent Parent Geom ID
- Return type:
string
- Returns:
Geom ID
- openvsp.vsp.AddMaterial(name, ambient, diffuse, specular, emissive, alpha, shininess)¶
Set the visualization material the specified geometry
pid = AddGeom( "POD" ) AddMaterial( "RedGlass", vec3d( 44, 2, 2 ), vec3d( 156, 10, 10 ), vec3d( 185, 159, 159 ), vec3d( 44, 2, 2 ), 30, 0.4 ) SetGeomMaterialName( pid, "RedGlass" )
- Parameters:
[in] – name string Material name
[in] – ambient vec3d Ambient color RGB triple on scale [0, 255]
[in] – diffuse vec3d Diffuse color RGB triple on scale [0, 255]
[in] – specular vec3d Specular color RGB triple on scale [0, 255]
[in] – emmissive vec3d Emissive color RGB triple on scale [0, 255]
[in] – shininess double Shininess exponent on scale [0, 127]
[in] – alpha double Transparency factor on scale [0, 1]
- openvsp.vsp.AddProbe(geomid, surfindx, u, w, name)¶
Create a new Probe and add it to the Measure Tool
pid1 = AddGeom( "POD", "" ) SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 ) probe_id = AddProbe( pid1, 0, 0.5, 0.8, "Probe 1" ) SetParmVal( FindParm( probe_id, "Len", "Measure" ), 3.0 )
- Parameters:
[in] – geomid string Parent Geom ID
[in] – surfindx int Main surface index from the parent Geom
[in] – u double Surface u (0 - 1) coordinate
[in] – w double Surface w (0 - 1) coordinate
[in] – name string Probe name
- Return type:
string
- Returns:
string Probe ID
- openvsp.vsp.AddRuler(startgeomid, startsurfindx, startu, startw, endgeomid, endsurfindx, endu, endw, name)¶
Create a new Ruler and add it to the Measure Tool
pid1 = AddGeom( "POD", "" ) SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 ) pid2 = AddGeom( "POD", "" ) SetParmVal( pid2, "Z_Rel_Location", "XForm", 4.0 ) rid = AddRuler( pid1, 1, 0.2, 0.3, pid2, 0, 0.2, 0.3, "Ruler 1" ) SetParmVal( FindParm( rid, "X_Offset", "Measure" ), 6.0 )
- Parameters:
[in] – startgeomid string Start parent Geom ID
[in] – startsurfindx int Main surface index from the staring parent Geom
[in] – startu double Surface u (0 - 1) start coordinate
[in] – startw double Surface w (0 - 1) start coordinate
[in] – endgeomid string End parent Geom ID
[in] – endsurfindx int Main surface index on the end parent Geom
[in] – endu double Surface u (0 - 1) end coordinate
[in] – endw double Surface w (0 - 1) end coordinate
[in] – name string Ruler name
- Return type:
string
- Returns:
string Ruler ID
- openvsp.vsp.AddSelectedToCSGroup(selected, CSGroupIndex)¶
Add each control surfaces in the array of control surface indexes to the control surface group at the specified index.
Warning: The indexes in input “selected” must be matched with available control surfaces identified by GetAvailableCSNameVec. The “selected” input uses one- based indexing to associate available control surfaces.
wid = AddGeom( "WING", "" ) # Add Wing aileron_id = AddSubSurf( wid, SS_CONTROL ) # Add Control Surface Sub-Surface group_index = CreateVSPAEROControlSurfaceGroup() # Empty control surface group cs_name_vec = GetAvailableCSNameVec( group_index ) cs_ind_vec = [0] * len(cs_name_vec) for i in range(int( len(cs_name_vec) )): cs_ind_vec[i] = i + 1 AddSelectedToCSGroup( cs_ind_vec, group_index ) # Add all available control surfaces to the group
See also: GetAvailableCSNameVec :param [in]: selected Array of control surface indexes to add to the group. Note, the integer values are one based. :param [in]: CSGroupIndex Index of the control surface group
- openvsp.vsp.AddSubSurf(geom_id, type, surfindex=0)¶
Add a sub-surface to the specified Geom
wid = AddGeom( "WING", "" ) # Add Wing # Note: Parm Group for SubSurfaces in the form: "SS_" + type + "_" + count (initialized at 1) ss_line_id = AddSubSurf( wid, SS_LINE ) # Add Sub Surface Line SetParmVal( wid, "Const_Line_Value", "SubSurface_1", 0.4 ) # Change Location
See also: SUBSURF_TYPE :param [in]: geom_id string Geom ID :param [in]: type Sub-surface type enum (i.e. SS_RECTANGLE) :param [in]: surfindex Main surface index (default: 0) :rtype: string :return: Sub-surface ID
- openvsp.vsp.AddUserParm(type, name, group)¶
Function to add a new user Parm of input type, name, and group
length = AddUserParm( PARM_DOUBLE_TYPE, "Length", "Design" ) SetParmValLimits( length, 10.0, 0.001, 1.0e12 ) SetParmDescript( length, "Length user parameter" )
See also: PARM_TYPE :param [in]: type Parm type enum (i.e. PARM_DOUBLE_TYPE) :param [in]: name Parm name :param [in]: group Parm group :rtype: string :return: Parm ID
- openvsp.vsp.AddVarPresetGroup(group_name)¶
Add a Variable Preset Group
# Add Pod Geom pod1 = AddGeom( "POD", "" ) gid = AddVarPresetGroup( "Tess" )
- Parameters:
[in] – group_name string Name for Var Preset Group
- Return type:
string
- Returns:
string Var Preset Group ID
- openvsp.vsp.AddVarPresetParm(group_id, parm_id)¶
Add a Parm to the Variable Preset Group
# Add Pod Geom pod1 = AddGeom( "POD", "" ) gid = AddVarPresetGroup( "Tess" ) sid = AddVarPresetSetting( gid, "Coarse" ) p1 = FindParm( pod1, "Tess_U", "Shape" ) AddVarPresetParm( gid, p1 )
- Parameters:
[in] – group_id string Var Preset Group ID
[in] – parm_id string Parm ID
- openvsp.vsp.AddVarPresetSetting(group_id, setting_name)¶
Add a Setting to the Variable Preset Group
# Add Pod Geom pod1 = AddGeom( "POD", "" ) gid = AddVarPresetGroup( "Tess" ) sid = AddVarPresetSetting( gid, "Coarse" )
- Parameters:
[in] – group_id string Var Preset Group ID
[in] – setting_name string Var Preset Setting Name
- Return type:
string
- Returns:
string Var Preset Setting ID
- openvsp.vsp.AddVec3D(Vec3dVec INOUT, double x, double y, double z)¶
- openvsp.vsp.ApplyModeSettings(mid)¶
Apply Parm settings corresponding to a Mode.
# Illustrating use of Modes requires substantial setup of the model including components, sets, and variable presets. # # Setup boiler plate. pod1 = AddGeom( "POD", "" ) wing = AddGeom( "WING", pod1 ) SetParmVal( wing, "Trans_Attach_Flag", "Attach", ATTACH_TRANS_LMN ) SetParmVal( wing, "L_Attach_Location", "Attach", 0.35 ) SetSetName( SET_FIRST_USER, "NonLifting" ) SetSetName( SET_FIRST_USER + 1, "Lifting" ) SetSetFlag( pod1, SET_FIRST_USER, True ) SetSetFlag( wing, SET_FIRST_USER + 1, True ) gid = AddVarPresetGroup( "Tess" ) p1 = FindParm( pod1, "Tess_U", "Shape" ) AddVarPresetParm( gid, p1 ) p2 = FindParm( pod1, "Tess_W", "Shape" ) AddVarPresetParm( gid, p2 ) sid = AddVarPresetSetting( gid, "Default" ) SaveVarPresetParmVals( gid, sid ) sid1 = AddVarPresetSetting( gid, "Coarse" ) SetVarPresetParmVal( gid, sid1, p1, 3 ) SetVarPresetParmVal( gid, sid1, p2, 5 ) sid2 = AddVarPresetSetting( gid, "Fine" ) SetVarPresetParmVal( gid, sid, p1, 35 ) SetVarPresetParmVal( gid, sid, p2, 21 ) gid2 = AddVarPresetGroup( "Design" ) p3 = FindParm( pod1, "Length", "Design" ) AddVarPresetParm( gid2, p3 ) p4 = FindParm( pod1, "FineRatio", "Design" ) AddVarPresetParm( gid2, p4 ) sid3 = AddVarPresetSetting( gid2, "Normal" ) SaveVarPresetParmVals( gid2, sid3 ) sid4 = AddVarPresetSetting( gid2, "ShortFat" ) SetVarPresetParmVal( gid2, sid4, p3, 3.0 ) SetVarPresetParmVal( gid2, sid4, p4, 5.0 ) sid5 = AddVarPresetSetting( gid2, "LongThin" ) SetVarPresetParmVal( gid2, sid5, p3, 20.0 ) SetVarPresetParmVal( gid2, sid5, p4, 35.0 ) # End of setup boiler plate. mid1 = CreateAndAddMode( "FatWetAreas", SET_ALL, SET_NONE ) ModeAddGroupSetting( mid1, gid, sid1 ) ModeAddGroupSetting( mid1, gid2, sid4 ) mid2 = CreateAndAddMode( "ThinAero", SET_FIRST_USER, SET_FIRST_USER + 1 ) ModeAddGroupSetting( mid2, gid, sid2 ) ModeAddGroupSetting( mid1, gid2, sid5 ) ApplyModeSettings( mid2 ) Update()
- Parameters:
[in] – mid string Mode ID of mode to apply
- openvsp.vsp.ApplyVarPresetSetting(group_id, setting_id)¶
Apply Parm values for Var Preset Setting
# Add Pod Geom pod1 = AddGeom( "POD", "" ) gid = AddVarPresetGroup( "Tess" ) sid = AddVarPresetSetting( gid, "Coarse" ) p1 = FindParm( pod1, "Tess_U", "Shape" ) AddVarPresetParm( gid, p1 ) ApplyVarPresetSetting( gid, sid ) Update()
- Parameters:
[in] – group_id string Var Preset Group ID
[in] – setting_id string Var Preset Setting ID
- openvsp.vsp.ApproximateAllPropellerPCurves(geom_id)¶
Approximate all propeller blade curves with cubic Bezier curves.
# Add Propeller prop = AddGeom( "PROP", "" ) ApproximateAllPropellerPCurves( prop )
- Parameters:
[in] – geom_id string Geom ID
- openvsp.vsp.AutoGroupVSPAEROControlSurfaces()¶
Creates the initial default grouping for the control surfaces. The initial grouping collects all surface copies of the sub-surface into a single group. For example if a wing is defined with an aileron and that wing is symmetrical about the xz plane there will be a surface copy of the master wing surface as well as a copy of the sub-surface. The two sub-surfaces may get deflected differently during analysis routines and can be identified uniquely by their full name.
wid = AddGeom( "WING", "" ) # Add Wing aileron_id = AddSubSurf( wid, SS_CONTROL ) # Add Control Surface Sub-Surface #==== Add Vertical tail and set some parameters =====// vert_id = AddGeom( "WING" ) SetGeomName( vert_id, "Vert" ) SetParmValUpdate( vert_id, "TotalArea", "WingGeom", 10.0 ) SetParmValUpdate( vert_id, "X_Rel_Location", "XForm", 8.5 ) SetParmValUpdate( vert_id, "X_Rel_Rotation", "XForm", 90 ) rudder_id = AddSubSurf( vert_id, SS_CONTROL ) # Add Control Surface Sub-Surface AutoGroupVSPAEROControlSurfaces() Update() print( "COMPLETE\n" ) control_group_settings_container_id = FindContainer( "VSPAEROSettings", 0 ) # auto grouping produces parm containers within VSPAEROSettings #==== Set Control Surface Group Deflection Angle ====// print( "\tSetting control surface group deflection angles..." ) # subsurfaces get added to groups with "CSGQualities_[geom_name]_[control_surf_name]" # subsurfaces gain parm name is "Surf[surfndx]_Gain" starting from 0 to NumSymmetricCopies-1 deflection_gain_id = FindParm( control_group_settings_container_id, "Surf_" + aileron_id + "_0_Gain", "ControlSurfaceGroup_0" ) deflection_gain_id = FindParm( control_group_settings_container_id, "Surf_" + aileron_id + "_1_Gain", "ControlSurfaceGroup_0" ) # deflect aileron deflection_angle_id = FindParm( control_group_settings_container_id, "DeflectionAngle", "ControlSurfaceGroup_0" )
See also: CreateVSPAEROControlSurfaceGroup
- openvsp.vsp.AxisProjPnt01(geom_id, surf_indx, iaxis, pt)¶
Project an input 3D coordinate point onto a surface along a specified axis. If the axis-aligned ray from the point intersects the surface multiple times, the nearest intersection is returned. If the axis-aligned ray from the point does not intersect the surface, the original point is returned and -1 is returned in the other output parameters.
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 u = 0.12345 w = 0.67890 surf_pt = CompPnt01( geom_id, surf_indx, u, w ) pt = surf_pt pt.offset_y( -5.0 ) idist, u_out, w_out = AxisProjPnt01( geom_id, surf_indx, Y_DIR, pt ) print( f"iDist {idist} u_out {u_out} w_out {w_out}" ) print( "3D Offset ", False)
See also: AxisProjPnt01Guess, AxisProjPnt01I, AxisProjVecPnt01, AxisProjVecPnt01Guess :param [in]: geom_id string Parent Geom ID :param [in]: surf_indx int Main surface index from the parent Geom :param [in]: iaxis int Axis direction to project point along (X_DIR, Y_DIR, or Z_DIR) :param [in]: pt Input 3D coordinate point :param [out]: u_out Output closest U (0 - 1) surface coordinate :param [out]: w_out Output closest W (0 - 1) surface coordinate :rtype: float :return: Axis aligned distance between the 3D point and the projected point on the surface
- openvsp.vsp.AxisProjPnt01Guess(geom_id, surf_indx, iaxis, pt, u0, w0)¶
Project an input 3D coordinate point onto a surface along a specified axis given an initial guess of surface parameter. If the axis-aligned ray from the point intersects the surface multiple times, the nearest intersection is returned. If the axis-aligned ray from the point does not intersect the surface, the original point is returned and -1 is returned in the other output parameters. The surface parameter guess should allow this call to be faster than calling AxisProjPnt01 without a guess.
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 u = 0.12345 w = 0.67890 surf_pt = CompPnt01( geom_id, surf_indx, u, w ) pt = surf_pt pt.offset_y( -5.0 ) # Construct initial guesses near actual parameters u0 = u + 0.01234 w0 = w - 0.05678 d, uout, wout = AxisProjPnt01Guess( geom_id, surf_indx, Y_DIR, pt, u0, w0 ) print( f"Dist {d} u {uout} w {wout}" )
See also: AxisProjPnt01, AxisProjPnt01I, AxisProjVecPnt01, AxisProjVecPnt01Guess :param [in]: geom_id string Parent Geom ID :param [in]: surf_indx int Main surface index from the parent Geom :param [in]: iaxis int Axis direction to project point along (X_DIR, Y_DIR, or Z_DIR) :param [in]: pt Input 3D coordinate point :param [in]: u0 Input U (0 - 1) surface coordinate guess :param [in]: w0 Input W (0 - 1) surface coordinate guess :param [out]: u_out Output closest U (0 - 1) surface coordinate :param [out]: w_out Output closest W (0 - 1) surface coordinate :rtype: float :return: Distance between the 3D point and the closest point of the surface
- openvsp.vsp.AxisProjPnt01I(geom_id, iaxis, pt)¶
Project an input 3D coordinate point onto a Geom along a specified axis. The intersecting surface index is also returned. If the axis-aligned ray from the point intersects the Geom multiple times, the nearest intersection is returned. If the axis-aligned ray from the point does not intersect the Geom, the original point is returned and -1 is returned in the other output parameters.
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 u = 0.12345 w = 0.67890 surf_pt = CompPnt01( geom_id, surf_indx, u, w ) pt = surf_pt pt.offset_y( -5.0 ) idist, surf_indx_out, u_out, w_out = AxisProjPnt01I( geom_id, Y_DIR, pt ) print( "iDist {idist} u_out {u_out} w_out {w_out} surf_index {surf_indx_out}" ) print( "3D Offset ", False)
See also: AxisProjPnt01, AxisProjPnt01Guess, AxisProjVecPnt01, AxisProjVecPnt01Guess :param [in]: geom_id string Parent Geom ID :param [in]: iaxis int Axis direction to project point along (X_DIR, Y_DIR, or Z_DIR) :param [in]: pt Input 3D coordinate point :param [out]: surf_indx_out Output main surface index from the parent Geom :param [out]: u_out Output closest U (0 - 1) surface coordinate :param [out]: w_out Output closest W (0 - 1) surface coordinate :rtype: float :return: Axis aligned distance between the 3D point and the projected point on the surface
- openvsp.vsp.AxisProjVecPnt01(geom_id, surf_indx, iaxis, pts)¶
Project an input array of 3D coordinate points onto a surface along a specified axis. If the axis-aligned ray from the point intersects the surface multiple times, the nearest intersection is returned. If the axis-aligned ray from the point does not intersect the surface, the original point is returned and -1 is returned in the other output parameters.
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 n = 5 uvec = [0]*n wvec = [0]*n for i in range(n): uvec[i] = (i+1)*1.0/(n+1) wvec[i] = (n-i)*1.0/(n+1) ptvec = CompVecPnt01( geom_id, surf_indx, uvec, wvec ) for i in range(n): ptvec[i].offset_y( -5.0 ) uoutv, woutv, doutv = AxisProjVecPnt01( geom_id, surf_indx, Y_DIR, ptvec ) # Some of these outputs are expected to be non-zero because the projected point is on the opposite side of # the pod from the originally computed point. I.e. there were multiple solutions and the original point # is not the closest intersection point. We could offset those points in the +Y direction instead of -Y. for i in range(n): print( i, False ) print( "U delta ", False ) print( uvec[i] - uoutv[i], False ) print( "W delta ", False ) print( wvec[i] - woutv[i] )
See also: AxisProjPnt01, AxisProjPnt01Guess, AxisProjPnt01I, AxisProjVecPnt01Guess :param [in]: geom_id string Geom ID :param [in]: surf_indx int Main surface index from the Geom :param [in]: iaxis int Axis direction to project point along (X_DIR, Y_DIR, or Z_DIR) :param [in]: pts vector<vec3d> Input vector of 3D coordinate points :param [out]: u_out_vec vector<double> Output vector of the closest U (0 - 1) surface coordinate for each 3D input point :param [out]: w_out_vec vector<double> Output vector of the closest W (0 - 1) surface coordinate for each 3D input point :param [out]: d_out_vec vector<double> Output vector of axis distances for each 3D point and the projected point of the surface
- openvsp.vsp.AxisProjVecPnt01Guess(geom_id, surf_indx, iaxis, pts, u0s, w0s)¶
Project an input array of 3D coordinate points onto a surface along a specified axis given initial guess arrays of surface parameter. If the axis-aligned ray from the point intersects the surface multiple times, the nearest intersection is returned. If the axis-aligned ray from the point does not intersect the surface, the original point is returned and -1 is returned in the other output parameters. The surface parameter guess should allow this call to be faster than calling AxisProjVecPnt01 without a guess.
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 n = 5 uvec = [0]*n wvec = [0]*n for i in range(n): uvec[i] = (i+1)*1.0/(n+1) wvec[i] = (n-i)*1.0/(n+1) ptvec = CompVecPnt01( geom_id, surf_indx, uvec, wvec ) for i in range(n): ptvec[i].offset_y( -5.0 ) u0v = [0]*n w0v = [0]*n for i in range(n): u0v[i] = uvec[i] + 0.01234 w0v[i] = wvec[i] - 0.05678 uoutv, woutv, doutv = AxisProjVecPnt01Guess( geom_id, surf_indx, Y_DIR, ptvec, u0v, w0v ) for i in range(n): print( i, False ) print( "U delta ", False ) print( uvec[i] - uoutv[i], False ) print( "W delta ", False ) print( wvec[i] - woutv[i] )
See also: AxisProjPnt01, AxisProjPnt01Guess, AxisProjPnt01I, AxisProjVecPnt01 :param [in]: geom_id string Parent Geom ID :param [in]: surf_indx int Main surface index from the parent Geom :param [in]: iaxis int Axis direction to project point along (X_DIR, Y_DIR, or Z_DIR) :param [in]: pts vector<vec3d> Input vector of 3D coordinate points :param [in]: u0s vector<double> Input vector of U (0 - 1) surface coordinate guesses :param [in]: w0s vector<double> Input vector of W (0 - 1) surface coordinate guesses :param [out]: u_out_vec vector<double> Output vector of the closest U (0 - 1) surface coordinate for each 3D input point :param [out]: w_out_vec vector<double> Output vector of the closest W (0 - 1) surface coordinate for each 3D input point :param [out]: d_out_vec vector<double> Output vector of axis distances for each 3D point and the projected point of the surface
- openvsp.vsp.BEZIER_AF_EXPORT = 1¶
Bezier airfoil file format
- openvsp.vsp.BFT_UNIT = 3¶
FEA Files output in (ft, slug)
- openvsp.vsp.BIN_UNIT = 4¶
FEA Files output in (in, lbf*sec^2/in)
- openvsp.vsp.BLANK_GEOM_SCREEN = 3¶
Blank geom screen
- openvsp.vsp.BLEND_ANGLES = 1¶
Blend based on angles (sweep & dihedral)
- openvsp.vsp.BLEND_FREE = 0¶
Free blending
- openvsp.vsp.BLEND_MATCH_IN_ANGLES = 6¶
Match inboard angles
- openvsp.vsp.BLEND_MATCH_IN_LE_TRAP = 2¶
Match inboard leading edge trapezoid
- openvsp.vsp.BLEND_MATCH_IN_TE_TRAP = 3¶
Match inboard trailing edge trapezoid
- openvsp.vsp.BLEND_MATCH_LE_ANGLES = 7¶
Match leading edge angles
- openvsp.vsp.BLEND_MATCH_OUT_LE_TRAP = 4¶
Match outboard leading edge trapezoid
- openvsp.vsp.BLEND_MATCH_OUT_TE_TRAP = 5¶
Match outboard trailing edge trapezoid
- openvsp.vsp.BLEND_NUM_TYPES = 8¶
Number of blending types
- openvsp.vsp.BOOL_DATA = 0¶
Bool data type
- openvsp.vsp.BOR_FLOWTHROUGH = 0¶
Flowthrough mode (default)
- openvsp.vsp.BOR_GEOM_SCREEN = 13¶
Body of revolution geom screen
- openvsp.vsp.BOR_LOWER = 2¶
Lower surface mode
- openvsp.vsp.BOR_NUM_MODES = 3¶
Number of Body of Revolution modes
- openvsp.vsp.BOR_UPPER = 1¶
Upper surface mode
- openvsp.vsp.BOX_SOURCE = 2¶
Box source
- openvsp.vsp.BilinearWeights(vec3d p0, vec3d p1, vec3d p, DoubleVector weights)¶
- class openvsp.vsp.BoolVector(*args)¶
Bases:
object
- append(x)¶
- assign(n, x)¶
- back()¶
- begin()¶
- capacity()¶
- clear()¶
- empty()¶
- end()¶
- erase(*args)¶
- front()¶
- get_allocator()¶
- insert(*args)¶
- iterator()¶
- pop()¶
- pop_back()¶
- push_back(x)¶
- rbegin()¶
- rend()¶
- reserve(n)¶
- resize(*args)¶
- size()¶
- swap(v)¶
- property thisown¶
The membership flag
- openvsp.vsp.BuildAdvLinkScript(index)¶
Build (ready for execution and perform syntax check) an advanced link.
pod = AddGeom( "POD", "" ) length = FindParm( pod, "Length", "Design" ) x_pos = GetParm( pod, "X_Rel_Location", "XForm" ) AddAdvLink( "ExampleLink" ) indx = GetLinkIndex( "ExampleLink" ) AddAdvLinkInput( indx, length, "len" ) AddAdvLinkOutput( indx, x_pos, "x" ) SetAdvLinkCode( indx, "x = 10.0 - len;" ) success = BuildAdvLinkScript( indx ) if success : print( "Advanced link build successful." ) else: print( "Advanced link build not successful." )
- Parameters:
[in] – index int Index for advanced link
- Return type:
boolean
- Returns:
Flag indicating whether advanced link build was successful
- openvsp.vsp.CAM_BOTTOM = 5¶
Camera bottom view
- openvsp.vsp.CAM_CENTER = 9¶
Camera center view
- openvsp.vsp.CAM_FRONT = 1¶
Camera front view
- openvsp.vsp.CAM_FRONT_YUP = 2¶
Camera front Y-up view
- openvsp.vsp.CAM_LEFT = 3¶
Camera left view
- openvsp.vsp.CAM_LEFT_ISO = 4¶
Camera left isometric view
- openvsp.vsp.CAM_REAR = 6¶
Camera rear view
- openvsp.vsp.CAM_RIGHT = 7¶
Camera right view
- openvsp.vsp.CAM_RIGHT_ISO = 8¶
Camera right isometric view
- openvsp.vsp.CAM_TOP = 0¶
Camera top view
- openvsp.vsp.CEDIT = 2¶
Cubic Bezier curve type
- openvsp.vsp.CFD_DAT_FILE_NAME = 4¶
DAT export type
- openvsp.vsp.CFD_FACET_FILE_NAME = 8¶
FACET export type
- openvsp.vsp.CFD_FAR_FIELD_FLAG = 8¶
Flag to generate a far field mesh
- openvsp.vsp.CFD_FAR_HEIGHT = 15¶
Far field height
- openvsp.vsp.CFD_FAR_LENGTH = 13¶
Far field length
- openvsp.vsp.CFD_FAR_LOC_MAN_FLAG = 19¶
Far field location flag: centered or manual
- openvsp.vsp.CFD_FAR_LOC_X = 20¶
Far field X location
- openvsp.vsp.CFD_FAR_LOC_Y = 21¶
Far field Y location
- openvsp.vsp.CFD_FAR_LOC_Z = 22¶
Far field Z location
- openvsp.vsp.CFD_FAR_MAX_EDGE_LEN = 9¶
Maximum far field mesh edge length
- openvsp.vsp.CFD_FAR_MAX_GAP = 10¶
Maximum far field mesh edge gap
- openvsp.vsp.CFD_FAR_NUM_CIRCLE_SEGS = 11¶
Number of far field edge segments to resolve circle
- openvsp.vsp.CFD_FAR_SIZE_ABS_FLAG = 12¶
Relative or absolute size flag
- openvsp.vsp.CFD_FAR_WIDTH = 14¶
Far field width
- openvsp.vsp.CFD_FAR_X_SCALE = 16¶
Far field X scale
- openvsp.vsp.CFD_FAR_Y_SCALE = 17¶
Far field Y scale
- openvsp.vsp.CFD_FAR_Z_SCALE = 18¶
Far field Z scale
- openvsp.vsp.CFD_GMSH_FILE_NAME = 6¶
GMSH export type
- openvsp.vsp.CFD_GROWTH_RATIO = 4¶
Maximum allowed edge growth ratio
- openvsp.vsp.CFD_HALF_MESH_FLAG = 7¶
Flag to generate a half mesh
- openvsp.vsp.CFD_INTERSECT_SUBSURFACE_FLAG = 6¶
Flag to intersect sub-surfaces
- openvsp.vsp.CFD_KEY_FILE_NAME = 5¶
KEY export type
- openvsp.vsp.CFD_LIMIT_GROWTH_FLAG = 5¶
Rigorous 3D growth limiting flag
- openvsp.vsp.CFD_MAX_EDGE_LEN = 1¶
Maximum mesh edge length
- openvsp.vsp.CFD_MAX_GAP = 2¶
Maximum mesh edge gap
- openvsp.vsp.CFD_MEASURE_DUCT = 5¶
Measure duct cross sectional area surface
- openvsp.vsp.CFD_MIN_EDGE_LEN = 0¶
Minimum mesh edge length
- openvsp.vsp.CFD_NEGATIVE = 1¶
Negative volume CFD Mesh surface
- openvsp.vsp.CFD_NORMAL = 0¶
Normal CFD Mesh surface
- openvsp.vsp.CFD_NUM_CIRCLE_SEGS = 3¶
Number of edge segments to resolve circle
- openvsp.vsp.CFD_NUM_FILE_NAMES = 10¶
Number of CFD Mesh export file types
- openvsp.vsp.CFD_NUM_TYPES = 6¶
Number of CFD Mesh surface types
- openvsp.vsp.CFD_OBJ_FILE_NAME = 3¶
OBJ export type
- openvsp.vsp.CFD_POLY_FILE_NAME = 1¶
POLY export type
- openvsp.vsp.CFD_SRF_XYZ_FLAG = 23¶
Flag to include X,Y,Z intersection curves in export files
- openvsp.vsp.CFD_STIFFENER = 4¶
FEA stiffener CFD Mesh surface
- openvsp.vsp.CFD_STL_FILE_NAME = 0¶
STL export type
- openvsp.vsp.CFD_STRUCTURE = 3¶
FEA structure CFD Mesh surface
- openvsp.vsp.CFD_TKEY_FILE_NAME = 7¶
TKEY export type
- openvsp.vsp.CFD_TRANSPARENT = 2¶
Transparent CFD Mesh surface
- openvsp.vsp.CFD_TRI_FILE_NAME = 2¶
TRI export type
- openvsp.vsp.CFD_VSPGEOM_FILE_NAME = 9¶
VSPGEOM export type
- openvsp.vsp.CF_LAM_BLASIUS = 0¶
Blasius laminar Cf equation
- openvsp.vsp.CF_LAM_BLASIUS_W_HEAT = 1¶
Blasius laminar Cf equation with heat (NOT IMPLEMENTED)
- openvsp.vsp.CF_TURB_EXPLICIT_FIT_SCHOENHERR = 2¶
Explicit Fit of Schoenherr turbulent Cf equation
- openvsp.vsp.CF_TURB_EXPLICIT_FIT_SPALDING = 0¶
Explicit Fit of Spalding turbulent Cf equation
- openvsp.vsp.CF_TURB_EXPLICIT_FIT_SPALDING_CHI = 1¶
Explicit Fit of Spalding and Chi turbulent Cf equation
- openvsp.vsp.CF_TURB_HEATTRANSFER_WHITE_CHRISTOPH = 20¶
Heat Transfer White-Christoph turbulent Cf equation.
- openvsp.vsp.CF_TURB_IMPLICIT_KARMAN_SCHOENHERR = 5¶
Implicit Karman-Schoenherr turbulent Cf equation
- openvsp.vsp.CF_TURB_IMPLICIT_SCHOENHERR = 4¶
Implicit Schoenherr turbulent Cf equation
- openvsp.vsp.CF_TURB_POWER_LAW_BLASIUS = 6¶
Power Law Blasius turbulent Cf equation
- openvsp.vsp.CF_TURB_POWER_LAW_PRANDTL_HIGH_RE = 9¶
Power Law Prandtl High Re turbulent Cf equation
- openvsp.vsp.CF_TURB_POWER_LAW_PRANDTL_LOW_RE = 7¶
Power Law Prandtl Low Re turbulent Cf equation
- openvsp.vsp.CF_TURB_POWER_LAW_PRANDTL_MEDIUM_RE = 8¶
Power Law Prandtl Medium Re turbulent Cf equation
- openvsp.vsp.CF_TURB_ROUGHNESS_SCHLICHTING_AVG = 16¶
Roughness Schlichting Avg turbulent Cf equation.
- openvsp.vsp.CF_TURB_ROUGHNESS_SCHLICHTING_AVG_FLOW_CORRECTION = 19¶
Roughness Schlichting Avg Compressible turbulent Cf equation.
- openvsp.vsp.CF_TURB_SCHLICHTING_COMPRESSIBLE = 10¶
Schlichting Compressible turbulent Cf equation
- openvsp.vsp.CF_TURB_SCHULTZ_GRUNOW_SCHOENHERR = 14¶
Schultz-Grunow Estimate of Schoenherr turbulent Cf equation.
- openvsp.vsp.CGS_UNIT = 1¶
FEA Files output in (cm, g)
- openvsp.vsp.CHEVRON_FULL = 2¶
Full period of chevrons.
- openvsp.vsp.CHEVRON_NONE = 0¶
No chevron.
- openvsp.vsp.CHEVRON_NUM_TYPES = 3¶
Number of chevron types.
- openvsp.vsp.CHEVRON_PARTIAL = 1¶
One or more chevrons of limited extent.
- openvsp.vsp.CHEVRON_W01_NUM_MODES = 2¶
Number of chevron W parameter mode types.
- openvsp.vsp.CLMAX_2D = 1¶
2D Cl Max stall modeling with user defined value
- openvsp.vsp.CLMAX_CARLSON = 2¶
Carlson’s Pressure Correlation
- openvsp.vsp.CLMAX_OFF = 0¶
Stall modeling off (Cl Max = 0)
- openvsp.vsp.CLOSE_EXTRAP = 4¶
Extrapolate closure
- openvsp.vsp.CLOSE_NONE = 0¶
No closure
- openvsp.vsp.CLOSE_NUM_TYPES = 5¶
Number of XSec closure types
- openvsp.vsp.CLOSE_SKEWBOTH = 3¶
Skew both closure
- openvsp.vsp.CLOSE_SKEWLOW = 1¶
Skew lower closure
- openvsp.vsp.CLOSE_SKEWUP = 2¶
Skew upper closure
- openvsp.vsp.COLLISION_CLEAR_NO_SOLUTION = 2¶
Not touching, no solution
- openvsp.vsp.COLLISION_INTERSECT_NO_SOLUTION = 1¶
Touching, no solution
- openvsp.vsp.COLLISION_OK = 0¶
No Error.
- openvsp.vsp.COMPONENT_REF = 1¶
Use a particular wing to calculate the reference area and lengths
- openvsp.vsp.CONFORMAL_SCREEN = 11¶
Conformal geom screen
- openvsp.vsp.CONST_U = 0¶
Constant U sub-surface
- openvsp.vsp.CONST_W = 1¶
Constant W sub-surface
- openvsp.vsp.CURV_GAP = 2¶
Maximum gap curvature based criteria.
- openvsp.vsp.CURV_NCIRCSEG = 3¶
Minimum number of segments to define a circle curvature based criteria.
- openvsp.vsp.CUSTOM_GEOM_SCREEN = 6¶
Custom geom screen
- openvsp.vsp.CalcAtmosphere(alt, delta_temp, atmos_type)¶
Calculate the atmospheric properties determined by a specified model at input altitude and temperature deviation. This function may not be used for any manual atmospheric model types (i.e. ATMOS_TYPE_MANUAL_P_T). This function assumes freestream units are metric, temperature units are Kelvin, and pressure units are kPA.
alt = 4000 delta_temp = 0 temp, pres, pres_ratio, rho_ratio = CalcAtmosphere( alt, delta_temp, ATMOS_TYPE_US_STANDARD_1976)
See also: ATMOS_TYPE :param [in]: alt Altitude :param [in]: delta_temp Deviation in temperature from the value specified in the atmospheric model :param [in]: atmos_type Atmospheric model enum (i.e. ATMOS_TYPE_HERRINGTON_1966) :param [out]: temp output Temperature :param [out]: pres output Pressure :param [out]: pres_ratio Output pressure ratio :param [out]: rho_ratio Output density ratio
- openvsp.vsp.ChangeBORXSecShape(bor_id, type)¶
Set the XSec type for a BOR component
# Add Body of Recolution bor_id = AddGeom( "BODYOFREVOLUTION", "" ) ChangeBORXSecShape( bor_id, XS_ROUNDED_RECTANGLE ) if GetBORXSecShape( bor_id ) != XS_ROUNDED_RECTANGLE : print( "ERROR: ChangeBORXSecShape" )
See also: XSEC_CRV_TYPE :param [in]: bor_id string Body of revolution Geom ID :param [in]: type int XSec type enum (i.e. XS_ROUNDED_RECTANGLE)
- openvsp.vsp.ChangeXSecShape(xsec_surf_id, xsec_index, type)¶
Change the shape of a particular XSec, identified by an XSecSurf ID and XSec index
# Add Stack sid = AddGeom( "STACK", "" ) # Get First (and Only) XSec Surf xsec_surf = GetXSecSurf( sid, 0 ) # Set XSec 1 & 2 to Edit Curve type ChangeXSecShape( xsec_surf, 1, XS_EDIT_CURVE ) ChangeXSecShape( xsec_surf, 2, XS_EDIT_CURVE ) xsec_2 = GetXSec( xsec_surf, 2 ) if GetXSecShape( xsec_2 ) != XS_EDIT_CURVE : print( "Error: ChangeXSecShape" )
See also: XSEC_CRV_TYPE :param [in]: xsec_surf_id XSecSurf ID :param [in]: xsec_index Xsec index :param [in]: type Xsec type enum (i.e. XS_ELLIPSE)
- openvsp.vsp.CheckForVSPAERO(path)¶
Check if all VSPAERO executables (Solver, Viewer, and Slicer) are in a given directory. Note that this function will return false if only one or two VSPAERO executables are found. An error message will indicate the executables that are missing. This may be acceptable, as only the Solver is needed in all cases. The Viewer and Slicer may not be needed.
vspaero_path = "C:/Users/example_user/Documents/OpenVSP_3.4.5" if CheckForVSPAERO( vspaero_path ) : SetVSPAEROPath( vspaero_path )
See also: GetVSPExePath, GetVSPAEROPath, SetVSPAEROPath :param [in]: path Absolute path to check for VSPAERO executables :rtype: boolean :return: Flag that indicates if all VSPAERO executables are found or not
- openvsp.vsp.CheckForVSPHelp(path)¶
Check if all OpenVSP help files are in a given directory.
vsphelp_path = "C:/Users/example_user/Documents/OpenVSP_3.4.5/help" if CheckForVSPHelp( vsphelp_path ) : SetVSPHelpPath( vsphelp_path )
See also: GetVSPExePath, GetVSPAEROPath, SetVSPHelpPath :param [in]: path Absolute path to check for VSPAERO executables :rtype: boolean :return: Flag that indicates if OpenVSP help files are found or not
- openvsp.vsp.ClearVSPModel()¶
Clear the current OpenVSP model
fid = AddGeom( "FUSELAGE", "" ) # Add Fuselage #==== Reset Geometry ====// print( "--->Resetting VSP model to blank slate\n" ) ClearVSPModel()
- openvsp.vsp.CompCurvature01(geom_id, surf_indx, u, w)¶
Determine the curvature of a specified surface at the input surface coordinate point
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 u = 0.25 w = 0.75 k1, k2, ka, kg = CompCurvature01( geom_id, surf_indx, u, w ) print( f"Curvature : k1 {k1} k2 {k2} ka {ka} kg {kg}" )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – surf_indx int Main surface index from the parent Geom
[in] – u double U (0 - 1) surface coordinate
[in] – w double W (0 - 1) surface coordinate
[out] – k1_out double Output value of maximum principal curvature
[out] – k2_out double Output value of minimum principal curvature
[out] – ka_out double Output value of mean curvature
[out] – kg_out double Output value of Gaussian curvature
- openvsp.vsp.CompNorm01(geom_id, surf_indx, u, w)¶
Calculate the normal vector on the specified surface at input surface coordinate
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 u = 0.12345 w = 0.67890 norm = CompNorm01( geom_id, surf_indx, u, w ) print( "Point: ( {norm.x()}, {norm.y()}, {norm.z()} )" )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – surf_indx int Main surface index from the parent Geom
[in] – u U (0 - 1) surface coordinate
[in] – w W (0 - 1) surface coordinate
- Return type:
- Returns:
Normal vector
- openvsp.vsp.CompPnt01(geom_id, surf_indx, u, w)¶
Calculate the 3D coordinate equivalent for the input surface coordinate point
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 u = 0.12345 w = 0.67890 pnt = CompPnt01( geom_id, surf_indx, u, w ) print( f"Point: ( {pnt.x()}, {pnt.y()}, {pnt.z()} )" )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – surf_indx int Main surface index from the parent Geom
[in] – u U (0 - 1) surface coordinate
[in] – w W (0 - 1) surface coordinate
- Return type:
- Returns:
Normal vector3D coordinate point
- openvsp.vsp.CompPntRST(geom_id, surf_indx, r, s, t)¶
Calculate the (X, Y, Z) coordinate for the input volume (R, S, T) coordinate point
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 r = 0.12 s = 0.68 t = 0.56 pnt = CompPntRST( geom_id, surf_indx, r, s, t ) print( f"Point: ( {pnt.x()}, {pnt.y()}, {pnt.z()} )" )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – surf_indx int Main surface index from the parent Geom
[in] – r R (0 - 1) volume coordinate
[in] – s S (0 - 1) volume coordinate
[in] – t T (0 - 1) volume coordinate
- Return type:
- Returns:
vec3d coordinate point
- openvsp.vsp.CompTanU01(geom_id, surf_indx, u, w)¶
Calculate the vector tangent to the specified surface at input surface coordinate in the U direction
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 u = 0.12345 w = 0.67890 tanu = CompTanU01( geom_id, surf_indx, u, w ) print( f"Point: ( {tanu.x()}, {tanu.y()}, {tanu.z()} )" )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – surf_indx int Main surface index from the parent Geom
[in] – u U (0 - 1) surface coordinate
[in] – w W (0 - 1) surface coordinate
- Return type:
- Returns:
Tangent vector in U direction
- openvsp.vsp.CompTanW01(geom_id, surf_indx, u, w)¶
Calculate the vector tangent to the specified surface at input surface coordinate in the W direction
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 u = 0.12345 w = 0.67890 tanw = CompTanW01( geom_id, surf_indx, u, w ) print( f"Point: ( {tanw.x()}, {tanw.y()}, {tanw.z()} )" )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – surf_indx int Main surface index from the parent Geom
[in] – u U (0 - 1) surface coordinate
[in] – w W (0 - 1) surface coordinate
- Return type:
- Returns:
Tangent vector in W direction
- openvsp.vsp.CompVecCurvature01(geom_id, surf_indx, us, ws)¶
Determine the curvature of a specified surface at each surface coordinate point in the input arrays
# Add Pod Geom geom_id = AddGeom( "POD", "" ) n = 5 uvec = [0]*n wvec = [0]*n for i in range(n): uvec[i] = (i+1)*1.0/(n+1) wvec[i] = (n-i)*1.0/(n+1) k1vec, k2vec, kavec, kgvec = CompVecCurvature01( geom_id, 0, uvec, wvec )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – surf_indx int Main surface index from the parent Geom
[in] – us vector<double> Input vector of U (0 - 1) surface coordinates
[in] – ws vector<double> Input vector of W (0 - 1) surface coordinates
[out] – k1_out_vec vector<double> Output vector of maximum principal curvatures
[out] – k2_out_vec vector<double> Output vector of minimum principal curvatures
[out] – ka_out_vec vector<double> Output vector of mean curvatures
[out] – kg_out_vec vector<double> Output vector of Gaussian curvatures
- openvsp.vsp.CompVecNorm01(geom_id, surf_indx, us, ws)¶
Determine the normal vector on a surface for each surface coordinate point in the input arrays
# Add Pod Geom geom_id = AddGeom( "POD", "" ) n = 5 uvec = [0]*n wvec = [0]*n for i in range(n): uvec[i] = (i+1)*1.0/(n+1) wvec[i] = (n-i)*1.0/(n+1) normvec = CompVecNorm01( geom_id, 0, uvec, wvec )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – surf_indx int Main surface index from the parent Geom
[in] – us vector<double> Input vector of U (0 - 1) surface coordinates
[in] – ws vector<double> Input vector of W (0 - 1) surface coordinates
- Return type:
std::vector< vec3d,std::allocator< vec3d > >
- Returns:
vector<vec3d> Vector of 3D normal vectors
- openvsp.vsp.CompVecPnt01(geom_id, surf_indx, u_in_vec, w_in_vec)¶
Determine 3D coordinate for each surface coordinate point in the input arrays
# Add Pod Geom geom_id = AddGeom( "POD", "" ) n = 5 uvec = [0]*n wvec = [0]*n for i in range(n): uvec[i] = (i+1)*1.0/(n+1) wvec[i] = (n-i)*1.0/(n+1) ptvec = CompVecPnt01( geom_id, 0, uvec, wvec )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – surf_indx int Main surface index from the parent Geom
[in] – u_in_vec vector<double> Input vector of U (0 - 1) surface coordinates
[in] – w_in_vec vector<double> Input vector of W (0 - 1) surface coordinates
- Return type:
std::vector< vec3d,std::allocator< vec3d > >
- Returns:
vector<vec3d> Vector of 3D coordinate points
- openvsp.vsp.CompVecPntRST(geom_id, surf_indx, r_in_vec, s_in_vec, t_in_vec)¶
Determine 3D coordinate for each volume coordinate point in the input arrays
# Add Pod Geom geom_id = AddGeom( "POD", "" ) n = 5 rvec = [0]*n svec = [0]*n tvec = [0]*n for i in range(n): rvec[i] = (i+1)*1.0/(n+1) svec[i] = (n-i)*1.0/(n+1) tvec[i] = (i+1)*1.0/(n+1) ptvec = CompVecPntRST( geom_id, 0, rvec, svec, tvec )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – surf_indx int Main surface index from the parent Geom
[in] – r_in_vec vector<double> Input vector of R (0 - 1.0) volume coordinates
[in] – s_in_vec vector<double> Input vector of S (0 - 1.0) volume coordinates
[in] – t_in_vec vector<double> Input vector of T (0 - 1.0) volume coordinates
- Return type:
std::vector< vec3d,std::allocator< vec3d > >
- Returns:
vector<vec3d> Vector of 3D coordinate points
- openvsp.vsp.ComputeBORXSecPnt(bor_id, fract)¶
Compute 3D coordinate for a point on a BOR XSecCurve given the parameter value (U) along the curve
#==== Add Geom ====// # Add Body of Recolution bor_id = AddGeom( "BODYOFREVOLUTION", "" ) u_fract = 0.25 pnt = ComputeBORXSecPnt( bor_id, u_fract )
- Parameters:
[in] – bor_id string Body of revolution Geom ID
[in] – fract double Curve parameter value (range: 0 - 1)
- Return type:
- Returns:
vec3d Coordinate point on curve
- openvsp.vsp.ComputeBORXSecTan(bor_id, fract)¶
Compute the tangent vector of a point on a BOR XSecCurve given the parameter value (U) along the curve
# Add Body of Recolution bor_id = AddGeom( "BODYOFREVOLUTION", "" ) u_fract = 0.25 tan = ComputeBORXSecTan( bor_id, u_fract )
- Parameters:
[in] – bor_id string Body of revolution Geom ID
[in] – fract double Curve parameter value (range: 0 - 1)
- Return type:
- Returns:
vec3d Tangent vector on curve
- openvsp.vsp.ComputeCFDMesh(set, degenset, file_export_types)¶
Create a CFD Mesh for the components in the set. This analysis cannot be run through the Analysis Manager.
#==== CFDMesh Method Facet Export =====// SetComputationFileName( CFD_FACET_TYPE, "TestCFDMeshFacet_API.facet" ) print( "\tComputing CFDMesh..." ) ComputeCFDMesh( SET_ALL, SET_NONE, CFD_FACET_TYPE )
See also: COMPUTATION_FILE_TYPE :param [in]: set int Set index (i.e. SET_ALL) :param [in]: degenset int DegenSet index (i.e. SET_NONE) :param [in]: file_export_types int CFD Mesh file type to export (supports XOR i.e CFD_SRF_TYPE & CFD_STL_TYPE)
- openvsp.vsp.ComputeCompGeom(set, half_mesh, file_export_types)¶
Mesh, intersect, and trim components in the set. Alternatively can be run through the Analysis Manager with ‘CompGeom’.
#==== Add Pod Geom ====// pid = AddGeom( "POD", "" ) #==== Run CompGeom And Get Results ====// mesh_id = ComputeCompGeom( SET_ALL, False, 0 ) # Half Mesh false and no file export comp_res_id = FindLatestResultsID( "Comp_Geom" ) # Find Results ID double_arr = GetDoubleResults( comp_res_id, "Wet_Area" ) # Extract Results
See also: SetAnalysisInputDefaults, PrintAnalysisInputs, ExecAnalysis, COMPUTATION_FILE_TYPE :param [in]: set Set index (i.e. SET_ALL) :param [in]: half_mesh Flag to ignore surfaces on the negative side of the XZ plane (e.g. symmetry) :param [in]: file_export_types CompGeom file type to export (supports XOR i.e. COMP_GEOM_CSV_TYPE & COMP_GEOM_TXT_TYPE ) :rtype: string :return: MeshGeom ID
- openvsp.vsp.ComputeDegenGeom(set, file_export_types)¶
Compute the degenerate geometry representation for the components in the set. Alternatively can be run through the Analysis Manager with ‘DegenGeom’ or ‘VSPAERODegenGeom’.
#==== Set File Name ====// SetComputationFileName( DEGEN_GEOM_CSV_TYPE, "TestDegenScript.csv" ) #==== Run Degen Geom ====// ComputeDegenGeom( SET_ALL, DEGEN_GEOM_CSV_TYPE )
See also: SetAnalysisInputDefaults, PrintAnalysisInputs, ExecAnalysis, COMPUTATION_FILE_TYPE :param [in]: set int Set index (i.e. SET_ALL) :param [in]: file_export_types int DegenGeom file type to export (supports XOR i.e DEGEN_GEOM_M_TYPE & DEGEN_GEOM_CSV_TYPE)
- openvsp.vsp.ComputeFeaMesh(*args)¶
Overload 1:
Compute an FEA Mesh for a Structure. Only a single output file can be generated with this function.
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) #==== Generate FEA Mesh and Export ====// print( "--> Generating FeaMesh " ) #==== Get Parent Geom ID and Index ====// parent_id = GetFeaStructParentGeomID( struct_id ) # same as pod_id ComputeFeaMesh( parent_id, struct_ind, FEA_CALCULIX_FILE_NAME )
See also: SetFeaMeshFileName, FEA_EXPORT_TYPE :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind int FEA Structure index :param [in]: file_type int FEA output file type enum (i.e. FEA_EXPORT_TYPE)
Overload 2:
Compute an FEA Mesh for a Structure. Only a single output file can be generated with this function.
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) #==== Generate FEA Mesh and Export ====// print( string( "--> Generating FeaMesh " ) ) #==== Get Parent Geom ID and Index ====// parent_id = GetFeaStructParentGeomID( struct_id ) # same as pod_id Could also call ComputeFeaMesh ( struct_id, FEA_CALCULIX_FILE_NAME )
See also: SetFeaMeshFileName, FEA_EXPORT_TYPE :param [in]: struct_id string FEA Structure index :param [in]: file_type int FEA output file type enum (i.e. FEA_EXPORT_TYPE)
- openvsp.vsp.ComputeMassProps(set, num_slices, idir)¶
Compute mass properties for the components in the set. Alternatively can be run through the Analysis Manager with ‘MassProp’.
#==== Test Mass Props ====// pid = AddGeom( "POD", "" ) mesh_id = ComputeMassProps( SET_ALL, 20, X_DIR ) mass_res_id = FindLatestResultsID( "Mass_Properties" ) double_arr = GetDoubleResults( mass_res_id, "Total_Mass" ) if len(double_arr) != 1 : print( "---> Error: API ComputeMassProps" )
See also: SetAnalysisInputDefaults, PrintAnalysisInputs, ExecAnalysis :param [in]: set Set index (i.e. SET_ALL) :param [in]: num_slices Number of slices :param [in]: idir Direction of slicing for integration :rtype: string :return: MeshGeom ID
- openvsp.vsp.ComputeMinClearanceDistance(*args)¶
Compute the minimum clearance distance for the specified geometry
fid = AddGeom( "FUSELAGE", "" ) # Add Fuselage pid = AddGeom( "POD", "" ) # Add Pod x = GetParm( pid, "X_Rel_Location", "XForm" ) SetParmVal( x, 3.0 ) Update() min_dist = ComputeMinClearanceDistance( pid, SET_ALL )
- Parameters:
[in] – geom_id string Geom ID
[in] – set Collision set enum (i.e. SET_ALL)
[in] – useMode bool Flag determine if mode is used instead of sets
[in] – modeID string ID of Mode to use
- Return type:
float
- Returns:
Minimum clearance distance
- openvsp.vsp.ComputePlaneSlice(set, num_slices, norm, auto_bnd, start_bnd=0, end_bnd=0, measureduct=False)¶
Slice and mesh the components in the set. Alternatively can be run through the Analysis Manager with ‘PlanarSlice’.
#==== Add Pod Geom ====// pid = AddGeom( "POD", "" ) #==== Test Plane Slice ====// slice_mesh_id = ComputePlaneSlice( 0, 6, vec3d( 0.0, 0.0, 1.0 ), True ) pslice_results = FindLatestResultsID( "Slice" ) double_arr = GetDoubleResults( pslice_results, "Slice_Area" ) if len(double_arr) != 6 : print( "---> Error: API ComputePlaneSlice" )
See also: SetAnalysisInputDefaults, PrintAnalysisInputs, ExecAnalysis :param [in]: set Set index (i.e. SET_ALL) :param [in]: num_slices Number of slices :param [in]: norm Normal axis for all slices :param [in]: auto_bnd Flag to automatically set the start and end bound locations :param [in]: start_bnd Location of the first slice along the normal axis (default: 0.0) :param [in]: end_bnd Location of the last slice along the normal axis (default: 0.0) :param [in]: measureduct Flag to measure negative area inside positive area (default: false) :rtype: string :return: MeshGeom ID
- openvsp.vsp.ComputeXSecPnt(xsec_id, fract)¶
Compute 3D coordinate for a point on an XSec curve given the parameter value (U) along the curve
#==== Add Geom ====// stack_id = AddGeom( "STACK" ) #==== Get The XSec Surf ====// xsec_surf = GetXSecSurf( stack_id, 0 ) xsec = GetXSec( xsec_surf, 2 ) u_fract = 0.25 pnt = ComputeXSecPnt(xsec, u_fract)
- Parameters:
[in] – xsec_id string XSec ID
[in] – fract double Curve parameter value (range: 0 - 1)
- Return type:
- Returns:
vec3d 3D coordinate point
- openvsp.vsp.ComputeXSecTan(xsec_id, fract)¶
Compute the tangent vector of a point on an XSec curve given the parameter value (U) along the curve
#==== Add Geom ====// stack_id = AddGeom( "STACK" ) #==== Get The XSec Surf ====// xsec_surf = GetXSecSurf( stack_id, 0 ) xsec = GetXSec( xsec_surf, 2 ) u_fract = 0.25 tan = ComputeXSecTan( xsec, u_fract )
- Parameters:
[in] – xsec_id string XSec ID
[in] – fract double Curve parameter value (range: 0 - 1)
- Return type:
- Returns:
vec3d Tangent vector
- openvsp.vsp.ConvertEtatoU(geom_id, eta)¶
Convert eta wing coordinate to u coordinate.
# Add Wing Geom geom_id = AddGeom( "WING", "" ) surf_indx = 0 eta= 0.25 u = ConvertEtatoU( geom_id, eta )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – eta Eta (0 - 1) wing spanwise coordinate
[out] – u_out U (0 - 1) surface coordinate
- openvsp.vsp.ConvertLMNtoRST(geom_id, surf_indx, l, m, n)¶
Convert LMN volumetric coordinates to RST coordinates.
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 l = 0.12 m = 0.34 n = 0.56 r_out, s_out, t_out = ConvertLMNtoRST( geom_id, surf_indx, l, m, n )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – surf_indx int Main surface index from the parent Geom
[in] – l L (0 - 1) linear volume coordinate
[in] – m M (0 - 1) linear volume coordinate
[in] – n N (0 - 1) linear volume coordinate
[out] – r_out R (0 - 1) volume coordinate
[out] – s_out S (0 - 1) volume coordinate
[out] – t_out T (0 - 1) volume coordinate
- openvsp.vsp.ConvertLMNtoRSTVec(geom_id, surf_indx, l_vec, m_vec, n_vec)¶
Convert vector of LMN volumetric coordinates to RST coordinates.
# Add Pod Geom geom_id = AddGeom( "POD", "" ) n = 5 lvec = [0]*n mvec = [0]*n nvec = [0]*n for i in range(n): lvec[i] = (i+1)*1.0/(n+1) mvec[i] = (n-i)*1.0/(n+1) nvec[i] = (i+1)*1.0/(n+1) rvec, svec, tvec = ConvertLMNtoRSTVec( geom_id, 0, lvec, mvec, nvec )
See also: ConvertRSTtoLMNVec, ConvertRSTtoLMN, ConvertLMNtoRST :param [in]: geom_id string Parent Geom ID :param [in]: surf_indx int Main surface index from the parent Geom :param [in]: l_vec vector<double> Input vector of L (0 - 1) linear volumetric coordinate :param [in]: m_vec vector<double> Input vector of M (0 - 1) linear volumetric coordinate :param [in]: n_vec vector<double> Input vector of N (0 - 1) linear volumetric coordinate :param [out]: r_out_vec vector<double> Output vector of R (0 - 1) volumetric coordinate :param [out]: s_out_vec vector<double> Output vector of S (0 - 1) volumetric coordinate :param [out]: t_out_vec vector<double> Output vector of T (0 - 1) volumetric coordinate
- openvsp.vsp.ConvertLtoR(geom_id, surf_indx, l)¶
Convert L volumetric coordinate to R coordinate.
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 l = 0.12 r_out = ConvertLtoR( geom_id, surf_indx, l )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – surf_indx int Main surface index from the parent Geom
[in] – l L (0 - 1) volume coordinate
[out] – r_out R (0 - 1) linear volume coordinate
- openvsp.vsp.ConvertRSTtoLMN(geom_id, surf_indx, r, s, t)¶
Convert RST volumetric coordinates to LMN coordinates.
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 r = 0.12 s = 0.68 t = 0.56 l_out, m_out, n_out = ConvertRSTtoLMN( geom_id, surf_indx, r, s, t )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – surf_indx int Main surface index from the parent Geom
[in] – r R (0 - 1) volume coordinate
[in] – s S (0 - 1) volume coordinate
[in] – t T (0 - 1) volume coordinate
[out] – l_out L (0 - 1) linear volume coordinate
[out] – m_out M (0 - 1) linear volume coordinate
[out] – n_out N (0 - 1) linear volume coordinate
- openvsp.vsp.ConvertRSTtoLMNVec(geom_id, surf_indx, r_vec, s_vec, t_vec)¶
Convert vector of RST volumetric coordinates to LMN coordinates.
# Add Pod Geom geom_id = AddGeom( "POD", "" ) n = 5 rvec = [0]*n svec = [0]*n tvec = [0]*n for i in range(n): rvec[i] = (i+1)*1.0/(n+1) svec[i] = (n-i)*1.0/(n+1) tvec[i] = (i+1)*1.0/(n+1) lvec, mvec, nvec = ConvertRSTtoLMNVec( geom_id, 0, rvec, svec, tvec )
See also: ConvertLMNtoRSTVec, ConvertRSTtoLMN, ConvertLMNtoRST :param [in]: geom_id string Parent Geom ID :param [in]: surf_indx int Main surface index from the parent Geom :param [in]: r_vec vector<double> Input vector of R (0 - 1) volumetric coordinate :param [in]: s_vec vector<double> Input vector of S (0 - 1) volumetric coordinate :param [in]: t_vec vector<double> Input vector of T (0 - 1) volumetric coordinate :param [out]: l_out_vec vector<double> Output vector of L (0 - 1) linear volumetric coordinate :param [out]: m_out_vec vector<double> Output vector of M (0 - 1) linear volumetric coordinate :param [out]: n_out_vec vector<double> Output vector of N (0 - 1) linear volumetric coordinate
- openvsp.vsp.ConvertRtoL(geom_id, surf_indx, r)¶
Convert R volumetric coordinate to L coordinate.
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 r = 0.12 l_out = ConvertRtoL( geom_id, surf_indx, r )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – surf_indx int Main surface index from the parent Geom
[in] – r R (0 - 1) volume coordinate
[out] – l_out L (0 - 1) linear volume coordinate
- openvsp.vsp.ConvertUtoEta(geom_id, u)¶
Convert U coordinate to eta wing coordinate.
# Add Wing Geom geom_id = AddGeom( "WING", "" ) surf_indx = 0 u = 0.25 eta_out = ConvertUtoEta( geom_id, u )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – u U (0 - 1) surface coordinate
[out] – eta_out Eta (0 - 1) wing spanwise coordinate
- openvsp.vsp.ConvertXSecToEdit(geom_id, indx=0)¶
Convert any XSec type into an EditCurveXSec. This function will work for BOR Geoms, in which case the input XSec index is ignored.
# Add Stack sid = AddGeom( "STACK", "" ) # Get First (and Only) XSec Surf xsec_surf = GetXSecSurf( sid, 0 ) ChangeXSecShape( xsec_surf, 1, XS_ROUNDED_RECTANGLE ) # Convert Rounded Rectangle to Edit Curve type XSec ConvertXSecToEdit( sid, 1 ) # Identify XSec 1 xsec_1 = GetXSec( xsec_surf, 1 ) # Get the control points for the default shape xsec1_pts = GetEditXSecCtrlVec( xsec_1, True ) # The returned control points will not be scaled by width and height
- Parameters:
[in] – geom_id string Geom ID
[in] – indx XSec index
- openvsp.vsp.CopyAttribute(attrID)¶
Copy an attribute to the clipboard by attributeID
#Get first attribute in vehicle as an example AttrID = vsp.FindAllAttributes()[0] vsp.CopyAttribute( AttrID ) #==== Write Some Fake Test Results =====// # not implemented
- Parameters:
[in] – attrID string ID of attribute to be copied
- openvsp.vsp.CopyGeomToClipboard(geom_id)¶
Copy Geom from current location and store on clipboard
#==== Add Pod Geometries ====// pid1 = AddGeom( "POD", "" ) pid2 = AddGeom( "POD", "" ) CopyGeomToClipboard( pid1 ) PasteGeomClipboard( pid2 ) # Paste Pod 1 as child of Pod 2 geom_ids = FindGeoms() if len(geom_ids) != 3 : print( "---> Error: API Copy/Paste Geom " )
See also: PasteGeomClipboard :param [in]: geom_id string Geom ID
- openvsp.vsp.CopyPasteSet(copyIndex, pasteIndex)¶
Copies all the states of a geom set and pastes them into a specific set based on passed in indexs
# Add Fuselage Geom fuseid = AddGeom( "FUSELAGE", "" ) #set fuseid's state for set 3 to true SetSetFlag( fuseid, 3, True ) #Copy set 3 and Paste into set 4 CopyPasteSet( 3, 4 ) #get fuseid's state for set 4 flag_value = GetSetFlag( fuseid, 4 ) if flag_value != True: print( "---> Error: API CopyPasteSet " )
- Parameters:
[in] – copyIndex Copy Index
[in] – pasteIndex Paste Index
- openvsp.vsp.CopyXSec(geom_id, index)¶
Copy a cross-section from the specified geometry and maintain it in memory
# Add Stack sid = AddGeom( "STACK", "" ) # Copy XSec To Clipboard CopyXSec( sid, 1 ) # Paste To XSec 3 PasteXSec( sid, 3 )
See also: PasteXSec :param [in]: geom_id string Geom ID :param [in]: index XSec index
- openvsp.vsp.CreateAndAddMode(name, normal_set, degen_set)¶
Create a Mode – a combination of Sets and Variable Presets
# Illustrating use of Modes requires substantial setup of the model including components, sets, and variable presets. # # Setup boiler plate. pod1 = AddGeom( "POD", "" ) wing = AddGeom( "WING", pod1 ) SetParmVal( wing, "Trans_Attach_Flag", "Attach", ATTACH_TRANS_LMN ) SetParmVal( wing, "L_Attach_Location", "Attach", 0.35 ) SetSetName( SET_FIRST_USER, "NonLifting" ) SetSetName( SET_FIRST_USER + 1, "Lifting" ) SetSetFlag( pod1, SET_FIRST_USER, True ) SetSetFlag( wing, SET_FIRST_USER + 1, True ) gid = AddVarPresetGroup( "Tess" ) p1 = FindParm( pod1, "Tess_U", "Shape" ) AddVarPresetParm( gid, p1 ) p2 = FindParm( pod1, "Tess_W", "Shape" ) AddVarPresetParm( gid, p2 ) sid = AddVarPresetSetting( gid, "Default" ) SaveVarPresetParmVals( gid, sid ) sid1 = AddVarPresetSetting( gid, "Coarse" ) SetVarPresetParmVal( gid, sid1, p1, 3 ) SetVarPresetParmVal( gid, sid1, p2, 5 ) sid2 = AddVarPresetSetting( gid, "Fine" ) SetVarPresetParmVal( gid, sid, p1, 35 ) SetVarPresetParmVal( gid, sid, p2, 21 ) gid2 = AddVarPresetGroup( "Design" ) p3 = FindParm( pod1, "Length", "Design" ) AddVarPresetParm( gid2, p3 ) p4 = FindParm( pod1, "FineRatio", "Design" ) AddVarPresetParm( gid2, p4 ) sid3 = AddVarPresetSetting( gid2, "Normal" ) SaveVarPresetParmVals( gid2, sid3 ) sid4 = AddVarPresetSetting( gid2, "ShortFat" ) SetVarPresetParmVal( gid2, sid4, p3, 3.0 ) SetVarPresetParmVal( gid2, sid4, p4, 5.0 ) sid5 = AddVarPresetSetting( gid2, "LongThin" ) SetVarPresetParmVal( gid2, sid5, p3, 20.0 ) SetVarPresetParmVal( gid2, sid5, p4, 35.0 ) # End of setup boiler plate. mid1 = CreateAndAddMode( "FatWetAreas", SET_ALL, SET_NONE ) ModeAddGroupSetting( mid1, gid, sid1 ) ModeAddGroupSetting( mid1, gid2, sid4 ) mid2 = CreateAndAddMode( "ThinAero", SET_FIRST_USER, SET_FIRST_USER + 1 ) ModeAddGroupSetting( mid2, gid, sid2 ) ModeAddGroupSetting( mid1, gid2, sid5 ) ApplyModeSettings( mid2 ) Update()
- Parameters:
[in] – name string Name for new Mode
[in] – normal_set int Normal set for Mode
[in] – degen_set int Degen set for Mode
- Return type:
string
- Returns:
string Mode ID for new Mode
- openvsp.vsp.CreateGeomResults(geom_id, name)¶
Create a new result for a Geom
#==== Test Comp Geom ====// gid1 = AddGeom( "POD", "" ) mesh_id = ComputeCompGeom( 0, False, 0 ) #==== Test Comp Geom Mesh Results ====// mesh_geom_res_id = CreateGeomResults( mesh_id, "Comp_Mesh" ) int_arr = GetIntResults( mesh_geom_res_id, "Num_Tris" ) if int_arr[0] < 4 : print( "---> Error: API CreateGeomResults" )
- Parameters:
[in] – geom_id string Geom ID
[in] – name Result name
- Return type:
string
- Returns:
Result ID
- openvsp.vsp.CreateVSPAEROControlSurfaceGroup()¶
Add a new VSPAERO control surface group using the default naming convention. The control surface group will not contain any control surfaces until they are added.
wid = AddGeom( "WING", "" ) # Add Wing aileron_id = AddSubSurf( wid, SS_CONTROL ) # Add Control Surface Sub-Surface group_index = CreateVSPAEROControlSurfaceGroup() # Empty control surface group num_group = GetNumControlSurfaceGroups() if num_group != 1 : print( "Error: CreateVSPAEROControlSurfaceGroup" )
See also: AddSelectedToCSGroup :rtype: int :return: Index of the new VSPAERO control surface group
- openvsp.vsp.CutAttribute(attrID)¶
Cut an attribute from its collection to the clipboard by attributeID
#Get first attribute in vehicle as an example VehID = vsp.GetVehicleID() CollID = vsp.GetChildCollection( VehID ) AttrName = 'Example_String_Attr' StringValue = 'Example_String_Attr_DataVal' AttrID = vsp.AddAttributeString( CollID, AttrName, StringValue ) vsp.CutAttribute( AttrID ) NewCollID = vsp.GetChildCollection( "_AttrWMGroup" ) NewAttrIDs = vsp.PasteAttribute( NewCollID ) #==== Write Some Fake Test Results =====// # not implemented
- Parameters:
[in] – attrID string ID of attribute to be copied
- openvsp.vsp.CutGeomToClipboard(geom_id)¶
Cut Geom from current location and store on clipboard
#==== Add Pod Geometries ====// pid1 = AddGeom( "POD", "" ) pid2 = AddGeom( "POD", "" ) CutGeomToClipboard( pid1 ) PasteGeomClipboard( pid2 ) # Paste Pod 1 as child of Pod 2 geom_ids = FindGeoms() if len(geom_ids) != 2 : print( "---> Error: API Cut/Paste Geom " )
See also: PasteGeomClipboard :param [in]: geom_id string Geom ID
- openvsp.vsp.CutXSec(geom_id, index)¶
Cut a cross-section from the specified geometry and maintain it in memory
fid = AddGeom( "FUSELAGE", "" ) # Add Fuselage #==== Insert, Cut, Paste Example ====// InsertXSec( fid, 1, XS_ROUNDED_RECTANGLE ) # Insert A Cross-Section CopyXSec( fid, 2 ) # Copy Just Created XSec To Clipboard PasteXSec( fid, 1 ) # Paste Clipboard CutXSec( fid, 2 ) # Cut Created XSec
See also: PasteXSec :param [in]: geom_id string Geom ID :param [in]: index XSec index
- openvsp.vsp.DELIM_COMMA = 0¶
Comma delimiter
- openvsp.vsp.DELIM_NONE = 3¶
No delimiter
- openvsp.vsp.DELIM_NUM_TYPES = 4¶
Number of delimiter types
- openvsp.vsp.DELIM_SPACE = 2¶
Space delimiter
- openvsp.vsp.DELIM_USCORE = 1¶
Underscore delimiter
- openvsp.vsp.DEPTH_FREE = 2¶
Set 3D background at specified location
- openvsp.vsp.DEPTH_FRONT = 0¶
Set 3D background before model
- openvsp.vsp.DEPTH_REAR = 1¶
Set 3D background behind model
- openvsp.vsp.DESIGN_CL = 1¶
Input ideal lift coefficient, calculate maximum camber
- openvsp.vsp.DISK_SURF = 2¶
Disk VSP surface
- openvsp.vsp.DISPLAY_BEZIER = 0¶
Display the normal Bezier surface (default)
- openvsp.vsp.DISPLAY_DEGEN_CAMBER = 3¶
Display as camber Degen Geom
- openvsp.vsp.DISPLAY_DEGEN_PLATE = 2¶
Display as plate Degen Geom
- openvsp.vsp.DISPLAY_DEGEN_SURF = 1¶
Display as surface Degen Geom
- openvsp.vsp.DOUBLE_DATA = 2¶
Double data type
- openvsp.vsp.DOUBLE_MATRIX_DATA = 6¶
Double matrix data type
- openvsp.vsp.DO_NOT_USE_CF_TURB_IMPLICIT_KARMAN = 3¶
Implicit Karman turbulent Cf equation (DO NOT USE)
- openvsp.vsp.DO_NOT_USE_CF_TURB_ROUGHNESS_SCHLICHTING_LOCAL = 17¶
Roughness Schlichting Local turbulent Cf equation (DO NOT USE)
- openvsp.vsp.DO_NOT_USE_CF_TURB_ROUGHNESS_WHITE = 18¶
Roughness White turbulent Cf equation (DO NOT USE)
- openvsp.vsp.DO_NOT_USE_CF_TURB_SCHLICHTING_INCOMPRESSIBLE = 11¶
Schlichting Incompressible turbulent Cf equation (DO NOT USE)
- openvsp.vsp.DO_NOT_USE_CF_TURB_SCHLICHTING_PRANDTL = 12¶
Schlichting-Prandtl turbulent Cf equation (DO NOT USE)
- openvsp.vsp.DO_NOT_USE_CF_TURB_SCHULTZ_GRUNOW_HIGH_RE = 13¶
Schultz-Grunow High Re turbulent Cf equation (DO NOT USE)
- openvsp.vsp.DO_NOT_USE_CF_TURB_WHITE_CHRISTOPH_COMPRESSIBLE = 15¶
White-Christoph Compressible turbulent Cf equation (DO NOT USE)
- openvsp.vsp.DelAdvLink(index)¶
Delete an advanced link specified by index
pod = AddGeom( "POD", "" ) length = FindParm( pod, "Length", "Design" ) x_pos = GetParm( pod, "X_Rel_Location", "XForm" ) AddAdvLink( "ExampleLink" ) indx = GetLinkIndex( "ExampleLink" ) AddAdvLinkInput( indx, length, "len" ) AddAdvLinkOutput( indx, x_pos, "x" ) SetAdvLinkCode( indx, "x = 10.0 - len;" ) BuildAdvLinkScript( indx ) DelAdvLink( indx ) link_array = GetAdvLinkNames() # Should print nothing. for n in range(len(link_array) ): print( link_array[n] )
- Parameters:
[in] – index Index for advanced link
- openvsp.vsp.DelAdvLinkInput(index, var_name)¶
Delete an input variable from an advanced link
pod = AddGeom( "POD", "" ) length = FindParm( pod, "Length", "Design" ) x_pos = GetParm( pod, "X_Rel_Location", "XForm" ) y_pos = GetParm( pod, "Y_Rel_Location", "XForm" ) AddAdvLink( "ExampleLink" ) indx = GetLinkIndex( "ExampleLink" ) AddAdvLinkInput( indx, length, "len" ) AddAdvLinkOutput( indx, x_pos, "x" ) AddAdvLinkInput( indx, y_pos, "y" ) SetAdvLinkCode( indx, "x = 10.0 - len;" ) BuildAdvLinkScript( indx ) DelAdvLinkInput( indx, "y" ) BuildAdvLinkScript( indx )
- Parameters:
[in] – index int Advanced link index
[in] – var_name string Name for advanced link input variable to delete
- openvsp.vsp.DelAdvLinkOutput(index, var_name)¶
Delete an output variable from an advanced link
pod = AddGeom( "POD", "" ) length = FindParm( pod, "Length", "Design" ) x_pos = GetParm( pod, "X_Rel_Location", "XForm" ) y_pos = GetParm( pod, "Y_Rel_Location", "XForm" ) AddAdvLink( "ExampleLink" ) indx = GetLinkIndex( "ExampleLink" ) AddAdvLinkInput( indx, length, "len" ) AddAdvLinkOutput( indx, x_pos, "x" ) AddAdvLinkOutput( indx, y_pos, "y" ) SetAdvLinkCode( indx, "x = 10.0 - len;" ) BuildAdvLinkScript( indx ) DelAdvLinkOutput( indx, "y" ) BuildAdvLinkScript( indx )
- Parameters:
[in] – index int Advanced link index
[in] – var_name string Name for advanced link output variable to delete
- openvsp.vsp.DelAllAdvLinks()¶
Delete all advanced links
pod = AddGeom( "POD", "" ) length = FindParm( pod, "Length", "Design" ) x_pos = GetParm( pod, "X_Rel_Location", "XForm" ) AddAdvLink( "ExampleLink" ) indx = GetLinkIndex( "ExampleLink" ) AddAdvLinkInput( indx, length, "len" ) AddAdvLinkOutput( indx, x_pos, "x" ) SetAdvLinkCode( indx, "x = 10.0 - len;" ) BuildAdvLinkScript( indx ) DelAllAdvLinks() link_array = GetAdvLinkNames() # Should print nothing. for n in range( len(link_array) ): print( link_array[n] )
- openvsp.vsp.DelAllBackground3Ds()¶
Delete all Background3Ds in model
# Add Background3D AddBackground3D() AddBackground3D() AddBackground3D() DelAllBackground3Ds() nbg = GetNumBackground3Ds() if nbg != 0 : print( "ERROR: DelAllBackground3Ds" )
- openvsp.vsp.DelAllModes()¶
Delete all modes from the model.
# Illustrating use of Modes requires substantial setup of the model including components, sets, and variable presets. # # Setup boiler plate. pod1 = AddGeom( "POD", "" ) wing = AddGeom( "WING", pod1 ) SetParmVal( wing, "Trans_Attach_Flag", "Attach", ATTACH_TRANS_LMN ) SetParmVal( wing, "L_Attach_Location", "Attach", 0.35 ) SetSetName( SET_FIRST_USER, "NonLifting" ) SetSetName( SET_FIRST_USER + 1, "Lifting" ) SetSetFlag( pod1, SET_FIRST_USER, True ) SetSetFlag( wing, SET_FIRST_USER + 1, True ) gid = AddVarPresetGroup( "Tess" ) p1 = FindParm( pod1, "Tess_U", "Shape" ) AddVarPresetParm( gid, p1 ) p2 = FindParm( pod1, "Tess_W", "Shape" ) AddVarPresetParm( gid, p2 ) sid = AddVarPresetSetting( gid, "Default" ) SaveVarPresetParmVals( gid, sid ) sid1 = AddVarPresetSetting( gid, "Coarse" ) SetVarPresetParmVal( gid, sid1, p1, 3 ) SetVarPresetParmVal( gid, sid1, p2, 5 ) sid2 = AddVarPresetSetting( gid, "Fine" ) SetVarPresetParmVal( gid, sid, p1, 35 ) SetVarPresetParmVal( gid, sid, p2, 21 ) gid2 = AddVarPresetGroup( "Design" ) p3 = FindParm( pod1, "Length", "Design" ) AddVarPresetParm( gid2, p3 ) p4 = FindParm( pod1, "FineRatio", "Design" ) AddVarPresetParm( gid2, p4 ) sid3 = AddVarPresetSetting( gid2, "Normal" ) SaveVarPresetParmVals( gid2, sid3 ) sid4 = AddVarPresetSetting( gid2, "ShortFat" ) SetVarPresetParmVal( gid2, sid4, p3, 3.0 ) SetVarPresetParmVal( gid2, sid4, p4, 5.0 ) sid5 = AddVarPresetSetting( gid2, "LongThin" ) SetVarPresetParmVal( gid2, sid5, p3, 20.0 ) SetVarPresetParmVal( gid2, sid5, p4, 35.0 ) # End of setup boiler plate. mid1 = CreateAndAddMode( "FatWetAreas", SET_ALL, SET_NONE ) ModeAddGroupSetting( mid1, gid, sid1 ) ModeAddGroupSetting( mid1, gid2, sid4 ) mid2 = CreateAndAddMode( "ThinAero", SET_FIRST_USER, SET_FIRST_USER + 1 ) ModeAddGroupSetting( mid2, gid, sid2 ) ModeAddGroupSetting( mid1, gid2, sid5 ) ApplyModeSettings( mid2 ) Update() DelAllModes()
- openvsp.vsp.DelBackground3D(id)¶
Delete specific Background3D frommodel
# Add Background3D AddBackground3D() bg_id = AddBackground3D() AddBackground3D() nbg = GetNumBackground3Ds() DelBackground3D( bg_id ) if GetNumBackground3Ds() != nbg -1 : print( "ERROR: DelBackground3D" )
- Parameters:
[in] – id string Background3D ID to delete
- openvsp.vsp.DelFeaBC(fea_struct_id, bc_id)¶
Delete an FEA BC from a Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ); #==== Add BC ====// bc_id = AddFeaBC( struct_id, FEA_BC_STRUCTURE ) DelFeaBC( struct_id, bc_id )
See also: FEA_BC_TYPE :param [in]: string fea_struct_id FEA Structure ID :param [in]: string bc_id FEA BC ID
- openvsp.vsp.DelMode(mid)¶
Delete a mode from the model.
# Illustrating use of Modes requires substantial setup of the model including components, sets, and variable presets. # # Setup boiler plate. pod1 = AddGeom( "POD", "" ) wing = AddGeom( "WING", pod1 ) SetParmVal( wing, "Trans_Attach_Flag", "Attach", ATTACH_TRANS_LMN ) SetParmVal( wing, "L_Attach_Location", "Attach", 0.35 ) SetSetName( SET_FIRST_USER, "NonLifting" ) SetSetName( SET_FIRST_USER + 1, "Lifting" ) SetSetFlag( pod1, SET_FIRST_USER, True ) SetSetFlag( wing, SET_FIRST_USER + 1, True ) gid = AddVarPresetGroup( "Tess" ) p1 = FindParm( pod1, "Tess_U", "Shape" ) AddVarPresetParm( gid, p1 ) p2 = FindParm( pod1, "Tess_W", "Shape" ) AddVarPresetParm( gid, p2 ) sid = AddVarPresetSetting( gid, "Default" ) SaveVarPresetParmVals( gid, sid ) sid1 = AddVarPresetSetting( gid, "Coarse" ) SetVarPresetParmVal( gid, sid1, p1, 3 ) SetVarPresetParmVal( gid, sid1, p2, 5 ) sid2 = AddVarPresetSetting( gid, "Fine" ) SetVarPresetParmVal( gid, sid, p1, 35 ) SetVarPresetParmVal( gid, sid, p2, 21 ) gid2 = AddVarPresetGroup( "Design" ) p3 = FindParm( pod1, "Length", "Design" ) AddVarPresetParm( gid2, p3 ) p4 = FindParm( pod1, "FineRatio", "Design" ) AddVarPresetParm( gid2, p4 ) sid3 = AddVarPresetSetting( gid2, "Normal" ) SaveVarPresetParmVals( gid2, sid3 ) sid4 = AddVarPresetSetting( gid2, "ShortFat" ) SetVarPresetParmVal( gid2, sid4, p3, 3.0 ) SetVarPresetParmVal( gid2, sid4, p4, 5.0 ) sid5 = AddVarPresetSetting( gid2, "LongThin" ) SetVarPresetParmVal( gid2, sid5, p3, 20.0 ) SetVarPresetParmVal( gid2, sid5, p4, 35.0 ) # End of setup boiler plate. mid1 = CreateAndAddMode( "FatWetAreas", SET_ALL, SET_NONE ) ModeAddGroupSetting( mid1, gid, sid1 ) ModeAddGroupSetting( mid1, gid2, sid4 ) mid2 = CreateAndAddMode( "ThinAero", SET_FIRST_USER, SET_FIRST_USER + 1 ) ModeAddGroupSetting( mid2, gid, sid2 ) ModeAddGroupSetting( mid1, gid2, sid5 ) ApplyModeSettings( mid2 ) Update() DelMode( mid1 )
- Parameters:
[in] – mid string Mode ID of mode to delete
- openvsp.vsp.DelProbe(id)¶
Delete a specific Probe from the Measure Tool
pid1 = AddGeom( "POD", "" ) SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 ) probe_id_1 = AddProbe( pid1, 0, 0.5, 0.8, "Probe 1" ) probe_id_2 = AddProbe( pid1, 0, 0.2, 0.3, "Probe 2" ) DelProbe( probe_id_1 ) probe_array = GetAllProbes() if len(probe_array) != 1 : print( "Error: DelProbe" )
- Parameters:
[in] – id Probe ID
- openvsp.vsp.DelRuler(id)¶
Delete a particular Ruler from the Measure Tool
pid1 = AddGeom( "POD", "" ) SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 ) pid2 = AddGeom( "POD", "" ) SetParmVal( pid2, "Z_Rel_Location", "XForm", 4.0 ) rid1 = AddRuler( pid1, 1, 0.2, 0.3, pid2, 0, 0.2, 0.3, "Ruler 1" ) rid2 = AddRuler( pid1, 0, 0.4, 0.6, pid1, 1, 0.8, 0.9, "Ruler 2" ) ruler_array = GetAllRulers() DelRuler( ruler_array[0] )
- Parameters:
[in] – id string Ruler ID
- openvsp.vsp.DeleteAllCFDSources()¶
Delete all CFD Mesh sources for all Geoms
#==== Add Pod Geom ====// pid = AddGeom( "POD", "" ) AddCFDSource( POINT_SOURCE, pid, 0, 0.25, 2.0, 0.5, 0.5 ) # Add A Point Source DeleteAllCFDSources()
- openvsp.vsp.DeleteAllDesignVars()¶
Delete all design variables
- openvsp.vsp.DeleteAllProbes()¶
Delete all Probes from the Measure Tool
pid1 = AddGeom( "POD", "" ) SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 ) probe_id_1 = AddProbe( pid1, 0, 0.5, 0.8, "Probe 1" ) probe_id_2 = AddProbe( pid1, 0, 0.2, 0.3, "Probe 2" ) DeleteAllProbes() probe_array = GetAllProbes() if len(probe_array) != 0 : print( "Error: DeleteAllProbes" )
- openvsp.vsp.DeleteAllResults()¶
Delete all results
#==== Test Comp Geom ====// gid1 = AddGeom( "POD", "" ) mesh_id = ComputeCompGeom( 0, False, 0 ) #==== Test Comp Geom Mesh Results ====// mesh_geom_res_id = CreateGeomResults( mesh_id, "Comp_Mesh" ) DeleteAllResults() if ( GetNumResults( "Comp_Mesh" ) != 0 ): print( "---> Error: API DeleteAllResults" )
- openvsp.vsp.DeleteAllRulers()¶
Delete all Rulers from the Measure Tool
pid1 = AddGeom( "POD", "" ) SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 ) pid2 = AddGeom( "POD", "" ) SetParmVal( pid2, "Z_Rel_Location", "XForm", 4.0 ) rid1 = AddRuler( pid1, 1, 0.2, 0.3, pid2, 0, 0.2, 0.3, "Ruler 1" ) rid2 = AddRuler( pid1, 0, 0.4, 0.6, pid1, 1, 0.8, 0.9, "Ruler 2" ) DeleteAllRulers()
- openvsp.vsp.DeleteAllUserParm()¶
Get the user parm container ID
DeleteAllUserParm()
- openvsp.vsp.DeleteAttribute(attrID)¶
Delete attribute by attribute ID
#Get first attribute in vehicle as an example AttrID = vsp.FindAllAttributes()[0] vsp.DeleteAttribute( AttrID ) #==== Write Some Fake Test Results =====// # not implemented
- Parameters:
[in] – attrID string of attribute ID
- openvsp.vsp.DeleteExcrescence(index)¶
Delete an Excresence from the Parasite Drag Tool
AddExcrescence( "Miscellaneous", EXCRESCENCE_COUNT, 8.5 ) AddExcrescence( "Cowl Boattail", EXCRESCENCE_CD, 0.0003 ) AddExcrescence( "Percentage Example", EXCRESCENCE_PERCENT_GEOM, 5 ) DeleteExcrescence( 2 ) # Last Index
- Parameters:
[in] – index int Index of the Excressence to delete
- openvsp.vsp.DeleteFeaPart(geom_id, fea_struct_ind, part_id)¶
Delete an FEA Part from a Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Add Bulkead ====// bulkhead_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE ) #==== Add Fixed Point ====// fixed_id = AddFeaPart( pod_id, struct_ind, FEA_FIX_POINT ) #==== Delete Bulkead ====// DeleteFeaPart( pod_id, struct_ind, bulkhead_id )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – fea_struct_ind FEA Structure index
[in] – part_id FEA Part ID
- openvsp.vsp.DeleteFeaStruct(geom_id, fea_struct_ind)¶
Delete an FEA Structure and all FEA Parts and FEA SubSurfaces associated with it
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind_1 = AddFeaStruct( pod_id ) struct_ind_2 = AddFeaStruct( pod_id ) DeleteFeaStruct( pod_id, struct_ind_1 )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – fea_struct_ind FEA Structure index
- openvsp.vsp.DeleteFeaSubSurf(geom_id, fea_struct_ind, ss_id)¶
Delete an FEA SubSurface from a Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Add LineArray ====// line_array_id = AddFeaSubSurf( pod_id, struct_ind, SS_LINE_ARRAY ) #==== Add Rectangle ====// rect_id = AddFeaSubSurf( pod_id, struct_ind, SS_RECTANGLE ) #==== Delete LineArray ====// DeleteFeaSubSurf( pod_id, struct_ind, line_array_id )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – fea_struct_ind FEA Structure index
[in] – ss_id FEA SubSurface ID
- openvsp.vsp.DeleteGeom(geom_id)¶
Delete a particular Geom
#==== Add Wing Geometry ====// wing_id = AddGeom( "WING" ) #==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) DeleteGeom( wing_id )
- Parameters:
[in] – geom_id string Geom ID
- openvsp.vsp.DeleteGeomVec(del_vec)¶
Delete multiple Geoms
#==== Add Pod Geometry ====// pid = AddGeom( "POD", "" ) rid = ExecAnalysis( "CompGeom" ) mesh_id_vec = GetStringResults( rid, "Mesh_GeomID" ) DeleteGeomVec( mesh_id_vec )
- Parameters:
[in] – del_vec vector<string> Vector of Geom IDs
- openvsp.vsp.DeleteResult(id)¶
Delete a particular result
#==== Test Comp Geom ====// gid1 = AddGeom( "POD", "" ) mesh_id = ComputeCompGeom( 0, False, 0 ) #==== Test Comp Geom Mesh Results ====// mesh_geom_res_id = CreateGeomResults( mesh_id, "Comp_Mesh" ) DeleteResult( mesh_geom_res_id ) if ( GetNumResults( "Comp_Mesh" ) != 0 ): print( "---> Error: API DeleteResult" )
- Parameters:
[in] – id Result ID
- openvsp.vsp.DeleteSubSurf(*args)¶
Overload 1:
Delete the specified sub-surface
wid = AddGeom( "WING", "" ) # Add Wing ss_line_id = AddSubSurf( wid, SS_LINE ) # Add Sub Surface Line 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 = f"Number of SubSurfaces: {num_ss}\n" print( num_str )
- Parameters:
[in] – geom_id string Geom ID
[in] – sub_id string Sub-surface ID
Overload 2:
Delete the specified sub-surface
wid = AddGeom( "WING", "" ) # Add Wing ss_line_id = AddSubSurf( wid, SS_LINE ) # Add Sub Surface Line 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 = f"Number of SubSurfaces: {num_ss}\n" print( num_str )
- Parameters:
[in] – sub_id string Sub-surface ID
- openvsp.vsp.DeleteUserParm(id)¶
Get the user parm container ID
n = GetNumPredefinedUserParms() id_arr = GetAllUserParms() if len(id_arr) > n : DeleteUserParm( id_arr[n] )
- openvsp.vsp.DeleteVarPresetGroup(group_id)¶
Delete Variable Preset Group (and all contained settings)
# Add Pod Geom pod1 = AddGeom( "POD", "" ) gid = AddVarPresetGroup( "Tess" ) sid = AddVarPresetSetting( gid, "Coarse" ) p1 = FindParm( pod1, "Tess_U", "Shape" ) AddVarPresetParm( gid, p1 ) DeleteVarPresetGroup( gid )
- Parameters:
[in] – group_id string Var Preset Group ID
- openvsp.vsp.DeleteVarPresetParm(group_id, parm_id)¶
Delete Parm from Variable Preset Group
# Add Pod Geom pod1 = AddGeom( "POD", "" ) gid = AddVarPresetGroup( "Tess" ) sid = AddVarPresetSetting( gid, "Coarse" ) p1 = FindParm( pod1, "Tess_U", "Shape" ) AddVarPresetParm( gid, p1 ) DeleteVarPresetParm( gid, p1 )
- Parameters:
[in] – group_id string Var Preset Group ID
[in] – parm_id string Var Parm ID
- openvsp.vsp.DeleteVarPresetSetting(group_id, setting_id)¶
Delete Variable Preset Setting
# Add Pod Geom pod1 = AddGeom( "POD", "" ) gid = AddVarPresetGroup( "Tess" ) sid = AddVarPresetSetting( gid, "Coarse" ) p1 = FindParm( pod1, "Tess_U", "Shape" ) AddVarPresetParm( gid, p1 ) DeleteVarPresetSetting( gid, sid )
- Parameters:
[in] – group_id string Var Preset Group ID
[in] – setting_id string Var Preset Setting ID
- openvsp.vsp.DemoteBORCSTLower(bor_id)¶
Demote the CST for the lower airfoil surface of a BOR. The XSecCurve must be of type XS_CST_AIRFOIL See also: GetLowerCSTDegree :param [in]: bor_id string Body of revolution Geom ID
- openvsp.vsp.DemoteBORCSTUpper(bor_id)¶
Demote the CST for the upper airfoil surface of a BOR. The XSecCurve must be of type XS_CST_AIRFOIL See also: GetUpperCSTDegree :param [in]: bor_id string Body of revolution Geom ID
- openvsp.vsp.DemoteCSTLower(xsec_id)¶
Demote the CST for the lower airfoil surface. The XSec must be of type XS_CST_AIRFOIL See also: GetLowerCSTDegree :param [in]: xsec_id XSec ID
- openvsp.vsp.DemoteCSTUpper(xsec_id)¶
Demote the CST for the upper airfoil surface. The XSec must be of type XS_CST_AIRFOIL See also: GetUpperCSTDegree :param [in]: xsec_id XSec ID
- openvsp.vsp.DisableStopGUIMenuItem()¶
Disable Stop GUI Menu Item from the OpenVSP GUI.
This reverses the operation of EnableStopGUIMenuItem.
EnableStopGUIMenuItem() DisableStopGUIMenuItem() StartGUI()
See also: EnableStopGUIMenuItem
- class openvsp.vsp.DoubleVecVec(*args)¶
Bases:
object
- append(x)¶
- assign(n, x)¶
- back()¶
- begin()¶
- capacity()¶
- clear()¶
- empty()¶
- end()¶
- erase(*args)¶
- front()¶
- get_allocator()¶
- insert(*args)¶
- iterator()¶
- pop()¶
- pop_back()¶
- push_back(x)¶
- rbegin()¶
- rend()¶
- reserve(n)¶
- resize(*args)¶
- size()¶
- swap(v)¶
- property thisown¶
The membership flag
- class openvsp.vsp.DoubleVector(*args)¶
Bases:
object
- append(x)¶
- assign(n, x)¶
- back()¶
- begin()¶
- capacity()¶
- clear()¶
- empty()¶
- end()¶
- erase(*args)¶
- front()¶
- get_allocator()¶
- insert(*args)¶
- iterator()¶
- pop()¶
- pop_back()¶
- push_back(x)¶
- rbegin()¶
- rend()¶
- reserve(n)¶
- resize(*args)¶
- size()¶
- swap(v)¶
- property thisown¶
The membership flag
- openvsp.vsp.EDGE_END_CAP = 3¶
Edge end cap
- openvsp.vsp.EDIT_XSEC_CIRCLE = 0¶
Circle initialized as cubic Bezier type
- openvsp.vsp.EDIT_XSEC_ELLIPSE = 1¶
Ellipse initialized as PCHIP type
- openvsp.vsp.EDIT_XSEC_RECTANGLE = 2¶
Rectangle initialized as linear type
- openvsp.vsp.ELLIPSOID_GEOM_SCREEN = 12¶
Ellipsoid geom screen
- openvsp.vsp.ENGINE_GEOM_FLOWPATH = 2¶
Component flowpath is modeled.
- openvsp.vsp.ENGINE_GEOM_FLOWTHROUGH = 0¶
Component is modeled as flowthrough engine.
- openvsp.vsp.ENGINE_GEOM_INLET = 1¶
Component represents integrated flowpath inlet.
- openvsp.vsp.ENGINE_GEOM_INLET_OUTLET = 2¶
Component represents integrated flowpath inlet and outlet.
- openvsp.vsp.ENGINE_GEOM_IO_NUM_TYPES = 4¶
Number of integrated flowpath component types.
- openvsp.vsp.ENGINE_GEOM_NONE = 0¶
Component is not an integrated flowpath component.
- openvsp.vsp.ENGINE_GEOM_NUM_TYPES = 4¶
Number of integrated flowpath modeling types.
- openvsp.vsp.ENGINE_GEOM_OUTLET = 3¶
Component represents integrated flowpath outlet.
- openvsp.vsp.ENGINE_GEOM_TO_FACE = 3¶
Component is modeled to face.
- openvsp.vsp.ENGINE_GEOM_TO_LIP = 1¶
Component is modeled to the lip.
- openvsp.vsp.ENGINE_LOC_INDEX = 0¶
Integrated flowpath key point identified by XSec index.
- openvsp.vsp.ENGINE_LOC_INLET_FACE = 1¶
Integrated flowpath key point is inlet face.
- openvsp.vsp.ENGINE_LOC_INLET_LIP = 0¶
Integrated flowpath key point is inlet lip.
- openvsp.vsp.ENGINE_LOC_NUM = 4¶
Number of integrated flowpath key point locations.
- openvsp.vsp.ENGINE_LOC_OUTLET_FACE = 3¶
Integrated flowpath key point is outlet face.
- openvsp.vsp.ENGINE_LOC_OUTLET_LIP = 2¶
Integrated flowpath key point is outlet lip.
- openvsp.vsp.ENGINE_LOC_U = 1¶
Integrated flowpath key point identified by U parameter.
- openvsp.vsp.ENGINE_MODE_EXTEND = 5¶
Represent integrated flowpath with farfield extensions.
- openvsp.vsp.ENGINE_MODE_FLOWTHROUGH = 0¶
Represent integrated flowpath as flowthrough engine.
- openvsp.vsp.ENGINE_MODE_FLOWTHROUGH_NEG = 1¶
Represent integrated flowpath as flowthrough engine with negative flowpath.
- openvsp.vsp.ENGINE_MODE_NUM_TYPES = 6¶
Number of integrated flowpath representations.
- openvsp.vsp.ENGINE_MODE_TO_FACE = 3¶
Represent integrated flowpath to the face.
- openvsp.vsp.ENGINE_MODE_TO_FACE_NEG = 4¶
Represent integrated flowpath to the face with negative flowpath to the face.
- openvsp.vsp.ENGINE_MODE_TO_LIP = 2¶
Represent integrated flowpath to the lip.
- openvsp.vsp.ETA_TRIM = 2¶
Trim by Eta coordinate
- openvsp.vsp.EXCRESCENCE_CD = 1¶
Drag coefficient excressence type
- openvsp.vsp.EXCRESCENCE_COUNT = 0¶
Drag counts excressence type
- openvsp.vsp.EXCRESCENCE_DRAGAREA = 4¶
Drag area (D/q) excressence type
- openvsp.vsp.EXCRESCENCE_MARGIN = 3¶
Percent margin excressence type
- openvsp.vsp.EXCRESCENCE_PERCENT_GEOM = 2¶
Percent of parent Geom drag coefficient excressence type
- openvsp.vsp.EXPORT_AWAVE = 3¶
AWAVE export type (NOT IMPLEMENTED)
- openvsp.vsp.EXPORT_FELISA = 0¶
FELISA export type (NOT IMPLEMENTED)
- openvsp.vsp.EXPORT_VORXSEC = 8¶
VORXSEC export type (NOT IMPLEMENTED)
- openvsp.vsp.EXPORT_XSECGEOM = 9¶
XSECGEOM export type (NOT IMPLEMENTED)
- openvsp.vsp.EditXSecConvertTo(xsec_id, newtype)¶
Convert the EditCurveXSec curve type to the specified new type. Note, EditCurveXSec uses the same enumerations for PCurve to identify curve type, but APPROX_CEDIT is not supported at this time.
# Add Stack sid = AddGeom( "STACK", "" ) # Get First (and Only) XSec Surf xsec_surf = GetXSecSurf( sid, 0 ) ChangeXSecShape( xsec_surf, 1, XS_EDIT_CURVE ) # Identify XSec 1 xsec_1 = GetXSec( xsec_surf, 1 ) # Set XSec 1 to Linear EditXSecConvertTo( xsec_1, LINEAR )
See also: PCURV_TYPE :param [in]: xsec_id XSec ID :param [in]: newtype New curve type enum (i.e. CEDIT)
- openvsp.vsp.EditXSecDelPnt(xsec_id, indx)¶
Delete an EditCurveXSec control point. Note, cubic Bezier intermediate control points (those not on the curve) cannot be deleted. The previous and next Bezier control point will be deleted along with the point on the curve. Regardless of curve type, the first and last points may not be deleted.
# Add Stack sid = AddGeom( "STACK", "" ) # Get First (and Only) XSec Surf xsec_surf = GetXSecSurf( sid, 0 ) ChangeXSecShape( xsec_surf, 2, XS_EDIT_CURVE ) # Identify XSec 2 xsec_2 = GetXSec( xsec_surf, 2 ) # Turn off R/L symmetry SetParmVal( GetXSecParm( xsec_2, "SymType"), SYM_NONE ) old_pnts = GetEditXSecCtrlVec( xsec_2, True ) # The returned control points will not be scaled by width and height EditXSecDelPnt( xsec_2, 3 ) # Remove control point at bottom of circle new_pnts = GetEditXSecCtrlVec( xsec_2, True ) # The returned control points will not be scaled by width and height if len(old_pnts) - len(new_pnts) != 3 : print( "Error: EditXSecDelPnt")
- Parameters:
[in] – xsec_id XSec ID
[in] – indx Control point index
- openvsp.vsp.EditXSecInitShape(xsec_id)¶
Initialize the EditCurveXSec to the current value of m_ShapeType (i.e. EDIT_XSEC_ELLIPSE)
# Add Stack sid = AddGeom( "STACK", "" ) # Get First (and Only) XSec Surf xsec_surf = GetXSecSurf( sid, 0 ) ChangeXSecShape( xsec_surf, 2, XS_EDIT_CURVE ) # Identify XSec 2 xsec_2 = GetXSec( xsec_surf, 2 ) # Set XSec 2 to linear EditXSecConvertTo( xsec_2, LINEAR ) EditXSecInitShape( xsec_2 ) # Change back to default ellipse
See also: INIT_EDIT_XSEC_TYPE :param [in]: xsec_id XSec ID
- openvsp.vsp.EditXSecSplit01(xsec_id, u)¶
Split the EditCurveXSec at the specified U value
# Add Stack sid = AddGeom( "STACK", "" ) # Get First (and Only) XSec Surf xsec_surf = GetXSecSurf( sid, 0 ) ChangeXSecShape( xsec_surf, 2, XS_EDIT_CURVE ) # Identify XSec 2 xsec_2 = GetXSec( xsec_surf, 2 ) # Turn off R/L symmetry SetParmVal( GetXSecParm( xsec_2, "SymType"), SYM_NONE ) old_pnts = GetEditXSecCtrlVec( xsec_2, True ) # The returned control points will not be scaled by width and height new_pnt_ind = EditXSecSplit01( xsec_2, 0.375 ) new_pnts = GetEditXSecCtrlVec( xsec_2, True ) # The returned control points will not be scaled by width and height if len(new_pnts) - len(old_pnts) != 3 : print( "Error: EditXSecSplit01")
- Parameters:
[in] – xsec_id XSec ID
[in] – u U value to split the curve at (0 - 1)
- Return type:
int
- Returns:
Index of the point added from the split
- openvsp.vsp.EnableStopGUIMenuItem()¶
Enable Stop GUI Menu Item from the OpenVSP GUI.
Typically used for the blocking-mode OpenVSP GUI from the API.
This will add a “Stop GUI” option to the file pulldown menu and will also cause the exit button on the window frame to have the same effect. When selected, these options will stop the OpenVSP GUI event loop, returning control to the API program. OpenVSP will not terminate, the model will remain in memory and will be responsive to subsequent API calls.
EnableStopGUIMenuItem() StartGUI()
See also: DisableStopGUIMenuItem
- class openvsp.vsp.ErrorMgrSingleton(*args, **kwargs)¶
Bases:
object
Proxy of C++ vsp::ErrorMgrSingleton class.
- AddError(ErrorMgrSingleton self, vsp::ERROR_CODE code, string const & desc)¶
- GetErrorLastCallFlag()¶
Check if there was an error on the last call to the API
#==== Force API to silence error messages ====// SilenceErrors() #==== Bogus Call To Create API Error ====// Print( string( "---> Test Error Handling" ) ) SetParmVal( "BogusParmID", 23.0 ) if not GetErrorLastCallFlag() : Print( "---> Error: API GetErrorLastCallFlag " ); } #==== Tell API to print error messages ====// PrintOnErrors()
- Return type:
boolean
- Returns:
False if no error, true otherwise
- GetLastError()¶
Return the most recent error from the stack (does NOT pop error off the stack)
#==== Force API to silence error messages ====// SilenceErrors() Print( "Creating an API error" ) SetParmVal( "ABCDEFG", "Test_Name", "Test_Group", 123.4 ) #==== Check For API Errors ====// ErrorObj err = GetLastError() Print( err.GetErrorString() ) #==== Tell API to print error messages ====// PrintOnErrors()
See also: SilenceErrors, PrintOnErrors; :rtype:
ErrorObj
:return: Error object
- GetNumTotalErrors()¶
Count the total number of errors on the stack
#==== Force API to silence error messages ====// SilenceErrors() Print( "Creating an API error" ) SetParmVal( "ABCDEFG", "Test_Name", "Test_Group", 123.4 ) #==== Check For API Errors ====// while GetNumTotalErrors() > 0 : ErrorObj err = PopLastError() Print( err.GetErrorString() ) #==== Tell API to print error messages ====// PrintOnErrors()
- Return type:
int
- Returns:
Number of errors
- MessageCallback(ErrorMgrSingleton self, MessageBase const * _from, MessageData const & data)¶
- NoError(ErrorMgrSingleton self)¶
- PopErrorAndPrint(ErrorMgrSingleton self, FILE * stream) bool ¶
- PopLastError()¶
Pop (remove) and return the most recent error from the stack. Note, errors are printed on occurrence by default.
#==== Force API to silence error messages ====// SilenceErrors() Print( "Creating an API error" ) SetParmVal( "ABCDEFG", "Test_Name", "Test_Group", 123.4 ) #==== Check For API Errors ====// while GetNumTotalErrors() > 0 : ErrorObj err = PopLastError() Print( err.GetErrorString() ) #==== Tell API to print error messages ====// PrintOnErrors()
- Return type:
- Returns:
Error object
- PrintOnErrors()¶
Cause errors to be printed to stdout as they occur.
#==== Force API to silence error messages ====// SilenceErrors() Print( "Creating an API error" ) SetParmVal( "ABCDEFG", "Test_Name", "Test_Group", 123.4 ) #==== Tell API to print error messages ====// PrintOnErrors()
See also: SilenceErrors
- SilenceErrors()¶
Prevent errors from printing to stdout as they occur.
#==== Force API to silence error messages ====// SilenceErrors() Print( "Creating an API error" ) SetParmVal( "ABCDEFG", "Test_Name", "Test_Group", 123.4 ) #==== Tell API to print error messages ====// PrintOnErrors()
See also: PrintOnErrors
- static getInstance() ErrorMgrSingleton ¶
- property thisown¶
The membership flag
- class openvsp.vsp.ErrorObj(*args)¶
Bases:
object
ErrorObj is defined by an error code enum and associated error string.
- GetErrorCode()¶
Get the ERROR_CODE enum of the last raised error
ErrorObj err = PopLastError() if err.GetErrorCode() != VSP_CANT_FIND_PARM : Print( "---> Error: API PopLast" ); }
See also: ERROR_CODE :rtype: int :return: ERROR_CODE error code enum
- GetErrorString()¶
Get the error string of the last raised error
#==== Check For API Errors ====// while GetNumTotalErrors() > 0 : ErrorObj err = PopLastError() Print( err.GetErrorString() )
- Return type:
string
- Returns:
Error string
- NoError(ErrorObj self)¶
- property m_ErrorCode¶
m_ErrorCode : vsp::ERROR_CODE
- property m_ErrorString¶
m_ErrorString : string
- property thisown¶
The membership flag
- openvsp.vsp.ExecAnalysis(analysis)¶
Execute an analysis through the Analysis Manager
analysis_name = "VSPAEROComputeGeometry" res_id = ExecAnalysis( analysis_name )
- Parameters:
[in] – analysis Analysis name
- Return type:
string
- Returns:
Result ID
- openvsp.vsp.ExportFile(*args)¶
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.
wid = AddGeom( "WING" ) # Add Wing ExportFile( "Airfoil_Metadata.csv", SET_ALL, EXPORT_SELIG_AIRFOIL ) mesh_id = ExportFile( "Example_Mesh.msh", SET_ALL, EXPORT_GMSH ) DeleteGeom( mesh_id ) # Delete the mesh generated by the GMSH export
See also: EXPORT_TYPE :param [in]: file_name Export file name :param [in]: thick_set Set index to export (i.e. SET_ALL) :param [in]: file_type File type enum (i.e. EXPORT_IGES) :param [in]: subsFlag Flag to tag subsurfaces if MeshGeom is created :param [in]: thin_set Set index to export as degenerate geometry (i.e. SET_NONE) :param [in]: useMode bool Flag determine if mode is used instead of sets :param [in]: modeID string ID of Mode to use :rtype: string :return: Mesh Geom ID if the export generates a mesh
- openvsp.vsp.FC_NATIVE = 1¶
Operating system’s native file chooser
- openvsp.vsp.FC_OPENVSP = 0¶
OpenVSP’s own file chooser with directory preferences.
- openvsp.vsp.FEA_BCM_ALL = 1¶
FEA boundary condition constrains all DOF.
- openvsp.vsp.FEA_BCM_ASYMM = 4¶
FEA boundary condition antisymmetrical constraints.
- openvsp.vsp.FEA_BCM_PIN = 2¶
FEA boundary condition pin constraints.
- openvsp.vsp.FEA_BCM_SYMM = 3¶
FEA boundary condition symmetrical constraints.
- openvsp.vsp.FEA_BCM_USER = 0¶
FEA boundary condition constraints user defined.
- openvsp.vsp.FEA_BC_PART = 1¶
FEA boundary condition assigned to part.
- openvsp.vsp.FEA_BC_STRUCTURE = 0¶
FEA boundary condition assigned to structure.
- openvsp.vsp.FEA_BC_SUBSURF = 2¶
FEA boundary condition assigned to subsurface.
- openvsp.vsp.FEA_BEAM = 1¶
Beam FEA element type
- openvsp.vsp.FEA_CALCULIX_FILE_NAME = 3¶
FEA Mesh Calculix export type
- openvsp.vsp.FEA_CURV_FILE_NAME = 7¶
FEA Mesh CURV export type
- openvsp.vsp.FEA_DELETE = 1¶
Delete shell elements
- openvsp.vsp.FEA_DEPRECATED = -1¶
Flag for deprecated element type option
- openvsp.vsp.FEA_DOME = 4¶
Dome FEA Part type
- openvsp.vsp.FEA_ENG_ORTHO = 1¶
Orthotropic material in engineering parameters
- openvsp.vsp.FEA_ENG_ORTHO_TRANS_ISO = 2¶
Orthotropic material with transverse isotropy assumed in engineering parameters
- openvsp.vsp.FEA_FIX_POINT = 3¶
Fixed Point FEA Part type
- openvsp.vsp.FEA_FIX_PT_DELTA_UVN = 3¶
Delta UVN off body fixed point type
- openvsp.vsp.FEA_FIX_PT_DELTA_XYZ = 2¶
Delta XYZ off body fixed point type
- openvsp.vsp.FEA_FIX_PT_GEOM_CG = 5¶
Geom CG off body fixed point type
- openvsp.vsp.FEA_FIX_PT_GEOM_ORIGIN = 4¶
Geom origin off body fixed point type
- openvsp.vsp.FEA_FIX_PT_GLOBAL_XYZ = 1¶
Global XYZ off body fixed point type
- openvsp.vsp.FEA_FIX_PT_ON_BODY = 0¶
On body fixed point type
- openvsp.vsp.FEA_GMSH_FILE_NAME = 5¶
FEA Mesh GMSH export type
- openvsp.vsp.FEA_IGES_FILE_NAME = 9¶
FEA Mesh trimmed IGES export type
- openvsp.vsp.FEA_ISOTROPIC = 0¶
Isotropic material
- openvsp.vsp.FEA_KEEP = 0¶
Keep shell elements
- openvsp.vsp.FEA_LAMINATE = 3¶
Laminate buildup material
- openvsp.vsp.FEA_MASS_FILE_NAME = 0¶
FEA Mesh mass export type
- openvsp.vsp.FEA_NASTRAN_FILE_NAME = 1¶
FEA Mesh NASTRAN export type
- openvsp.vsp.FEA_NKEY_FILE_NAME = 2¶
FEA Mesh NKey export type
- openvsp.vsp.FEA_NO_ELEMENTS = 3¶
FEA part with no elements
- openvsp.vsp.FEA_NUM_BCM_MODES = 5¶
Number of FEA boundary condition constraint types.
- openvsp.vsp.FEA_NUM_BC_TYPES = 3¶
Number of FEA boundary condition definition types.
- openvsp.vsp.FEA_NUM_ELEMENT_TYPES = 4¶
Number of FEA element type choices
- openvsp.vsp.FEA_NUM_FILE_NAMES = 11¶
Number of FEA Mesh export type.
- openvsp.vsp.FEA_NUM_FIX_PT_TYPES = 6¶
Number of off body fixed point types
- openvsp.vsp.FEA_NUM_MAT_TYPES = 4¶
Number of FEA material types
- openvsp.vsp.FEA_NUM_ORIENT_TYPES = 13¶
Number of FEA material orientation types
- openvsp.vsp.FEA_NUM_SHELL_TREATMENT_TYPES = 2¶
Number of FEA subsurface treatment choices
- openvsp.vsp.FEA_NUM_TYPES = 9¶
Number of FEA Part types
- openvsp.vsp.FEA_ORIENT_COMP_X = 3¶
FEA Comp X material orientation
- openvsp.vsp.FEA_ORIENT_COMP_Y = 4¶
FEA Comp Y material orientation
- openvsp.vsp.FEA_ORIENT_COMP_Z = 5¶
FEA Comp Z material orientation
- openvsp.vsp.FEA_ORIENT_GLOBAL_X = 0¶
FEA Global X material orientation
- openvsp.vsp.FEA_ORIENT_GLOBAL_Y = 1¶
FEA Global Y material orientation
- openvsp.vsp.FEA_ORIENT_GLOBAL_Z = 2¶
FEA Global Z material orientation
- openvsp.vsp.FEA_ORIENT_OML_R = 10¶
FEA OML R material orientation
- openvsp.vsp.FEA_ORIENT_OML_S = 11¶
FEA OML S material orientation
- openvsp.vsp.FEA_ORIENT_OML_T = 12¶
FEA OML T material orientation
- openvsp.vsp.FEA_ORIENT_OML_U = 8¶
FEA OML U material orientation
- openvsp.vsp.FEA_ORIENT_OML_V = 9¶
FEA OML V material orientation
- openvsp.vsp.FEA_ORIENT_PART_U = 6¶
FEA Part U material orientation
- openvsp.vsp.FEA_ORIENT_PART_V = 7¶
FEA Part V material orientation
- openvsp.vsp.FEA_PLOT3D_FILE_NAME = 8¶
FEA Mesh PLOT3D export type
- openvsp.vsp.FEA_RIB = 1¶
Rib FEA Part type
- openvsp.vsp.FEA_RIB_ARRAY = 5¶
Rib array FEA Part type
- openvsp.vsp.FEA_SHELL = 0¶
Shell (tris) FEA element type
- openvsp.vsp.FEA_SHELL_AND_BEAM = 2¶
Both Shell and Beam FEA element types
- openvsp.vsp.FEA_SKIN = 7¶
Skin FEA Part type
- openvsp.vsp.FEA_SLICE = 0¶
Slice FEA Part type
- openvsp.vsp.FEA_SLICE_ARRAY = 6¶
Slice array FEA Part type
- openvsp.vsp.FEA_SPAR = 2¶
Spar FEA Part type
- openvsp.vsp.FEA_SRF_FILE_NAME = 6¶
FEA Mesh SRF export type
- openvsp.vsp.FEA_STEP_FILE_NAME = 10¶
FEA Mesh trimmed STEP export type
- openvsp.vsp.FEA_STL_FILE_NAME = 4¶
FEA Mesh STL export type
- openvsp.vsp.FEA_TRIM = 8¶
Trim FEA Part type
- openvsp.vsp.FEA_XSEC_BOX = 5¶
Box XSec type
- openvsp.vsp.FEA_XSEC_CIRC = 1¶
Circle XSec type
- openvsp.vsp.FEA_XSEC_GENERAL = 0¶
General XSec type
- openvsp.vsp.FEA_XSEC_I = 3¶
I XSec type
- openvsp.vsp.FEA_XSEC_PIPE = 2¶
Pipe XSec type
- openvsp.vsp.FEA_XSEC_RECT = 4¶
Rectangle XSec type
- openvsp.vsp.FEMALE = 1¶
Female Human component
- openvsp.vsp.FF_B_COVERT = 6¶
Covert FF equation
- openvsp.vsp.FF_B_HOERNER_STREAMBODY = 3¶
Hoerner Streamlined Body FF equation
- openvsp.vsp.FF_B_JENKINSON_AFT_FUSE_NACELLE = 9¶
Jenkinson Aft Fuselage Nacelle FF equation
- openvsp.vsp.FF_B_JENKINSON_FUSE = 7¶
Jenkinson Fuselage FF equation
- openvsp.vsp.FF_B_JENKINSON_WING_NACELLE = 8¶
Jenkinson Wing Nacelle FF equation
- openvsp.vsp.FF_B_MANUAL = 0¶
Manual FF equation
- openvsp.vsp.FF_B_SCHEMENSKY_FUSE = 1¶
Schemensky Fuselage FF equation
- openvsp.vsp.FF_B_SCHEMENSKY_NACELLE = 2¶
Schemensky Nacelle FF equation
- openvsp.vsp.FF_B_SHEVELL = 5¶
Shevell FF equation
- openvsp.vsp.FF_B_TORENBEEK = 4¶
Torenbeek FF equation
- openvsp.vsp.FF_W_COVERT = 4¶
Covert FF equation
- openvsp.vsp.FF_W_DATCOM = 8¶
DATCOM FF equation
- openvsp.vsp.FF_W_EDET_ADV = 2¶
EDET Advanced Airfoil FF equation
- openvsp.vsp.FF_W_EDET_CONV = 1¶
EDET Conventional Airfoil FF equation
- openvsp.vsp.FF_W_HOERNER = 3¶
Hoerner FF equation
- openvsp.vsp.FF_W_JENKINSON_TAIL = 12¶
Jenkinson Tail FF equation
- openvsp.vsp.FF_W_JENKINSON_WING = 11¶
Jenkinson Wing FF equation
- openvsp.vsp.FF_W_KROO = 6¶
Kroo FF equation
- openvsp.vsp.FF_W_MANUAL = 0¶
Manual FF equation
- openvsp.vsp.FF_W_SCHEMENSKY_4_SERIES_AF = 10¶
Schemensky 4 Series Airfoil FF equation
- openvsp.vsp.FF_W_SCHEMENSKY_6_SERIES_AF = 9¶
Schemensky 6 Series Airfoil FF equation
- openvsp.vsp.FF_W_SCHEMENSKY_SUPERCRITICAL_AF = 13¶
Schemensky Supercritical Airfoil FF equation
- openvsp.vsp.FF_W_SHEVELL = 5¶
Shevell FF equation
- openvsp.vsp.FF_W_TORENBEEK = 7¶
Torenbeek FF equation
- openvsp.vsp.FLAT_END_CAP = 1¶
Flat end cap
- openvsp.vsp.FUSELAGE_GEOM_SCREEN = 1¶
Fuselage geom screen
- openvsp.vsp.FindActuatorDisk(disk_index)¶
Get the ID of a VSPAERO actuator disk at the specified index. An empty string is returned if the index is out of range.
# Add a propeller prop_id = AddGeom( "PROP", "" ) SetParmVal( prop_id, "PropMode", "Design", PROP_DISK ) SetParmVal( prop_id, "Diameter", "Design", 6.0 ) Update() # Setup the actuator disk VSPAERO parms disk_id = FindActuatorDisk( 0 ) SetParmVal( FindParm( disk_id, "RotorRPM", "Rotor" ), 1234.0 ) SetParmVal( FindParm( disk_id, "RotorCT", "Rotor" ), 0.35 ) SetParmVal( FindParm( disk_id, "RotorCP", "Rotor" ), 0.55 ) SetParmVal( FindParm( disk_id, "RotorHubDiameter", "Rotor" ), 1.0 )
See also: PROP_MODE :param [in]: disk_index Actuator disk index for the current VSPAERO set :rtype: string :return: Actuator disk ID
- openvsp.vsp.FindAllAttributes()¶
Returns a vector of string IDs for all Attributes in the vehicle
Attribute_IDs = vsp.FindAllAttributes(); for Attribute_ID in Attribute_IDs: print( Attribute_ID ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
vector< string >
- Returns:
Vector of All Attribute IDs
- openvsp.vsp.FindAttributeByName(search_str, index)¶
Searches all attributes that contain the search string, case insensitive, and returns the user-specified index
First_Searched_Attribute_ID = vsp.FindAttributeByName( "Watermark", 0 ) print( First_Searched_Attribute_ID ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
string
- Returns:
Returns a StringID of the attribute indexed/searched by user, if found
- Parameters:
[in] – search_str string for filtering attributes in model
[in] – index int for indexing which of the vector of found attributes to select
- openvsp.vsp.FindAttributeInCollection(obj_id, search_str, index)¶
Searches all attributes in an OpenVSP object or AttributeCollection that contain the search string, case insensitive, and returns the user-specified index. Works either with the ID of an object that contains an attributeCollection or just the ID of an attributeCollection.
VehID = vsp.GetVehicleID() Attribute_ID = vsp.FindAttributeInCollection( VehID, 'Watermark', 0 ) print( Attribute_ID ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
string
- Returns:
Returns a StringID of the attribute indexed/searched by user, if found
- Parameters:
[in] – obj_id id of object to search within for attributes
[in] – search_str string for filtering attributes in object
[in] – index int for indexing which of the vector of found attributes to select
- openvsp.vsp.FindAttributeNamesInCollection(collID)¶
Return a list of all attribute Names within an attribute collection
# Example code to list all attributes in vehicle attach_ids = vsp.FindAttributedObjects(); for id in attach_ids: coll_id = vsp.GetChildCollection(id) attach_name = vsp.GetObjectName(id) # FindAttributeNamesInCollection used here, to search through the Names in a single collection! attr_names = vsp.FindAttributeNamesInCollection(coll_id) attr_ids = vsp.FindAttributesInCollection(coll_id) print(f'\nAttribute Collection Name : {attach_name}\n') for aname, aid in zip(attr_names, attr_ids): atype = vsp.GetAttributeType( aid ) atypename = vsp.GetAttributeTypeName( aid ) #IMPORTANT: need to get ParentID twice to get to the VSP object. 1st will only get the ID of the Attribute Collection. #once at the OpenVSP object level, parent IDs are trivial. attribute_collection_id = vsp.GetObjectParent( coll_id ) #parent of an attribute is an Attribute Collection object attribute_collection_parent_id = vsp.GetObjectParent( attribute_collection_id ) #then get that Collection object's parent ID to get the OpenVSP object that contains it! # Structure: # OpenVSP object -> Attribute Collection -> Attributes # e.g. Geom->Parm->Attribute Collection -> Attributes # aid = vsp.GetAttributeID( coll_id, aname, 0 ) #get the ID of this attribute for self-awareness aname_same = vsp.GetObjectName( aid ) # get attributeAttachName of the attributes'ID will get you the same attribute name again if atype == vsp.BOOL_DATA: data = vsp.GetAttributeBoolVal( aid ) elif atype == vsp.INT_DATA: data = vsp.GetAttributeIntVal( aid ) elif atype == vsp.DOUBLE_DATA: data = vsp.GetAttributeDoubleVal( aid ) elif atype == vsp.STRING_DATA: data = vsp.GetAttributeStringVal( aid ) elif atype == vsp.DOUBLE_MATRIX_DATA: data = vsp.GetAttributeDoubleMatrixVal( aid ) elif atype == vsp.INT_MATRIX_DATA: data = vsp.GetAttributeIntMatrixVal( aid ) elif atype == vsp.ATTR_COLLECTION_DATA: data = '[Attribute Group]' else: data = '[no data extracted]' doc = vsp.GetAttributeDoc( aid ) attribute_report = f' Attribute Name : {aname}\n Attribute Type : {atypename}\n Attribute Data : {data}\n Attribute Desc : {doc}' print( attribute_report ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
vector< string >
- Returns:
Array of result names
- Parameters:
[in] – collID string ID of an attribute collection
- openvsp.vsp.FindAttributedObjects()¶
Get array of IDs of all OpenVSP entities that have populated attributeCollections Includes attributeGroups
# Example code to list all attributes in vehicle attach_ids = vsp.FindAttributedObjects(); for id in attach_ids: coll_id = vsp.GetChildCollection(id) attach_name = vsp.GetObjectName(id) attr_names = vsp.FindAttributeNamesInCollection(coll_id) attr_ids = vsp.FindAttributesInCollection(coll_id) print(f'\nAttribute Collection Name : {attach_name}\n') for aname, aid in zip(attr_names, attr_ids): atype = vsp.GetAttributeType( aid ) atypename = vsp.GetAttributeTypeName( aid ) #IMPORTANT: need to get ParentID twice to get to the VSP object. 1st will only get the ID of the Attribute Collection. #once at the OpenVSP object level, parent IDs are trivial. attribute_collection_id = vsp.GetObjectParent( coll_id ) #parent of an attribute is an Attribute Collection object attribute_collection_parent_id = vsp.GetObjectParent( attribute_collection_id ) #then get that Collection object's parent ID to get the OpenVSP object that contains it! # Structure: # OpenVSP object -> Attribute Collection -> Attributes # e.g. Geom->Parm->Attribute Collection -> Attributes # aid = vsp.GetAttributeID( coll_id, aname, 0 ) #get the ID of this attribute for self-awareness aname_same = vsp.GetObjectName( aid ) # get attributeAttachName of the attributes'ID will get you the same attribute name again if atype == vsp.BOOL_DATA: data = vsp.GetAttributeBoolVal( aid ) elif atype == vsp.INT_DATA: data = vsp.GetAttributeIntVal( aid ) elif atype == vsp.DOUBLE_DATA: data = vsp.GetAttributeDoubleVal( aid ) elif atype == vsp.STRING_DATA: data = vsp.GetAttributeStringVal( aid ) elif atype == vsp.DOUBLE_MATRIX_DATA: data = vsp.GetAttributeDoubleMatrixVal( aid ) elif atype == vsp.INT_MATRIX_DATA: data = vsp.GetAttributeIntMatrixVal( aid ) elif atype == vsp.ATTR_COLLECTION_DATA: data = '[Attribute Group]' else: data = '[no data extracted]' doc = vsp.GetAttributeDoc( aid ) attribute_report = f' Attribute Name : {aname}\n Attribute Type : {atypename}\n Attribute Data : {data}\n Attribute Desc : {doc}' print( attribute_report ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
vector< string >
- Returns:
Array of IDs of entities in OpenVSP that contain populated attribute collections
- openvsp.vsp.FindAttributesByName(search_str)¶
Returns all attributes that contain the string search_str within their name, case insensitive
Searched_Attribute_IDs = vsp.FindAttributesByName( "Watermark" ) for Attribute_ID in Searched_Attribute_IDs: print( Attribute_ID ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
vector< string >
- Returns:
Vector of string IDs of matching Attributes
- Parameters:
[in] – search_str string for filtering attributes in model
- openvsp.vsp.FindAttributesInCollection(collID)¶
Get all attribute IDs within a single AttributeCollection, referenced by collID
# Example code to list all attributes in vehicle attach_ids = vsp.FindAttributedObjects(); for id in attach_ids: coll_id = vsp.GetChildCollection(id) attach_name = vsp.GetObjectName(id) attr_names = vsp.FindAttributeNamesInCollection(coll_id) # FindAttributesInCollection used here, to search through the IDs in a single collection! attr_ids = vsp.FindAttributesInCollection(coll_id) print(f'\nAttribute Collection Name : {attach_name}\n') for aname, aid in zip(attr_names, attr_ids): atype = vsp.GetAttributeType( aid ) atypename = vsp.GetAttributeTypeName( aid ) #IMPORTANT: need to get ParentID twice to get to the VSP object. 1st will only get the ID of the Attribute Collection. #once at the OpenVSP object level, parent IDs are trivial. attribute_collection_id = vsp.GetObjectParent( coll_id ) #parent of an attribute is an Attribute Collection object attribute_collection_parent_id = vsp.GetObjectParent( attribute_collection_id ) #then get that Collection object's parent ID to get the OpenVSP object that contains it! # Structure: # OpenVSP object -> Attribute Collection -> Attributes # e.g. Geom->Parm->Attribute Collection -> Attributes # aid = vsp.GetAttributeID( coll_id, aname, 0 ) #get the ID of this attribute for self-awareness aname_same = vsp.GetObjectName( aid ) # get attributeAttachName of the attributes'ID will get you the same attribute name again if atype == vsp.BOOL_DATA: data = vsp.GetAttributeBoolVal( aid ) elif atype == vsp.INT_DATA: data = vsp.GetAttributeIntVal( aid ) elif atype == vsp.DOUBLE_DATA: data = vsp.GetAttributeDoubleVal( aid ) elif atype == vsp.STRING_DATA: data = vsp.GetAttributeStringVal( aid ) elif atype == vsp.DOUBLE_MATRIX_DATA: data = vsp.GetAttributeDoubleMatrixVal( aid ) elif atype == vsp.INT_MATRIX_DATA: data = vsp.GetAttributeIntMatrixVal( aid ) elif atype == vsp.ATTR_COLLECTION_DATA: data = '[Attribute Group]' else: data = '[no data extracted]' doc = vsp.GetAttributeDoc( aid ) attribute_report = f' Attribute Name : {aname}\n Attribute Type : {atypename}\n Attribute Data : {data}\n Attribute Desc : {doc}' print( attribute_report ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
vector< string >
- Returns:
Vector of attribute IDs in an attribute collection.
- Parameters:
[in] – collID string ID of an attribute collection
- openvsp.vsp.FindContainer(name, index)¶
Get the ID of a Parm Container with specified name at input index
#===== Get Vehicle Parm Container ID ====// veh_id = FindContainer( "Vehicle", 0 )
See also: FindContainersWithName :param [in]: name Parm Container name :param [in]: index Parm Container index :rtype: string :return: Parm Container ID
- openvsp.vsp.FindContainerGroupNames(parm_container_id)¶
Get an array of Parm group names included in the specified Container
user_ctr = FindContainer( "UserParms", 0 ) grp_arr = FindContainerGroupNames( user_ctr ) print( "---> UserParms Container Group IDs: " ) for i in range(int( len(grp_arr) )): message = "\t" + grp_arr[i] + "\n" print( message )
- Parameters:
[in] – parm_container_id Parm Container ID
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of Parm group names
- openvsp.vsp.FindContainerParmIDs(parm_container_id)¶
Get an array of Parm IDs included in the specified Container
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Get Structure Name and Parm Container ID ====// parm_container_name = GetFeaStructName( pod_id, struct_ind ) parm_container_id = FindContainer( parm_container_name, struct_ind ) #==== Get and List All Parms in the Container ====// parm_ids = FindContainerParmIDs( parm_container_id ) for i in range(len(parm_ids)): name_id = GetParmName( parm_ids[i] ) + ": " + parm_ids[i] + "\n" print( name_id )
- Parameters:
[in] – parm_container_id Parm Container ID
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of Parm IDs
- openvsp.vsp.FindContainers()¶
Get an array of all Parm Container IDs
ctr_arr = FindContainers() print( "---> API Parm Container IDs: " ) for i in range(int( len(ctr_arr) )): message = "\t" + ctr_arr[i] + "\n" print( message )
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of Parm Container IDs
- openvsp.vsp.FindContainersWithName(name)¶
Get an array of Parm Container IDs for Containers with the specified name
ctr_arr = FindContainersWithName( "UserParms" ) if len(ctr_arr) > 0 : print( ( "UserParms Parm Container ID: " + ctr_arr[0] ) )
- Parameters:
[in] – name Parm Container name
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of Parm Container IDs
- openvsp.vsp.FindGeom(name, index)¶
Find and return the Geom ID with the specified name at given index. Equivalent to FindGeomsWithName( name )[index].
#==== Add Pod Geometry ====// pid = AddGeom( "POD", "" ) SetGeomName( pid, "ExamplePodName" ) geom_id = FindGeom( "ExamplePodName", 0 ) geom_ids = FindGeomsWithName( "ExamplePodName" ) if geom_ids[0] != geom_id : print( "---> Error: API FindGeom & FindGeomsWithName" )
See also: FindGeomsWithName :param [in]: name Geom name :param [in]: index :rtype: string :return: Geom ID with name at specified index
- openvsp.vsp.FindGeoms()¶
Find and return all Geom IDs in the model
#==== Add Pod Geometries ====// pod1 = AddGeom( "POD", "" ) pod2 = AddGeom( "POD", "" ) #==== There Should Be Two Geoms =====// geom_ids = FindGeoms() if len(geom_ids) != 2 : print( "---> Error: API FindGeoms " )
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of all Geom IDs
- openvsp.vsp.FindGeomsWithName(name)¶
Find and return all Geom IDs with the specified name
#==== Add Pod Geometry ====// pid = AddGeom( "POD", "" ) SetGeomName( pid, "ExamplePodName" ) geom_ids = FindGeomsWithName( "ExamplePodName" ) if len(geom_ids) != 1 : print( "---> Error: API FindGeomsWithName " )
See also: FindGeom :param [in]: name Geom name :rtype: std::vector< std::string,std::allocator< std::string > > :return: Array of Geom IDs
- openvsp.vsp.FindLatestResultsID(name)¶
Find the latest results ID for particular result name
#==== Write Some Fake Test Results =====// WriteTestResults() results_array = GetAllResultsNames() for i in range(int( len(results_array) )): resid = FindLatestResultsID( results_array[i] ) PrintResults( resid )
- Parameters:
[in] – name Result name
- Return type:
string
- Returns:
Result ID
- openvsp.vsp.FindParm(parm_container_id, parm_name, group_name)¶
Find a Parm ID given the Parm Container ID, Parm name, and Parm group
#==== Add Wing Geometry ====// wing_id = AddGeom( "WING" ) #==== Turn Symmetry OFF ====// sym_id = FindParm( wing_id, "Sym_Planar_Flag", "Sym") SetParmVal( sym_id, 0.0 ) # Note: bool input not supported in SetParmVal
- Parameters:
[in] – parm_container_id Parm Container ID
[in] – parm_name Parm name
[in] – group_name Parm group name
- Return type:
string
- Returns:
Parm ID
- openvsp.vsp.FindRST(geom_id, surf_indx, pt)¶
Determine the nearest (R, S, T) volume coordinate for an input (X, Y, Z) 3D coordinate point and calculate the distance between the 3D point and the found volume point.
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 r = 0.12 s = 0.68 t = 0.56 pnt = CompPntRST( geom_id, surf_indx, r, s, t ) d, rout, sout, tout = FindRST( geom_id, surf_indx, pnt ) print( f"Dist {d} r {rout} s {sout} t {tout}" )
See also: FindRSTGuess :param [in]: geom_id string Parent Geom ID :param [in]: surf_indx int Main surface index from the parent Geom :param [in]: pt vec3d Input 3D coordinate point :param [out]: r_out double Output closest R (0 - 1.0) volume coordinate :param [out]: s_out double Output closest S (0 - 1.0) volume coordinate :param [out]: t_out double Output closest T (0 - 1.0) volume coordinate :rtype: float :return: double Distance between the 3D point and the closest point of the volume
- openvsp.vsp.FindRSTGuess(geom_id, surf_indx, pt, r0, s0, t0)¶
Determine the nearest (R, S, T) volume coordinate for an input (X, Y, Z) 3D coordinate point given an initial guess of volume coordinates. Also calculate the distance between the 3D point and the found volume point.
# Add Pod Geom geom_id = AddGeom( "POD", "" ) surf_indx = 0 r = 0.12 s = 0.68 t = 0.56 pnt = CompPntRST( geom_id, surf_indx, r, s, t ) r0 = 0.1 s0 = 0.6 t0 = 0.5 d, rout, sout, tout = FindRSTGuess( geom_id, surf_indx, pnt, r0, s0, t0 ) print( f"Dist {d} r {rout} s {sout} t {tout}" )
See also: FindRST :param [in]: geom_id string Parent Geom ID :param [in]: surf_indx int Main surface index from the parent Geom :param [in]: pt vec3d Input 3D coordinate point :param [in]: r0 double Input R (0 - 1.0) volume coordinate guess :param [in]: s0 double Input S (0 - 1.0) volume coordinate guess :param [in]: t0 double Input T (0 - 1.0) volume coordinate guess :param [out]: r_out double Output closest R (0 - 1.0) volume coordinate :param [out]: s_out double Output closest S (0 - 1.0) volume coordinate :param [out]: t_out double Output closest T (0 - 1.0) volume coordinate :rtype: float :return: double Distance between the 3D point and the closest point of the volume
- openvsp.vsp.FindRSTVec(geom_id, surf_indx, pts)¶
Determine the nearest volume coordinates for an input array of 3D coordinate points and calculate the distance between each 3D point and the found point in the volume.
# Add Pod Geom geom_id = AddGeom( "POD", "" ) n = 5 rvec = [0]*n svec = [0]*n tvec = [0]*n for i in range(n): rvec[i] = (i+1)*1.0/(n+1) svec[i] = (n-i)*1.0/(n+1) tvec[i] = (i+1)*1.0/(n+1) ptvec = CompVecPntRST( geom_id, 0, rvec, svec, tvec ) routv, soutv, toutv, doutv = FindRSTVec( geom_id, 0, ptvec )
See also: FindRSTVecGuess :param [in]: geom_id string Parent Geom ID :param [in]: surf_indx int Main surface index from the parent Geom :param [in]: pts vector<vec3d> Input vector of 3D coordinate points :param [out]: r_out_vec vector<double> Output vector of the closest R (0 - 1.0) volume coordinate for each 3D input point :param [out]: s_out_vec vector<double> Output vector of the closest S (0 - 1.0) volume coordinate for each 3D input point :param [out]: t_out_vec vector<double> Output vector of the closest T (0 - 1.0) volume coordinate for each 3D input point :param [out]: d_out_vec vector<double> Output vector of distances for each 3D point and the closest point of the volume
- openvsp.vsp.FindRSTVecGuess(geom_id, surf_indx, pts, r0s, s0s, t0s)¶
Determine the nearest volume coordinates for an input array of 3D coordinate points and calculate the distance between each 3D point and the closest point of the volume. This function takes an input array of volume coordinate guesses for each 3D coordinate, offering a potential decrease in computation time compared to FindRSTVec.
# Add Pod Geom geom_id = AddGeom( "POD", "" ) n = 5 rvec = [0]*n svec = [0]*n tvec = [0]*n for i in range(n): rvec[i] = (i+1)*1.0/(n+1) svec[i] = (n-i)*1.0/(n+1) tvec[i] = (i+1)*1.0/(n+1) ptvec = CompVecPntRST( geom_id, 0, rvec, svec, tvec ) for i in range(n): ptvec[i].set_xyz(ptvec[i].x() * 0.9, ptvec[i].y() * 0.9, ptvec[i].z() * 0.9) routv, soutv, toutv, doutv = FindRSTVecGuess( geom_id, 0, ptvec, rvec, svec, tvec )
See also: FindRSTVec, :param [in]: geom_id string Parent Geom ID :param [in]: surf_indx int Main surface index from the parent Geom :param [in]: pts vector<vec3d> Input vector of 3D coordinate points :param [in]: r0s vector<double> Input vector of U (0 - 1.0) volume coordinate guesses :param [in]: s0s vector<double> Input vector of S (0 - 1.0) volume coordinate guesses :param [in]: t0s vector<double> Input vector of T (0 - 1.0) volume coordinate guesses :param [out]: r_out_vec vector<double> Output vector of the closest R (0 - 1.0) volume coordinate for each 3D input point :param [out]: s_out_vec vector<double> Output vector of the closest S (0 - 1.0) volume coordinate for each 3D input point :param [out]: t_out_vec vector<double> Output vector of the closest T (0 - 1.0) volume coordinate for each 3D input point :param [out]: d_out_vec vector<double> Output vector of distances for each 3D point and the closest point of the volume
- openvsp.vsp.FindResultsID(name, index=0)¶
Find a results ID given its name and index
#==== Write Some Fake Test Results =====// WriteTestResults() res_id = FindResultsID( "Test_Results" ) if len(res_id) == 0 : print( "---> Error: API FindResultsID" )
- Parameters:
[in] – name Result name
[in] – index Result index
- Return type:
string
- Returns:
Result ID
- openvsp.vsp.FindUnsteadyGroup(group_index)¶
Get the ID of the VSPAERO unsteady group at the specified index. An empty string is returned if the index is out of range.
wing_id = AddGeom( "WING" ) pod_id = AddGeom( "POD" ) # Create an actuator disk prop_id = AddGeom( "PROP", "" ) SetParmVal( prop_id, "PropMode", "Design", PROP_BLADES ) Update() # Setup the unsteady group VSPAERO parms disk_id = FindUnsteadyGroup( 1 ) # fixed components are in group 0 (wing & pod) SetParmVal( FindParm( disk_id, "RPM", "UnsteadyGroup" ), 1234.0 )
See also: PROP_MODE :param [in]: group_index Unsteady group index for the current VSPAERO set :rtype: string :return: Unsteady group ID
- openvsp.vsp.FitAfCST(xsec_surf_id, xsec_index, deg)¶
Fit a CST airfoil for an existing airfoil of type XS_FOUR_SERIES, XS_SIX_SERIES, XS_FOUR_DIGIT_MOD, XS_FIVE_DIGIT, XS_FIVE_DIGIT_MOD, XS_ONE_SIX_SERIES, or XS_FILE_AIRFOIL. :param [in]: xsec_surf_id XsecSurf ID :param [in]: xsec_index XSec index :param [in]: deg CST degree
- openvsp.vsp.FitAllViews()¶
Fit contents to all viewports
FitAllViews()
- openvsp.vsp.FitBORAfCST(bor_id, deg)¶
Fit a CST airfoil for an existing airfoil of a BOR of type XS_FOUR_SERIES, XS_SIX_SERIES, XS_FOUR_DIGIT_MOD, XS_FIVE_DIGIT, XS_FIVE_DIGIT_MOD, XS_ONE_SIX_SERIES, or XS_FILE_AIRFOIL. :param [in]: bor_id string Body of revolution Geom ID :param [in]: deg int CST degree
- openvsp.vsp.GDEV_ADD_CHOICE_ITEM = 17¶
Add item to custom GUI Choice
- openvsp.vsp.GDEV_BEGIN_SAME_LINE = 27¶
Set begin same line flag for custom GUI
- openvsp.vsp.GDEV_CHECK_BUTTON = 8¶
Custom GUI CheckButton
- openvsp.vsp.GDEV_CHECK_BUTTON_BIT = 9¶
Custom GUI CheckButtonBit
- openvsp.vsp.GDEV_CHOICE = 16¶
Custom GUI Choice
- openvsp.vsp.GDEV_COLOR_PICKER = 24¶
Custom GUI ColorPicker
- openvsp.vsp.GDEV_COUNTER = 15¶
Custom GUI Counter
- openvsp.vsp.GDEV_DIVIDER_BOX = 26¶
Custom GUI divider box
- openvsp.vsp.GDEV_END_SAME_LINE = 28¶
Set end same line flag for custom GUI
- openvsp.vsp.GDEV_FORCE_WIDTH = 29¶
Set forced width for custom GUI
- openvsp.vsp.GDEV_FRACT_PARM_SLIDER = 21¶
Custom GUI FractParmSlider
- openvsp.vsp.GDEV_GROUP = 2¶
Custom GUI Group
- openvsp.vsp.GDEV_INDEX_SELECTOR = 23¶
Custom GUI IndexSelector
- openvsp.vsp.GDEV_INPUT = 4¶
Custom GUI Input
- openvsp.vsp.GDEV_OUTPUT = 5¶
Custom GUI Output
- openvsp.vsp.GDEV_PARM_BUTTON = 3¶
Custom GUI ParmButton
- openvsp.vsp.GDEV_RADIO_BUTTON = 10¶
Custom GUI RadioButton
- openvsp.vsp.GDEV_SCROLL_TAB = 1¶
Custom GUI Fl_Scroll and Tab
- openvsp.vsp.GDEV_SET_FORMAT = 30¶
Set format label for custom GUI
- openvsp.vsp.GDEV_SLIDER = 6¶
Custom GUI Slider
- openvsp.vsp.GDEV_SLIDER_ADJ_RANGE = 7¶
Custom GUI SliderAdjRangeInput
- openvsp.vsp.GDEV_SLIDER_ADJ_RANGE_INPUT = 19¶
Custom GUI SliderAdjRangeInput
- openvsp.vsp.GDEV_SLIDER_ADJ_RANGE_TWO_INPUT = 20¶
Custom GUI SliderAdjRangeInput with two inputs (NOT IMPLEMENTED)
- openvsp.vsp.GDEV_SLIDER_INPUT = 18¶
Custom GUI SliderInput
- openvsp.vsp.GDEV_STRING_INPUT = 22¶
Custom GUI StringInput
- openvsp.vsp.GDEV_TAB = 0¶
Custom GUI Tab
- openvsp.vsp.GDEV_TOGGLE_BUTTON = 11¶
Custom GUI ToggleButton
- openvsp.vsp.GDEV_TOGGLE_BUTTON_FREE = 12¶
Custom GUI ToggleButton without Parm
- openvsp.vsp.GDEV_TOGGLE_RADIO_GROUP = 13¶
Custom GUI ToggleRadioGroup (NOT IMPLEMENTED)
- openvsp.vsp.GDEV_TRIGGER_BUTTON = 14¶
Custom GUI TriggerButton
- openvsp.vsp.GDEV_YGAP = 25¶
Custom GUI Y gap
- openvsp.vsp.GEOM_BOUNDARY = 2¶
Geom boundary
- openvsp.vsp.GEOM_DRAW_HIDDEN = 1¶
Draw the hidden mesh
- openvsp.vsp.GEOM_DRAW_NONE = 4¶
Do not draw anything
- openvsp.vsp.GEOM_DRAW_SHADE = 2¶
Draw the shaded mesh
- openvsp.vsp.GEOM_DRAW_TEXTURE = 3¶
Draw the textured mesh
- openvsp.vsp.GEOM_DRAW_WIRE = 0¶
Draw the wireframe mesh (see through)
- openvsp.vsp.GEOM_PROJ = 3¶
Project toward a Geom
- openvsp.vsp.GEOM_TARGET = 1¶
Geom target type
- openvsp.vsp.GEOM_XSECS = 2¶
GeomXSec Geom type
- openvsp.vsp.GROW_LIMIT_CURV_GAP = 10¶
Maximum growth limit from maximum gap.
- openvsp.vsp.GROW_LIMIT_CURV_NCIRCSEG = 11¶
Maximum growth limit from number of segments to define a circle.
- openvsp.vsp.GROW_LIMIT_INCREMENT = 8¶
Reason increment when adding growth limit constraint.
- openvsp.vsp.GROW_LIMIT_MAX_LEN_CONSTRAINT = 9¶
Maximum growth limit from maximum edge length (not used, growth limited small to large).
- openvsp.vsp.GROW_LIMIT_MIN_LEN_CONSTRAINT = 13¶
Maximum growth limit from minimum length constraint.
- openvsp.vsp.GROW_LIMIT_MIN_LEN_CONSTRAINT_CURV_GAP = 14¶
Maximum growth limit from maximum gap constrained by minimum length.
- openvsp.vsp.GROW_LIMIT_MIN_LEN_CONSTRAINT_CURV_NCIRCSEG = 15¶
Maximum growth limit from number of segments to define a circle constrained by minimum length.
- openvsp.vsp.GROW_LIMIT_MIN_LEN_CONSTRAINT_SOURCES = 16¶
Maximum growth limit from sources constrained by minimum length.
- openvsp.vsp.GROW_LIMIT_SOURCES = 12¶
Maximum growth limit from mesh sources.
- openvsp.vsp.GetActiveCSNameVec(CSGroupIndex)¶
Get the names of each active (used) control surface in the control surface group at the specified index
wid = AddGeom( "WING", "" ) # Add Wing aileron_id = AddSubSurf( wid, SS_CONTROL ) # Add Control Surface Sub-Surface group_index = CreateVSPAEROControlSurfaceGroup() # Empty control surface group AddAllToVSPAEROControlSurfaceGroup( group_index ) cs_name_vec = GetActiveCSNameVec( group_index ) print( "Active CS in Group Index #", False ) print( group_index ) for i in range(int( len(cs_name_vec) )): print( cs_name_vec[i] )
- Parameters:
[in] – CSGroupIndex Index of the control surface group
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of active control surface names
- openvsp.vsp.GetAdvLinkCode(index)¶
Get the code from an advanced link
pod = AddGeom( "POD", "" ) length = FindParm( pod, "Length", "Design" ) x_pos = GetParm( pod, "X_Rel_Location", "XForm" ) AddAdvLink( "ExampleLink" ) indx = GetLinkIndex( "ExampleLink" ) AddAdvLinkInput( indx, length, "len" ) AddAdvLinkOutput( indx, x_pos, "x" ) SetAdvLinkCode( indx, "x = 10.0 - len;" ) BuildAdvLinkScript( indx ) code = GetAdvLinkCode( indx ) print( code )
- Parameters:
[in] – index int Index for advanced link
- Return type:
string
- Returns:
String containing advanced link code
- openvsp.vsp.GetAdvLinkInputNames(index)¶
Get the name of all the inputs to a specified advanced link index
pod = AddGeom( "POD", "" ) length = FindParm( pod, "Length", "Design" ) x_pos = GetParm( pod, "X_Rel_Location", "XForm" ) AddAdvLink( "ExampleLink" ) indx = GetLinkIndex( "ExampleLink" ) AddAdvLinkInput( indx, length, "len" ) AddAdvLinkOutput( indx, x_pos, "x" ) SetAdvLinkCode( indx, "x = 10.0 - len;" ) BuildAdvLinkScript( indx ) name_array = GetAdvLinkInputNames( indx ) for n in range(len(name_array) ): print( name_array[n] )
- Parameters:
[in] – index int Advanced link index
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of advanced link input names
- openvsp.vsp.GetAdvLinkInputParms(index)¶
Get the Parm IDs of all the inputs to a specified advanced link index
pod = AddGeom( "POD", "" ) length = FindParm( pod, "Length", "Design" ) x_pos = GetParm( pod, "X_Rel_Location", "XForm" ) AddAdvLink( "ExampleLink" ) indx = GetLinkIndex( "ExampleLink" ) AddAdvLinkInput( indx, length, "len" ) AddAdvLinkOutput( indx, x_pos, "x" ) SetAdvLinkCode( indx, "x = 10.0 - len;" ) BuildAdvLinkScript( indx ) parm_array = GetAdvLinkInputParms( indx ) for n in range( len(parm_array) ): print( parm_array[n] )
- Parameters:
[in] – index int Advanced link index
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of advanced link input Parm IDs
- openvsp.vsp.GetAdvLinkNames()¶
Get an array of all advanced link names
link_array = GetAdvLinkNames() for n in range(len(link_array) ): print( link_array[n] )
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of advanced link names
- openvsp.vsp.GetAdvLinkOutputNames(index)¶
Get the Parm IDs of all the outputs to a specified advanced link index
pod = AddGeom( "POD", "" ) length = FindParm( pod, "Length", "Design" ) x_pos = GetParm( pod, "X_Rel_Location", "XForm" ) AddAdvLink( "ExampleLink" ) indx = GetLinkIndex( "ExampleLink" ) AddAdvLinkInput( indx, length, "len" ) AddAdvLinkOutput( indx, x_pos, "x" ) SetAdvLinkCode( indx, "x = 10.0 - len;" ) BuildAdvLinkScript( indx ) name_array = GetAdvLinkOutputNames( indx ) for n in range( len(name_array) ): print( name_array[n] )
- Parameters:
[in] – index int Advanced link index
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of advanced link output names
- openvsp.vsp.GetAdvLinkOutputParms(index)¶
Get the Parm IDs of all the outputs to a specified advanced link index
pod = AddGeom( "POD", "" ) length = FindParm( pod, "Length", "Design" ) x_pos = GetParm( pod, "X_Rel_Location", "XForm" ) AddAdvLink( "ExampleLink" ) indx = GetLinkIndex( "ExampleLink" ) AddAdvLinkInput( indx, length, "len" ) AddAdvLinkOutput( indx, x_pos, "x" ) SetAdvLinkCode( indx, "x = 10.0 - len;" ) BuildAdvLinkScript( indx ) parm_array = GetAdvLinkOutputParms( indx ) for n in range( len(parm_array) ): print( parm_array[n] )
- Parameters:
[in] – index int Advanced link index
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of advanced link output Parm IDs
- openvsp.vsp.GetAirfoilCoordinates(geom_id, foilsurf_u)¶
Get the untwisted unit-length 2D coordinate points for the specified airfoil See also: WriteSeligAirfoil :param [in]: geom_id string Geom ID :param [in]: foilsurf_u U location (range: 0 - 1) along the surface. The foil surface does not include root and tip caps (i.e. 2 section wing -> XSec0 @ u=0, XSec1 @ u=0.5, XSec2 @ u=1.0)
- openvsp.vsp.GetAirfoilLowerPnts(xsec_id)¶
Get the coordinate points for the lower surface of an airfoil. The XSec must be of type XS_FILE_AIRFOIL
# Add Fuselage Geom fuseid = AddGeom( "FUSELAGE", "" ) xsec_surf = GetXSecSurf( fuseid, 0 ) ChangeXSecShape( xsec_surf, 1, XS_FILE_AIRFOIL ) xsec = GetXSec( xsec_surf, 1 ) ReadFileAirfoil( xsec, "airfoil/N0012_VSP.af" ) low_array = GetAirfoilLowerPnts( xsec )
See also: SetAirfoilPnts :param [in]: xsec_id string XSec ID :rtype: std::vector< vec3d,std::allocator< vec3d > > :return: vector<vec3d> Vector of coordinate points for the lower airfoil surface
- openvsp.vsp.GetAirfoilUpperPnts(xsec_id)¶
Get the coordinate points for the upper surface of an airfoil. The XSec must be of type XS_FILE_AIRFOIL
# Add Fuselage Geom fuseid = AddGeom( "FUSELAGE", "" ) xsec_surf = GetXSecSurf( fuseid, 0 ) ChangeXSecShape( xsec_surf, 1, XS_FILE_AIRFOIL ) xsec = GetXSec( xsec_surf, 1 ) ReadFileAirfoil( xsec, "airfoil/N0012_VSP.af" ) up_array = GetAirfoilUpperPnts( xsec )
See also: SetAirfoilPnts :param [in]: xsec_id string XSec ID :rtype: std::vector< vec3d,std::allocator< vec3d > > :return: vector<vec3d> VectorArray of coordinate points for the upper airfoil surface
- openvsp.vsp.GetAllBackground3DAbsolutePaths()¶
Get absolute paths to all Background3D images in model.
# Add Background3D AddBackground3D() AddBackground3D() AddBackground3D() bg_file_array = GetAllBackground3DAbsolutePaths() for n in range( len( bg_file_array ) ): print( bg_file_array[n] ) DelAllBackground3Ds()
- Return type:
vector< string >
- Returns:
vector<string> Vector of absolute paths to Background3D image files
- openvsp.vsp.GetAllBackground3DRelativePaths()¶
Get relative paths to all Background3D images in model. Note that path is relative to the model’s *.vsp3 file. Consequently, if a file has not yet been saved or assigned a file name, the relative path is meaningless.
# Add Background3D AddBackground3D() AddBackground3D() AddBackground3D() bg_file_array = GetAllBackground3DRelativePaths() for n in range( len( bg_file_array ) ): print( bg_file_array[n] ) DelAllBackground3Ds()
- Return type:
vector< string >
- Returns:
vector<string> Vector of relative paths to Background3D image files
- openvsp.vsp.GetAllBackground3Ds()¶
Get id’s of all Background3Ds in model
nbg = GetNumBackground3Ds() # Add Background3D AddBackground3D() AddBackground3D() AddBackground3D() if GetNumBackground3Ds() != nbg + 3 : print( "ERROR: AddBackground3D" ) bg_array = GetAllBackground3Ds() for n in range( len( bg_array ) ): print( bg_array[n] ) DelAllBackground3Ds()
- Return type:
vector< string >
- Returns:
vector<string> Vector of Background3D IDs
- openvsp.vsp.GetAllDataNames(results_id)¶
Get all data names for a particular result
#==== Write Some Fake Test Results =====// WriteTestResults() res_id = FindResultsID( "Test_Results" ) data_names = GetAllDataNames( res_id ) if len(data_names) != 5 : print( "---> Error: API GetAllDataNames" )
- Parameters:
[in] – results_id Result ID
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of result names
- openvsp.vsp.GetAllModes()¶
Get all ModeID’s in model.
# Illustrating use of Modes requires substantial setup of the model including components, sets, and variable presets. # # Setup boiler plate. pod1 = AddGeom( "POD", "" ) wing = AddGeom( "WING", pod1 ) SetParmVal( wing, "Trans_Attach_Flag", "Attach", ATTACH_TRANS_LMN ) SetParmVal( wing, "L_Attach_Location", "Attach", 0.35 ) SetSetName( SET_FIRST_USER, "NonLifting" ) SetSetName( SET_FIRST_USER + 1, "Lifting" ) SetSetFlag( pod1, SET_FIRST_USER, True ) SetSetFlag( wing, SET_FIRST_USER + 1, True ) gid = AddVarPresetGroup( "Tess" ) p1 = FindParm( pod1, "Tess_U", "Shape" ) AddVarPresetParm( gid, p1 ) p2 = FindParm( pod1, "Tess_W", "Shape" ) AddVarPresetParm( gid, p2 ) sid = AddVarPresetSetting( gid, "Default" ) SaveVarPresetParmVals( gid, sid ) sid1 = AddVarPresetSetting( gid, "Coarse" ) SetVarPresetParmVal( gid, sid1, p1, 3 ) SetVarPresetParmVal( gid, sid1, p2, 5 ) sid2 = AddVarPresetSetting( gid, "Fine" ) SetVarPresetParmVal( gid, sid, p1, 35 ) SetVarPresetParmVal( gid, sid, p2, 21 ) gid2 = AddVarPresetGroup( "Design" ) p3 = FindParm( pod1, "Length", "Design" ) AddVarPresetParm( gid2, p3 ) p4 = FindParm( pod1, "FineRatio", "Design" ) AddVarPresetParm( gid2, p4 ) sid3 = AddVarPresetSetting( gid2, "Normal" ) SaveVarPresetParmVals( gid2, sid3 ) sid4 = AddVarPresetSetting( gid2, "ShortFat" ) SetVarPresetParmVal( gid2, sid4, p3, 3.0 ) SetVarPresetParmVal( gid2, sid4, p4, 5.0 ) sid5 = AddVarPresetSetting( gid2, "LongThin" ) SetVarPresetParmVal( gid2, sid5, p3, 20.0 ) SetVarPresetParmVal( gid2, sid5, p4, 35.0 ) # End of setup boiler plate. mid1 = CreateAndAddMode( "FatWetAreas", SET_ALL, SET_NONE ) ModeAddGroupSetting( mid1, gid, sid1 ) ModeAddGroupSetting( mid1, gid2, sid4 ) mid2 = CreateAndAddMode( "ThinAero", SET_FIRST_USER, SET_FIRST_USER + 1 ) ModeAddGroupSetting( mid2, gid, sid2 ) ModeAddGroupSetting( mid1, gid2, sid5 ) ApplyModeSettings( mid2 ) Update() modids = GetAllModes();
- Return type:
vector< string >
- Returns:
array<string> array of Mode IDs
- openvsp.vsp.GetAllProbes()¶
Get an array of all Probe IDs from the Measure Tool
pid1 = AddGeom( "POD", "" ) SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 ) probe_id = AddProbe( pid1, 0, 0.5, 0.8, "Probe 1" ) probe_array = GetAllProbes() print( "One Probe: ", False ) print( probe_array[0] )
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
[in] Array of Probe IDs
- openvsp.vsp.GetAllResultsNames()¶
Get the name of all results in the Results Manager
#==== Write Some Fake Test Results =====// WriteTestResults() results_array = GetAllResultsNames() for i in range(int( len(results_array) )): resid = FindLatestResultsID( results_array[i] ) PrintResults( resid )
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of result names
- openvsp.vsp.GetAllRulers()¶
Get an array of all Ruler IDs from the Measure Tool
pid1 = AddGeom( "POD", "" ) SetParmVal( pid1, "Y_Rel_Location", "XForm", 2.0 ) pid2 = AddGeom( "POD", "" ) SetParmVal( pid2, "Z_Rel_Location", "XForm", 4.0 ) rid1 = AddRuler( pid1, 1, 0.2, 0.3, pid2, 0, 0.2, 0.3, "Ruler 1" ) rid2 = AddRuler( pid1, 0, 0.4, 0.6, pid1, 1, 0.8, 0.9, "Ruler 2" ) ruler_array = GetAllRulers() print("Two Rulers") for n in range(len(ruler_array)): print( ruler_array[n] )
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
vector<string> Vector of Ruler IDs
- openvsp.vsp.GetAllSubSurfIDs()¶
Get a vector of all sub-surface IDs for the entire model :rtype: std::vector< std::string,std::allocator< std::string > > :return: Array of sub-surface IDs
- openvsp.vsp.GetAllUserParms()¶
Get the vector of id’s for all user parameters
id_arr = GetAllUserParms() print( "---> User Parm IDs: " ) for i in range(int( len(id_arr) )): message = "\t" + id_arr[i] + "\n" print( message )
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of user parameter ids
- openvsp.vsp.GetAnalysisDoc(analysis)¶
Get the analysis documentation string
analysis_name = "VSPAEROComputeGeometry" doc = GetAnalysisDoc( analysis_name )
- Parameters:
[in] – analysis Analysis name
- Return type:
string
- Returns:
Documentation string
- openvsp.vsp.GetAnalysisInputDoc(analysis, name)¶
Get the documentation string for the particular analysis and input
- Parameters:
[in] – analysis Analysis name
[in] – name Input name
- Return type:
string
- Returns:
Documentation string
- openvsp.vsp.GetAnalysisInputNames(analysis)¶
Get the name of every available input for a particular analysis
analysis_name = "VSPAEROComputeGeometry" in_names = GetAnalysisInputNames( analysis_name ) print("Analysis Inputs: ") for i in range(int( len(in_names) )): print( ( "\t" + in_names[i] + "\n" ) )
- Parameters:
[in] – analysis Analysis name
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of input names
- openvsp.vsp.GetAnalysisInputType(analysis, name)¶
Get the data type for a particulat analysis type and input
analysis = "VSPAEROComputeGeometry" inp_array = GetAnalysisInputNames( analysis ) for j in range(int( len(inp_array) )): typ = GetAnalysisInputType( analysis, inp_array[j] )
See also: RES_DATA_TYPE :param [in]: analysis Analysis name :param [in]: name Input name :rtype: int :return: int Data type enum (i.e. DOUBLE_DATA)
- openvsp.vsp.GetAndResetUpdateCount()¶
Return the OpenVSP update count and also reset it to zero.
The OpenVSP update count tracks how many times the GUI has been told to update screens (set to dirty). It provides a simple means of testing whether the OpenVSP state has possibly changed (non-zero returned).
- Return type:
int
- Returns:
int OpenVSP update count
- openvsp.vsp.GetAttributeBoolVal(attrID)¶
Get the boolean value of a bool-type attribute
#Get first attribute in vehicle as an example AttrID = vsp.FindAllAttributes()[0] Bool_val = vsp.GetAttributeBoolVal( AttrID ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
vector< int >
- Returns:
Bool value of attribute
- Parameters:
[in] – attrID string ID of attribute
- openvsp.vsp.GetAttributeDoc(attrID)¶
Return string doc of attribute by its ID
#Get first attribute in vehicle as an example Attr_ID = vsp.FindAllAttributes()[0] Attr_Doc = vsp.GetAttributeDoc(Attr_ID) print( Attr_Doc ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
string
- Returns:
Return string doc of attribute by its ID
- Parameters:
[in] – attrID string ID of attribute
- openvsp.vsp.GetAttributeDoubleMatrixVal(attrID)¶
Get the Double Matrix of an Double-matrix-type attribute
#Get first attribute in vehicle as an example AttrID = vsp.FindAllAttributes()[0] Double_matrix = vsp.GetAttributeDoubleMatrixVal( AttrID ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
vector< vector< double > >
- Returns:
Double Matrix value of attribute as vector < vector < Double > >
- Parameters:
[in] – attrID string ID of attribute
- openvsp.vsp.GetAttributeDoubleVal(attrID)¶
Get the double value of a double-type attribute
#Get first attribute in vehicle as an example AttrID = vsp.FindAllAttributes()[0] Double_val = vsp.GetAttributeDoubleVal( AttrID ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
vector< double >
- Returns:
Double value of attribute
- Parameters:
[in] – attrID string ID of attribute
- openvsp.vsp.GetAttributeID(collID, attributeName, index)¶
Return the ID of an attribute by its name and collection ID
attach_ids = vsp.FindAttributedObjects(); for id in attach_ids: coll_id = vsp.GetChildCollection(id) attach_name = vsp.GetObjectName(id) attr_names = vsp.FindAttributeNamesInCollection(coll_id) print(f'\nAttribute Collection Name : {attach_name}\n') for aname in attr_names: aid = vsp.GetAttributeID( coll_id, aname, 0 ) #get the ID of this attribute for self-awareness #==== Write Some Fake Test Results =====// # not implemented
- Return type:
string
- Returns:
String ID of attribute based on collectionID and name
- Parameters:
[in] – collID string ID of an attribute collection
[in] – attributeName name of an attribute in that collection
- openvsp.vsp.GetAttributeIntMatrixVal(attrID)¶
Get the Int Matrix of an Int-matrix-type attribute
#Get first attribute in vehicle as an example AttrID = vsp.FindAllAttributes()[0] Int_matrix = vsp.GetAttributeIntMatrixVal( AttrID ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
vector< vector< int > >
- Returns:
Int Matrix value of attribute as vector < vector < int > >
- Parameters:
[in] – attrID string ID of attribute
- openvsp.vsp.GetAttributeIntVal(attrID)¶
Get the integer value of an int-type attribute
#Get first attribute in vehicle as an example AttrID = vsp.FindAllAttributes()[0] Int_val = vsp.GetAttributeIntVal( AttrID ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
vector< int >
- Returns:
Int value of attribute
- Parameters:
[in] – attrID string ID of attribute
- openvsp.vsp.GetAttributeName(attrID)¶
Return the name of an attribute by its ID
all_attr_ids = vsp.FindAllAttributes() for id in all_attr_ids: name = vsp.GetAttributeName( id ) print( name ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
string
- Returns:
String ID of attribute based on collectionID and name
- Parameters:
[in] – collID string ID of an attribute collection
[in] – attributeName name of an attribute in that collection
- openvsp.vsp.GetAttributeParmID(string const & attrID) StringVector ¶
- openvsp.vsp.GetAttributeParmName(attrID)¶
Get the name of the referenced parm of a parm-type attribute
#Generate a parm attribute and get its value VehID = vsp.GetVehicleID() CollID = vsp.GetChildCollection( VehID ) pid = AddGeom( "POD", "" ) print( "---> Test Get Parm Val" ) parm_array = GetGeomParmIDs( pid ) AttrName = 'Example_Parm_Attr' ParmID = parm_array[0]; vsp.AddAttributeBool( CollID, AttrName, ParmID ) AttrID = vsp.GetAttributeID( CollID, AttrName, 0 ) Parm_name = vsp.GetAttributeParmName( AttrID ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
vector< string >
- Returns:
Parm name of attribute
- Parameters:
[in] – attrID string ID of attribute
- openvsp.vsp.GetAttributeParmVal(attrID)¶
Get the parm value of a parm-type attribute
#Generate a parm attribute and get its value VehID = vsp.GetVehicleID() CollID = vsp.GetChildCollection( VehID ) pid = AddGeom( "POD", "" ) print( "---> Test Get Parm Val" ) parm_array = GetGeomParmIDs( pid ) AttrName = 'Example_Parm_Attr' ParmID = parm_array[0]; vsp.AddAttributeParm( CollID, AttrName, ParmID ) AttrID = vsp.GetAttributeID( CollID, AttrName, 0 ) Parm_val = vsp.GetAttributeParmVal( AttrID ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
vector< double >
- Returns:
Parm value of attribute
- Parameters:
[in] – attrID string ID of attribute
- openvsp.vsp.GetAttributeStringVal(attrID)¶
Get the string value of a string-type attribute
#Get first attribute in vehicle as an example AttrID = vsp.FindAllAttributes()[0] String_val = vsp.GetAttributeStringVal( AttrID ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
vector< string >
- Returns:
String value of attribute
- Parameters:
[in] – attrID string ID of attribute
- openvsp.vsp.GetAttributeType(attrID)¶
Get int enum type of attribute by ID Use in conjunction with GetAttributeTypeName for getting strings or with the following enums
vsp.BOOL_DATA vsp.INT_DATA vsp.DOUBLE_DATA vsp.STRING_DATA vsp.VEC3D_DATA vsp.INT_MATRIX_DATA vsp.DOUBLE_MATRIX_DATA vsp.NAMEVAL_COLLECTION_DATA vsp.ATTR_COLLECTION_DATA
#Get first attribute in vehicle as an example AttrID = vsp.FindAllAttributes()[0] AttributeType = vsp.GetAttributeType( AttrID ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
int
- Returns:
Int type of attribute
- Parameters:
[in] – attrID string ID of attribute
- openvsp.vsp.GetAttributeTypeName(attrID)¶
Get the attribute’s type as a string
#Get first attribute in vehicle as an example AttrID = vsp.FindAllAttributes()[0] AttributeTypeName = vsp.GetAttributeTypeName( AttrID ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
string
- Returns:
Type of attribute as string
- Parameters:
[in] – attrID string ID of attribute
- openvsp.vsp.GetAttributeVec3dVal(attrID)¶
Get the vec3d value of a string-type attribute
#Get first attribute in vehicle as an example AttrID = vsp.FindAllAttributes()[0] Vec3d_val = vsp.GetAttributeVec3dVal( AttrID ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
vector< vec3d >
- Returns:
Vec3d value of attribute
- Parameters:
[in] – attrID string ID of attribute
- openvsp.vsp.GetAvailableCSNameVec(CSGroupIndex)¶
Get the names of each available (not used) control surface in the control surface group at the specified index
wid = AddGeom( "WING", "" ) # Add Wing aileron_id = AddSubSurf( wid, SS_CONTROL ) # Add Control Surface Sub-Surface group_index = CreateVSPAEROControlSurfaceGroup() # Empty control surface group cs_name_vec = GetAvailableCSNameVec( group_index ) cs_ind_vec = [1] AddSelectedToCSGroup( cs_ind_vec, group_index ) # Add the first available control surface to the group
- Parameters:
[in] – CSGroupIndex Index of the control surface group
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of active control surface names
- openvsp.vsp.GetBORAirfoilLowerPnts(bor_id)¶
Get the coordinate points for the lower surface of an airfoil of a BOR. The XSecCurve must be of type XS_FILE_AIRFOIL
# Add Body of Recolution bor_id = AddGeom( "BODYOFREVOLUTION", "" ) ChangeBORXSecShape( bor_id, XS_FILE_AIRFOIL ) ReadBORFileAirfoil( bor_id, "airfoil/N0012_VSP.af" ) low_array = GetBORAirfoilLowerPnts( bor_id )
See also: SetAirfoilPnts :param [in]: bor_id string Body of revolution Geom ID :rtype: std::vector< vec3d,std::allocator< vec3d > > :return: vector<vec3d> Vector of coordinate points for the lower airfoil surface
- openvsp.vsp.GetBORAirfoilUpperPnts(bor_id)¶
Get the coordinate points for the upper surface of an airfoil on a BOR. The BOR XSecCurve must be of type XS_FILE_AIRFOIL
# Add Body of Recolution bor_id = AddGeom( "BODYOFREVOLUTION", "" ) ChangeBORXSecShape( bor_id, XS_FILE_AIRFOIL ) ReadBORFileAirfoil( bor_id, "airfoil/N0012_VSP.af" ) up_array = GetBORAirfoilUpperPnts( bor_id )
See also: SetAirfoilPnts :param [in]: bor_id string Body of revolution Geom ID :rtype: std::vector< vec3d,std::allocator< vec3d > > :return: vector<vec3d> Vector of coordinate points for the upper airfoil surface
- openvsp.vsp.GetBORLowerCSTCoefs(bor_id)¶
Get the CST coefficients for the lower surface of an airfoil of a BOR. The XSecCurve must be of type XS_CST_AIRFOIL See also: SetLowerCST :param [in]: bor_id string Body of revolution Geom ID :rtype: std::vector< double,std::allocator< double > > :return: vector<double> Vector of CST coefficients for the lower airfoil surface
- openvsp.vsp.GetBORLowerCSTDegree(bor_id)¶
Get the CST degree for the lower surface of an airfoil of a BOR. The XSecCurve must be of type XS_CST_AIRFOIL See also: SetLowerCST :param [in]: bor_id string Body of revolution Geom ID :rtype: int :return: int CST Degree for lower airfoil surface
- openvsp.vsp.GetBORUpperCSTCoefs(bor_id)¶
Get the CST coefficients for the upper surface of an airfoil of a BOR. The XSecCurve must be of type XS_CST_AIRFOIL See also: SetUpperCST :param [in]: bor_id Body of revolution Geom ID :rtype: std::vector< double,std::allocator< double > > :return: vector<double> Vector of CST coefficients for the upper airfoil surface
- openvsp.vsp.GetBORUpperCSTDegree(bor_id)¶
Get the CST degree for the upper surface of an airfoil of a BOR. The XSecCurve must be of type XS_CST_AIRFOIL See also: SetUpperCST :param [in]: bor_id string Body of revolution Geom ID :rtype: int :return: int CST Degree for upper airfoil surface
- openvsp.vsp.GetBORXSecShape(bor_id)¶
Get the XSec type for a BOR component
# Add Body of Recolution bor_id = AddGeom( "BODYOFREVOLUTION", "" ) ChangeBORXSecShape( bor_id, XS_ROUNDED_RECTANGLE ) if GetBORXSecShape( bor_id ) != XS_ROUNDED_RECTANGLE : print( "ERROR: GetBORXSecShape" )
- Parameters:
[in] – bor_id string Body of revolution Geom ID
- Return type:
int
- Returns:
int XSec type enum (i.e. XS_ROUNDED_RECTANGLE)
- openvsp.vsp.GetBackground3DAbsolutePath(id)¶
Get absolute path to specified Background3D’s image.
# Add Background3D bg_id = AddBackground3D() SetBackground3DAbsolutePath( bg_id, "/user/me/vsp_work/front.png" ) bg_file = GetBackground3DAbsolutePath( bg_id ) print( bg_file ) DelAllBackground3Ds()
- Parameters:
[in] – id string Background3D ID
- Return type:
string
- Returns:
string Absolute path to Background3D image file
- openvsp.vsp.GetBackground3DRelativePath(id)¶
Get relative path to specified Background3D’s image. Note that path is relative to the model’s *.vsp3 file. Consequently, if a file has not yet been saved or assigned a file name, the relative path is meaningless.
# Add Background3D bg_id = AddBackground3D() SetBackground3DRelativePath( bg_id, "front.png" ) bg_file = GetBackground3DRelativePath( bg_id ) print( bg_file ) DelAllBackground3Ds()
- Parameters:
[in] – id string Background3D ID
- Return type:
string
- Returns:
string Relative path to Background3D image file
- openvsp.vsp.GetBoolParmVal(parm_id)¶
Get the value of the specified bool type Parm
#==== Add Prop Geometry ====// prop_id = AddGeom( "PROP" ) rev_flag_id = GetParm( prop_id, "ReverseFlag", "Design" ) reverse_flag = GetBoolParmVal( rev_flag_id )
- Parameters:
[in] – parm_id string Parm ID
- Return type:
boolean
- Returns:
bool Parm value
- openvsp.vsp.GetChildCollection(attachID)¶
Get collection ID from any OpenVSP object If ID is an attribute collection, return the same ID back If ID is an attribute group, return its nested collection
attach_ids = vsp.FindAttributedObjects(); for id in attach_ids: collection_id = vsp.GetChildCollection( id ) attach_type = GetObjectType( collection_id ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
string
- Returns:
String ID of attribute collection associated with the attachID
- Parameters:
[in] – attachID string ID of an OpenVSP object
- openvsp.vsp.GetCompleteCSNameVec()¶
Get the names of all control surfaces. Some may be active (used) while others may be available.
wid = AddGeom( "WING", "" ) # Add Wing aileron_id = AddSubSurf( wid, SS_CONTROL ) # Add Control Surface Sub-Surface group_index = CreateVSPAEROControlSurfaceGroup() # Empty control surface group cs_name_vec = GetCompleteCSNameVec() print( "All Control Surfaces: ", False ) for i in range(int( len(cs_name_vec) )): print( cs_name_vec[i] )
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of all control surface names
- openvsp.vsp.GetContainerName(parm_container_id)¶
Get the name of the specified Parm Container
veh_id = FindContainer( "Vehicle", 0 ) if GetContainerName( veh_id) != "Vehicle": print( "---> Error: API GetContainerName" )
- Parameters:
[in] – parm_container_id Parm Container ID
- Return type:
string
- Returns:
Parm Container name
- openvsp.vsp.GetDesignVar(index)¶
Get the Parm ID of the specified design variable :param [in]: index Index of design variable :rtype: string :return: Parm ID
- openvsp.vsp.GetDesignVarType(index)¶
Get the XDDM type of the specified design variable See also: XDDM_QUANTITY_TYPE :param [in]: index Index of design variable :rtype: int :return: XDDM type enum (XDDM_VAR or XDDM_CONST)
- openvsp.vsp.GetDoubleAnalysisInput(analysis, name, index=0)¶
Get the current double values for the particular analysis, input, and data index
vinfFCinput = list( GetDoubleAnalysisInput( "ParasiteDrag", "Vinf" ) ) vinfFCinput[0] = 629 SetDoubleAnalysisInput( "ParasiteDrag", "Vinf", vinfFCinput )
See also: RES_DATA_TYPE, SetDoubleAnalysisInput :param [in]: analysis string Analysis name :param [in]: name string Input name :param [in]: index int Data index :rtype: std::vector< double,std::allocator< double > > :return: vector<double> Array of analysis input values
- openvsp.vsp.GetDoubleMatResults(id, name, index=0)¶
Get all matrix (vector<vector<double>>) values for a particular result, name, and index :param [in]: id Result ID :param [in]: name Data name :param [in]: index Data index :rtype: std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > :return: 2D array of data values
- openvsp.vsp.GetDoubleResults(id, name, index=0)¶
Get all double values for a particular result, name, and index
#==== Add Pod Geom ====// pid = AddGeom( "POD", "" ) #==== Run CompGeom And View Results ====// mesh_id = ComputeCompGeom( SET_ALL, False, 0 ) # Half Mesh false and no file export comp_res_id = FindLatestResultsID( "Comp_Geom" ) # Find Results ID double_arr = GetDoubleResults( comp_res_id, "Wet_Area" ) # Extract Results
- Parameters:
[in] – id Result ID
[in] – name Data name
[in] – index Data index
- Return type:
std::vector< double,std::allocator< double > >
- Returns:
Array of data values
- openvsp.vsp.GetEditXSecCtrlVec(xsec_id, non_dimensional=True)¶
Get the control point vector for an EditCurveXSec. Note, the returned array of vec3d values will be represented in 2D with Z set to 0.
# Add Stack sid = AddGeom( "STACK", "" ) # Get First (and Only) XSec Surf xsec_surf = GetXSecSurf( sid, 0 ) ChangeXSecShape( xsec_surf, 1, XS_EDIT_CURVE ) # Identify XSec 1 xsec_1 = GetXSec( xsec_surf, 1 ) # Get the control points for the default shape xsec1_pts = GetEditXSecCtrlVec( xsec_1, True ) # The returned control points will not be scaled by width and height print( f"Normalized Bottom Point of XSecCurve: {xsec1_pts[3].x()}, {xsec1_pts[3].y()}, {xsec1_pts[3].z()}" )
- Parameters:
[in] – xsec_id XSec ID
[in] – non_dimensional True to get the points non-dimensionalized, False to get them scaled by m_Width and m_Height
- Return type:
std::vector< vec3d,std::allocator< vec3d > >
- Returns:
Array of control points
- openvsp.vsp.GetEditXSecFixedUVec(xsec_id)¶
Get the vector of fixed U flags for each control point in an EditCurveXSec. The fixed U flag is used to hold the U parameter of the control point constant when performing an equal arc length reparameterization of the curve.
# Add Wing wid = AddGeom( "WING" ) # Get First (and Only) XSec Surf xsec_surf = GetXSecSurf( wid, 0 ) ChangeXSecShape( xsec_surf, 1, XS_EDIT_CURVE ) # Identify XSec 1 xsec_1 = GetXSec( xsec_surf, 1 ) fixed_u_vec = list(GetEditXSecFixedUVec( xsec_1 )) fixed_u_vec[3] = True # change a flag SetEditXSecFixedUVec( xsec_1, fixed_u_vec ) ReparameterizeEditXSec( xsec_1 )
See also: SetEditXSecFixedUVec, ReparameterizeEditXSec :param [in]: xsec_id XSec ID :rtype: std::vector< bool,std::allocator< bool > > :return: Array of bool values for each control point
- openvsp.vsp.GetEditXSecUVec(xsec_id)¶
Get the U parameter vector for an EditCurveXSec. The vector will be in increasing order with a range of 0 - 1.
# Add Stack sid = AddGeom( "STACK", "" ) # Get First (and Only) XSec Surf xsec_surf = GetXSecSurf( sid, 0 ) ChangeXSecShape( xsec_surf, 2, XS_EDIT_CURVE ) # Identify XSec 2 xsec_2 = GetXSec( xsec_surf, 2 ) # Set XSec 2 to linear EditXSecConvertTo( xsec_2, LINEAR ) u_vec = GetEditXSecUVec( xsec_2 ) if u_vec[1] - 0.25 > 1e-6 : print( "Error: GetEditXSecUVec" )
- Parameters:
[in] – xsec_id XSec ID
- Return type:
std::vector< double,std::allocator< double > >
- Returns:
Array of U parameter values
- openvsp.vsp.GetEllipsoidCpDist(surf_pnt_vec, abc_rad, V_inf)¶
Generate Analytical Solution for Potential Flow for specified ellipsoid shape at input surface points for input velocity vector. Based on Munk, M. M., ‘Remarks on the Pressure Distribution over the Surface of an Ellipsoid, Moving Translationally Through a Perfect Fluid,’ NACA TN-196, June 1924. Function initially created to compare VSPAERO results to theory.
import math pi = 3.14159265358979323846 npts = 101 abc_rad = vec3d(1.0, 2.0, 3.0) alpha = 5 # deg beta = 5 # deg V_inf = 100.0 x_slice_pnt_vec = [None]*npts theta_vec = [None]*npts theta_vec[0] = 0 for i in range(1, npts): theta_vec[i] = theta_vec[i-1] + (2 * pi / (npts - 1)) for i in range(npts): x_slice_pnt_vec[i] = vec3d( 0, abc_rad.y() * math.cos( theta_vec[i] ), abc_rad.z() * math.sin( theta_vec[i] ) ) V_vec = vec3d( ( V_inf * math.cos( alpha*pi/180 ) * math.cos( beta*pi/180 ) ), ( V_inf * math.sin( beta*pi/180 ) ), ( V_inf * math.sin( alpha*pi/180 ) * math.cos( beta*pi/180 ) ) ) cp_dist = GetEllipsoidCpDist( x_slice_pnt_vec, abc_rad, V_vec )
See also: GetEllipsoidSurfPnts :param [in]: surf_pnt_vec vector<vec3d> Vector of points on the ellipsoid surface to assess :param [in]: abc_rad vec3d Radius along the A (X), B (Y), and C (Z) axes :param [in]: V_inf vec3d 3D components of freestream velocity :rtype: std::vector< double,std::allocator< double > > :return: vector<double> Vector of Cp results corresponding to each point in surf_pnt_arr
- openvsp.vsp.GetEllipsoidSurfPnts(center, abc_rad, u_npts=20, w_npts=20)¶
Generate the surface coordinate points for a ellipsoid at specified center of input radius along each axis. Based on the MATLAB function ellipsoid (https://in.mathworks.com/help/matlab/ref/ellipsoid.html). See also: GetVKTAirfoilPnts :param [in]: center 3D location of the ellipsoid center :param [in]: abc_rad Radius along the A (X), B (Y), and C (Z) axes :param [in]: u_npts Number of points in the U direction :param [in]: w_npts Number of points in the W direction :rtype: std::vector< vec3d,std::allocator< vec3d > > :return: Array of coordinates describing the ellipsoid surface
- openvsp.vsp.GetFeaBCIDVec(fea_struct_id)¶
Return a vector of FEA BC ID’s for a structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ); #==== Add BC ====// bc_id = AddFeaBC( struct_id, FEA_BC_STRUCTURE ) bc_id_vec = GetFeaBCIDVec( struct_id )
- Parameters:
[in] – string fea_struct_id FEA Structure ID
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of FEA BC IDs
- openvsp.vsp.GetFeaPartID(fea_struct_id, fea_part_index)¶
Get the Parm ID of an FEA Part, identified from a FEA Structure Parm ID and FEA Part index.
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) #==== Add Bulkead ====// bulkhead_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE ) Update() if bulkhead_id != GetFeaPartID( struct_id, 1 ) : # These should be equivalent (index 0 is skin) print( "Error: GetFeaPartID" )
- Parameters:
[in] – fea_struct_id FEA Structure ID
[in] – fea_part_index FEA Part index
- Return type:
string
- Returns:
FEA Part ID
- openvsp.vsp.GetFeaPartIDVec(fea_struct_id)¶
Get the IDs of all FEA Parts in the given FEA Structure
#==== Add Geometries ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) #==== Add FEA Parts ====// slice_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE ) dome_id = AddFeaPart( pod_id, struct_ind, FEA_DOME ) part_id_vec = GetFeaPartIDVec( struct_id ) # Should include slice_id & dome_id
See also: NumFeaParts :param [in]: fea_struct_id FEA Structure ID :rtype: std::vector< std::string,std::allocator< std::string > > :return: Array of FEA Part IDs
- openvsp.vsp.GetFeaPartName(part_id)¶
Get the name of an FEA Part
#==== Add Fuselage Geometry ====// fuse_id = AddGeom( "FUSELAGE" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( fuse_id ) #==== Add Bulkead ====// bulkhead_id = AddFeaPart( fuse_id, struct_ind, FEA_SLICE ) name = "example_name" SetFeaPartName( bulkhead_id, name ) if name != GetFeaPartName( bulkhead_id ) : # These should be equivalent print( "Error: GetFeaPartName" )
See also: SetFeaPartName :param [in]: part_id FEA Part ID :rtype: string :return: FEA Part name
- openvsp.vsp.GetFeaPartPerpendicularSparID(part_id)¶
Get the ID of the perpendicular spar for an FEA Rib or Rib Array. Note, the FEA Rib or Rib Array doesn’t have to have “SPAR_NORMAL” set for the “PerpendicularEdgeType” Parm for this function to still return a value.
#==== Add Wing Geometry ====// wing_id = AddGeom( "WING" ) #==== Add FeaStructure to Wing ====// struct_ind = AddFeaStruct( wing_id ) #==== Add Rib ====// rib_id = AddFeaPart( wing_id, struct_ind, FEA_RIB ) #==== Add Spars ====// spar_id_1 = AddFeaPart( wing_id, struct_ind, FEA_SPAR ) spar_id_2 = AddFeaPart( wing_id, struct_ind, FEA_SPAR ) SetParmVal( FindParm( spar_id_1, "RelCenterLocation", "FeaPart" ), 0.25 ) SetParmVal( FindParm( spar_id_2, "RelCenterLocation", "FeaPart" ), 0.75 ) #==== Set Perpendicular Edge type to SPAR ====// SetParmVal( FindParm( rib_id, "PerpendicularEdgeType", "FeaRib" ), SPAR_NORMAL ) SetFeaPartPerpendicularSparID( rib_id, spar_id_2 ) if spar_id_2 != GetFeaPartPerpendicularSparID( rib_id ) : print( "Error: GetFeaPartPerpendicularSparID" )
See also: FEA_RIB_NORMAL, SetFeaPartPerpendicularSparID :param [in]: part_id FEA Part ID (Rib or Rib Array Type) :rtype: string :return: Perpendicular FEA Spar ID
- openvsp.vsp.GetFeaPartType(part_id)¶
Get the type of an FEA Part
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Add Slice ====// slice_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE ) if FEA_SLICE != GetFeaPartType( slice_id ) : # These should be equivalent print( "Error: GetFeaPartType" )
See also: FEA_PART_TYPE :param [in]: part_id FEA Part ID :rtype: int :return: FEA Part type enum
- openvsp.vsp.GetFeaStructID(geom_id, fea_struct_ind)¶
Get the ID of an FEA Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind )
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – fea_struct_ind FEA Structure index
- Return type:
string
- Returns:
FEA Structure ID
- openvsp.vsp.GetFeaStructIDVec()¶
Get the IDs of all FEA Structures in the vehicle
#==== Add Geometries ====// pod_id = AddGeom( "POD" ) wing_id = AddGeom( "WING" ) #==== Add FeaStructures ====// pod_struct_ind = AddFeaStruct( pod_id ) wing_struct_ind = AddFeaStruct( wing_id ) struct_id_vec = GetFeaStructIDVec()
See also: NumFeaStructures :rtype: std::vector< std::string,std::allocator< std::string > > :return: Array of FEA Structure IDs
- openvsp.vsp.GetFeaStructIndex(struct_id)¶
Get the index of an FEA Structure in its Parent Geom’s vector of Structures
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind_1 = AddFeaStruct( pod_id ) struct_ind_2 = AddFeaStruct( pod_id ) struct_id_2 = GetFeaStructID( pod_id, struct_ind_2 ) DeleteFeaStruct( pod_id, struct_ind_1 ) struct_ind_2_new = GetFeaStructIndex( struct_id_2 )
- Parameters:
[in] – struct_id FEA Structure ID
- Return type:
int
- Returns:
FEA Structure index
- openvsp.vsp.GetFeaStructName(geom_id, fea_struct_ind)¶
Get the name of an FEA Structure. The FEA Structure name functions as the the Parm Container name
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Get Structure Name ====// parm_container_name = GetFeaStructName( pod_id, struct_ind ) display_name = "Current Structure Parm Container Name: " + parm_container_name + "\n" print( display_name )
See also: FindContainer, SetFeaStructName :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind FEA Structure index :rtype: string :return: Name for the FEA Structure
- openvsp.vsp.GetFeaStructParentGeomID(struct_id)¶
Get the Parent Geom ID for an FEA Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) #==== Get Parent Geom ID and Index ====// parent_id = GetFeaStructParentGeomID( struct_id )
- Parameters:
[in] – struct_id FEA Structure ID
- Return type:
string
- Returns:
Parent Geom ID
- openvsp.vsp.GetFeaSubSurfIDVec(fea_struct_id)¶
Get the IDs of all FEA SubSurfaces in the given FEA Structure
#==== Add Geometries ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) #==== Add SubSurfaces ====// line_array_id = AddFeaSubSurf( pod_id, struct_ind, SS_LINE_ARRAY ) rectangle_id = AddFeaSubSurf( pod_id, struct_ind, SS_RECTANGLE ) part_id_vec = GetFeaSubSurfIDVec( struct_id ) # Should include line_array_id & rectangle_id
See also: NumFeaSubSurfs :param [in]: fea_struct_id FEA Structure ID :rtype: std::vector< std::string,std::allocator< std::string > > :return: Array of FEA Part IDs
- openvsp.vsp.GetFeaSubSurfIndex(ss_id)¶
Get the index of an FEA SubSurface give the SubSurface ID
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Add Slice ====// slice_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE ) #==== Add LineArray ====// line_array_id = AddFeaSubSurf( pod_id, struct_ind, SS_LINE_ARRAY ) #==== Add Rectangle ====// rect_id = AddFeaSubSurf( pod_id, struct_ind, SS_RECTANGLE ) if 1 != GetFeaSubSurfIndex( rect_id ) : # These should be equivalent print( "Error: GetFeaSubSurfIndex" )
- Parameters:
[in] – ss_id FEA SubSurface ID
- Return type:
int
- Returns:
FEA SubSurface Index
- openvsp.vsp.GetFeaSubSurfName(subsurf_id)¶
Set the name of an FEA SubSurface
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Add LineArray ====// line_array_id = AddFeaSubSurf( pod_id, struct_ind, SS_LINE_ARRAY ) name = "example_name" SetFeaSubSurfName( line_array_id, name ) if name != GetFeaSubSurfName( line_array_id ) : # These should be equivalent print( "Error: GetFeaSubSurfName" )
- Parameters:
[in] – subsurf_id FEA SubSurface ID
- Return type:
string
- Returns:
FEA SubSurf name
- openvsp.vsp.GetFeatureLinePnts(geom_id)¶
Get the points along the feature lines of a particular Geom :param [in]: geom_id string Geom ID :rtype: std::vector< vec3d,std::allocator< vec3d > > :return: Array of points along the Geom’s feature lines
- openvsp.vsp.GetGeomBBoxMax(geom_id, main_surf_ind=0, ref_frame_is_absolute=True)¶
Get the the maximum coordinate of the bounding box of a Geom with given main surface index. The Geom bounding box may be specified in absolute or body reference frame.
#==== Add Pod Geometry ====// pid = AddGeom( "POD" ) SetParmVal( FindParm( pid, "Y_Rotation", "XForm" ), 45 ) SetParmVal( FindParm( pid, "Z_Rotation", "XForm" ), 25 ) Update() max_pnt = GetGeomBBoxMax( pid, 0, False )
See also: GetGeomBBoxMin :param [in]: geom_id string Geom ID :param [in]: main_surf_ind Main surface index :param [in]: ref_frame_is_absolute Flag to specify absolute or body reference frame :rtype:
vec3d
:return: Maximum coordinate of the bounding box
- openvsp.vsp.GetGeomBBoxMin(geom_id, main_surf_ind=0, ref_frame_is_absolute=True)¶
Get the the minimum coordinate of the bounding box of a Geom with given main surface index. The Geom bounding box may be specified in absolute or body reference frame.
#==== Add Pod Geometry ====// pid = AddGeom( "POD" ) SetParmVal( FindParm( pid, "Y_Rotation", "XForm" ), 45 ) SetParmVal( FindParm( pid, "Z_Rotation", "XForm" ), 25 ) Update() min_pnt = GetGeomBBoxMin( pid, 0, False )
See also: GetGeomBBoxMax :param [in]: geom_id string Geom ID :param [in]: main_surf_ind Main surface index :param [in]: ref_frame_is_absolute Flag to specify absolute or body reference frame :rtype:
vec3d
:return: Minimum coordinate of the bounding box
- openvsp.vsp.GetGeomChildren(geom_id)¶
Get the IDs for each child of the input parent Geom.
#==== Add Parent and Child Geometry ====// pod1 = AddGeom( "POD" ) pod2 = AddGeom( "POD", pod1 ) pod3 = AddGeom( "POD", pod2 ) print( "Children of Pod #1: " ) children = GetGeomChildren( pod1 ) for i in range(int( len(children) )): print( "\t", False ) print( children[i] )
- Parameters:
[in] – geom_id string Geom ID
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
vector<string> Vector of child Geom IDs
- openvsp.vsp.GetGeomName(geom_id)¶
Get the name of a specific Geom
#==== Add Pod Geometry ====// pid = AddGeom( "POD", "" ) SetGeomName( pid, "ExamplePodName" ) name_str = "Geom Name: " + GetGeomName( pid ) print( name_str )
- Parameters:
[in] – geom_id string Geom ID
- Return type:
string
- Returns:
Geom name
- openvsp.vsp.GetGeomParent(geom_id)¶
Get the parent Geom ID for the input child Geom. “NONE” is returned if the Geom has no parent.
#==== Add Parent and Child Geometry ====// pod1 = AddGeom( "POD" ) pod2 = AddGeom( "POD", pod1 ) print( "Parent ID of Pod #2: ", False ) print( GetGeomParent( pod2 ) )
- Parameters:
[in] – geom_id string Geom ID
- Return type:
string
- Returns:
string Parent Geom ID
- openvsp.vsp.GetGeomParmIDs(geom_id)¶
Get all Parm IDs associated with this Geom Parm container
#==== Add Pod Geometry ====// pid = AddGeom( "POD", "" ) print( "---> Test Get Parm Arrays" ) parm_array = GetGeomParmIDs( pid ) if len(parm_array) < 1 : print( "---> Error: API GetGeomParmIDs " )
- Parameters:
[in] – geom_id string Geom ID
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of Parm IDs
- openvsp.vsp.GetGeomSet(name)¶
Get an array of Geom IDs for the specified set name
SetSetName( 3, "SetFromScript" ) geom_arr1 = GetGeomSetAtIndex( 3 ) geom_arr2 = GetGeomSet( "SetFromScript" ) if len(geom_arr1) != len(geom_arr2) : print( "---> Error: API GetGeomSet " )
- Parameters:
[in] – name const string set name
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
array<string> array of Geom IDs
- openvsp.vsp.GetGeomSetAtIndex(index)¶
Get an array of Geom IDs for the specified set index
SetSetName( 3, "SetFromScript" ) geom_arr1 = GetGeomSetAtIndex( 3 ) geom_arr2 = GetGeomSet( "SetFromScript" ) if len(geom_arr1) != len(geom_arr2) : print( "---> Error: API GetGeomSet " )
See also: SET_TYPE :param [in]: index Set index :rtype: std::vector< std::string,std::allocator< std::string > > :return: Array of Geom IDs
- openvsp.vsp.GetGeomSetCollection(index)¶
Get collection ID from a vehicle’s GeomSet
# get attributes from user geom set at index 0 collection_id = vsp.GetGeomSetCollection( 0 ); #==== Write Some Fake Test Results =====// # not implemented
- Return type:
string
- Returns:
String ID of attribute collection associated with the geom set
- Parameters:
[in] – attachID string ID of an OpenVSP object
- openvsp.vsp.GetGeomTypeName(geom_id)¶
Get the type name of specified Geom (i.e. FUSELAGE)
#==== Add Wing Geometry ====// wing_id = AddGeom( "WING" ) print( "Geom Type Name: ", False ) print( GetGeomTypeName( wing_id ) )
- Parameters:
[in] – geom_id string Geom ID
- Return type:
string
- Returns:
Geom type name
- openvsp.vsp.GetGeomTypes()¶
Get an array of all Geom types (i.e FUSELAGE, POD, etc.)
#==== Add Pod Geometries ====// pod1 = AddGeom( "POD", "" ) pod2 = AddGeom( "POD", "" ) type_array = GetGeomTypes() if ( type_array[0] != "POD" ): print( "---> Error: API GetGeomTypes " )
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
Array of Geom type names
- openvsp.vsp.GetGeomVSPSurfCfdType(geom_id, main_surf_ind=0)¶
Get the VSP surface CFD type of the specified Geom
#==== Add Wing Geometry ====// wing_id = AddGeom( "WING" ) if GetGeomVSPSurfCfdType( wing_id ) != CFD_NORMAL : print( "---> Error: API GetGeomVSPSurfCfdType " )
See also: VSP_SURF_CFD_TYPE :param [in]: geom_id string Geom ID :param [in]: main_surf_ind Main surface index :rtype: int :return: VSP surface CFD type enum (i.e. CFD_TRANSPARENT)
- openvsp.vsp.GetGeomVSPSurfType(geom_id, main_surf_ind=0)¶
Get the VSP surface type of the specified Geom
#==== Add Wing Geometry ====// wing_id = AddGeom( "WING" ) if GetGeomVSPSurfType( wing_id ) != WING_SURF : print( "---> Error: API GetGeomVSPSurfType " )
See also: VSP_SURF_TYPE :param [in]: geom_id string Geom ID :param [in]: main_surf_ind Main surface index :rtype: int :return: VSP surface type enum (i.e. DISK_SURF)
- openvsp.vsp.GetGroupName(group_id)¶
Get Variable Preset group name
# Add Pod Geom pod1 = AddGeom( "POD", "" ) gid = AddVarPresetGroup( "Tess" ) name = GetGroupName( gid )
- Parameters:
[in] – group_id string Var Preset Group ID
- Return type:
string
- Returns:
string Var Preset Group name
- openvsp.vsp.GetHersheyBarDragDist(npts, alpha, Vinf, span, full_span_flag=False)¶
Get the theoretical drag (Cd) distribution for a Hershey Bar wing with unit chord length using Glauert’s Method. This function was initially created to compare VSPAERO results to Lifting Line Theory. If full_span_flag is set to true symmetry is applied to the results.
pi = 3.14159265358979323846 # Compute theoretical lift and drag distributions using 100 points Vinf = 100 halfAR = 20 alpha_deg = 10 n_pts = 100 cl_dist_theo = GetHersheyBarLiftDist( int( n_pts ), alpha_deg*pi/180, Vinf, ( 2 * halfAR ), False ) cd_dist_theo = GetHersheyBarDragDist( int( n_pts ), alpha_deg*pi/180, Vinf, ( 2 * halfAR ), False )
- Parameters:
[in] – npts Number of points along the span to assess
[in] – alpha Wing angle of attack (Radians)
[in] – Vinf Freestream velocity
[in] – span Hershey Bar full-span. Note, only half is used in the calculation
[in] – full_span_flag Flag to apply symmetry to results (default: false)
- Return type:
std::vector< vec3d,std::allocator< vec3d > >
- Returns:
Theoretical coefficient of drag distribution array (size = 2*npts if full_span_flag = true)
- openvsp.vsp.GetHersheyBarLiftDist(npts, alpha, Vinf, span, full_span_flag=False)¶
Get the theoretical lift (Cl) distribution for a Hershey Bar wing with unit chord length using Glauert’s Method. This function was initially created to compare VSPAERO results to Lifting Line Theory. If full_span_flag is set to true symmetry is applied to the results.
pi = 3.14159265358979323846 # Compute theoretical lift and drag distributions using 100 points Vinf = 100 halfAR = 20 alpha_deg = 10 n_pts = 100 cl_dist_theo = GetHersheyBarLiftDist( int( n_pts ), alpha_deg*pi/180, Vinf, ( 2 * halfAR ), False ) cd_dist_theo = GetHersheyBarDragDist( int( n_pts ), alpha_deg*pi/180, Vinf, ( 2 * halfAR ), False )
- Parameters:
[in] – npts Number of points along the span to assess
[in] – alpha Wing angle of attack (Radians)
[in] – Vinf Freestream velocity
[in] – span Hershey Bar full-span. Note, only half is used in the calculation
[in] – full_span_flag Flag to apply symmetry to results
- Return type:
std::vector< vec3d,std::allocator< vec3d > >
- Returns:
Theoretical coefficient of lift distribution array (size = 2*npts if full_span_flag = true)
- openvsp.vsp.GetIntAnalysisInput(analysis, name, index=0)¶
Get the current integer values for the particular analysis, input, and data index
#==== Analysis: VSPAero Compute Geometry ====// analysis_name = "VSPAEROComputeGeometry" # Set to panel method analysis_method = GetIntAnalysisInput( analysis_name, "AnalysisMethod" ) analysis_method = [VORTEX_LATTICE] SetIntAnalysisInput( analysis_name, "AnalysisMethod", analysis_method )
See also: RES_DATA_TYPE, SetIntAnalysisInput :param [in]: analysis string Analysis name :param [in]: name string Input name :param [in]: index int Data index :rtype: std::vector< int,std::allocator< int > > :return: vector<int> Array of analysis input values
- openvsp.vsp.GetIntParmVal(parm_id)¶
Get the value of the specified int type Parm
#==== Add Prop Geometry ====// prop_id = AddGeom( "PROP" ) num_blade_id = GetParm( prop_id, "NumBlade", "Design" ) num_blade = GetIntParmVal( num_blade_id )
- Parameters:
[in] – parm_id string Parm ID
- Return type:
int
- Returns:
double Parm value
- openvsp.vsp.GetIntResults(id, name, index=0)¶
Get all integer values for a particular result, name, and index
#==== Write Some Fake Test Results =====// WriteTestResults() res_id = FindResultsID( "Test_Results" ) if ( GetNumData( res_id, "Test_Int" ) != 2 ): print( "---> Error: API GetNumData " ) int_arr = GetIntResults( res_id, "Test_Int", 0 ) if int_arr[0] != 1 : print( "---> Error: API GetIntResults" ) int_arr = GetIntResults( res_id, "Test_Int", 1 ) if int_arr[0] != 2 : print( "---> Error: API GetIntResults" )
- Parameters:
[in] – id Result ID
[in] – name Data name
[in] – index Data index
- Return type:
std::vector< int,std::allocator< int > >
- Returns:
Array of data values
- openvsp.vsp.GetLinkIndex(name)¶
Find the index of a specific advanced link.
pod = AddGeom( "POD", "" ) length = FindParm( pod, "Length", "Design" ) x_pos = GetParm( pod, "X_Rel_Location", "XForm" ) AddAdvLink( "ExampleLink" ) indx = GetLinkIndex( "ExampleLink" ) AddAdvLinkInput( indx, length, "len" ) AddAdvLinkOutput( indx, x_pos, "x" ) SetAdvLinkCode( indx, "x = 10.0 - len;" ) BuildAdvLinkScript( indx )
- Parameters:
[in] – name string Name for advanced link
- Return type:
int
- Returns:
index for advanced link
- openvsp.vsp.GetLowerCSTCoefs(xsec_id)¶
Get the CST coefficients for the lower surface of an airfoil. The XSec must be of type XS_CST_AIRFOIL See also: SetLowerCST :param [in]: xsec_id string XSec ID :rtype: std::vector< double,std::allocator< double > > :return: vector<double> Vector of CST coefficients for the lower airfoil surface
- openvsp.vsp.GetLowerCSTDegree(xsec_id)¶
Get the CST degree for the lower surface of an airfoil. The XSec must be of type XS_CST_AIRFOIL See also: SetLowerCST :param [in]: xsec_id XSec ID :rtype: int :return: int CST Degree for lower airfoil surface
- openvsp.vsp.GetMaterialNames()¶
Get the names of all visualization materials
mat_array = GetMaterialNames() for i in range(int( len(mat_array) )): print( mat_array[i] )
- Return type:
vector< string >
- Returns:
vector<string> Array of material names
- openvsp.vsp.GetNumActuatorDisks()¶
Get the number of actuator disks in the current VSPAERO set. This is equivalent to the number of disk surfaces in the VSPAERO set.
# Set VSPAERO set index to SET_ALL SetParmVal( FindParm( FindContainer( "VSPAEROSettings", 0 ), "GeomSet", "VSPAERO" ), SET_ALL ) # Add a propeller prop_id = AddGeom( "PROP", "" ) SetParmValUpdate( prop_id, "PropMode", "Design", PROP_BLADES ) num_disk = GetNumActuatorDisks() # Should be 0 SetParmValUpdate( prop_id, "PropMode", "Design", PROP_DISK ) num_disk = GetNumActuatorDisks() # Should be 1
See also: PROP_MODE :rtype: int :return: Number of actuator disks in the current VSPAERO set
- openvsp.vsp.GetNumAnalysis()¶
Get the number of analysis types available in the Analysis Manager
nanalysis = GetNumAnalysis() print( f"Number of registered analyses: {nanalysis}" )
- Return type:
int
- Returns:
Number of analyses
- openvsp.vsp.GetNumAnalysisInputData(analysis, name)¶
Get the documentation string for the particular analysis and input :param [in]: analysis Analysis name :param [in]: name Input name :rtype: int :return: Documentation string
- openvsp.vsp.GetNumBackground3Ds()¶
Get Number of Background3D’s in a model
nbg = GetNumBackground3Ds() # Add Background3D bg_id = AddBackground3D() if GetNumBackground3Ds() != nbg + 1 : print( "ERROR: AddBackground3D" ) DelBackground3D( bg_id )
- Return type:
int
- Returns:
int Number of Background3D’s in model
- openvsp.vsp.GetNumControlSurfaceGroups()¶
Get the total number of control surface groups
wid = AddGeom( "WING", "" ) # Add Wing aileron_id = AddSubSurf( wid, SS_CONTROL ) # Add Control Surface Sub-Surface #==== Add Horizontal tail and set some parameters =====// horiz_id = AddGeom( "WING", "" ) SetGeomName( horiz_id, "Vert" ) SetParmValUpdate( horiz_id, "TotalArea", "WingGeom", 10.0 ) SetParmValUpdate( horiz_id, "X_Rel_Location", "XForm", 8.5 ) elevator_id = AddSubSurf( horiz_id, SS_CONTROL ) # Add Control Surface Sub-Surface AutoGroupVSPAEROControlSurfaces() num_group = GetNumControlSurfaceGroups() if num_group != 2 : print( "Error: GetNumControlSurfaceGroups" )
- Return type:
int
- Returns:
Number of control surface groups
- openvsp.vsp.GetNumData(results_id, data_name)¶
Get the number of data values for a given result ID and data name
#==== Write Some Fake Test Results =====// WriteTestResults() res_id = FindResultsID( "Test_Results" ) if ( GetNumData( res_id, "Test_Int" ) != 2 ): print( "---> Error: API GetNumData " ) int_arr = GetIntResults( res_id, "Test_Int", 0 ) if int_arr[0] != 1 : print( "---> Error: API GetIntResults" ) int_arr = GetIntResults( res_id, "Test_Int", 1 ) if int_arr[0] != 2 : print( "---> Error: API GetIntResults" )
- Parameters:
[in] – results_id Result ID
[in] – data_name Data name
- Return type:
int
- Returns:
Number of data values
- openvsp.vsp.GetNumDesignVars()¶
Get the number of design variables :rtype: int :return: int Number of design variables
- openvsp.vsp.GetNumMainSurfs(geom_id)¶
Get the number of main surfaces for the specified Geom. Multiple main surfaces may exist for CustoGeoms, propellors, etc., but does not include surfaces created due to symmetry.
#==== Add Prop Geometry ====// prop_id = AddGeom( "PROP" ) num_surf = 0 num_surf = GetNumMainSurfs( prop_id ) # Should be the same as the number of blades print( "Number of Propeller Surfaces: ", False ) print( num_surf )
- Parameters:
[in] – geom_id string Geom ID
- Return type:
int
- Returns:
int Number of main surfaces
- openvsp.vsp.GetNumModes()¶
Get number of Modes in model.
# Illustrating use of Modes requires substantial setup of the model including components, sets, and variable presets. # # Setup boiler plate. pod1 = AddGeom( "POD", "" ) wing = AddGeom( "WING", pod1 ) SetParmVal( wing, "Trans_Attach_Flag", "Attach", ATTACH_TRANS_LMN ) SetParmVal( wing, "L_Attach_Location", "Attach", 0.35 ) SetSetName( SET_FIRST_USER, "NonLifting" ) SetSetName( SET_FIRST_USER + 1, "Lifting" ) SetSetFlag( pod1, SET_FIRST_USER, True ) SetSetFlag( wing, SET_FIRST_USER + 1, True ) gid = AddVarPresetGroup( "Tess" ) p1 = FindParm( pod1, "Tess_U", "Shape" ) AddVarPresetParm( gid, p1 ) p2 = FindParm( pod1, "Tess_W", "Shape" ) AddVarPresetParm( gid, p2 ) sid = AddVarPresetSetting( gid, "Default" ) SaveVarPresetParmVals( gid, sid ) sid1 = AddVarPresetSetting( gid, "Coarse" ) SetVarPresetParmVal( gid, sid1, p1, 3 ) SetVarPresetParmVal( gid, sid1, p2, 5 ) sid2 = AddVarPresetSetting( gid, "Fine" ) SetVarPresetParmVal( gid, sid, p1, 35 ) SetVarPresetParmVal( gid, sid, p2, 21 ) gid2 = AddVarPresetGroup( "Design" ) p3 = FindParm( pod1, "Length", "Design" ) AddVarPresetParm( gid2, p3 ) p4 = FindParm( pod1, "FineRatio", "Design" ) AddVarPresetParm( gid2, p4 ) sid3 = AddVarPresetSetting( gid2, "Normal" ) SaveVarPresetParmVals( gid2, sid3 ) sid4 = AddVarPresetSetting( gid2, "ShortFat" ) SetVarPresetParmVal( gid2, sid4, p3, 3.0 ) SetVarPresetParmVal( gid2, sid4, p4, 5.0 ) sid5 = AddVarPresetSetting( gid2, "LongThin" ) SetVarPresetParmVal( gid2, sid5, p3, 20.0 ) SetVarPresetParmVal( gid2, sid5, p4, 35.0 ) # End of setup boiler plate. mid1 = CreateAndAddMode( "FatWetAreas", SET_ALL, SET_NONE ) ModeAddGroupSetting( mid1, gid, sid1 ) ModeAddGroupSetting( mid1, gid2, sid4 ) mid2 = CreateAndAddMode( "ThinAero", SET_FIRST_USER, SET_FIRST_USER + 1 ) ModeAddGroupSetting( mid2, gid, sid2 ) ModeAddGroupSetting( mid1, gid2, sid5 ) ApplyModeSettings( mid2 ) Update() nmod = GetNumModes()
- Return type:
int
- Returns:
int Number of Modes in model.
- openvsp.vsp.GetNumPredefinedUserParms()¶
Get the number of pre-defined user parameters
n = GetNumPredefinedUserParms()
- Return type:
int
- Returns:
Number of pre-defined user Parms
- openvsp.vsp.GetNumResults(name)¶
Get the number of results for a particular result name
#==== Write Some Fake Test Results =====// WriteTestResults() if ( GetNumResults( "Test_Results" ) != 2 ): print( "---> Error: API GetNumResults" )
- Parameters:
[in] – name Input name
- Return type:
int
- Returns:
Number of results
- openvsp.vsp.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 " )
- Return type:
int
- Returns:
Number of sets
- openvsp.vsp.GetNumSubSurf(geom_id)¶
Get the number of sub-surfaces for the specified Geom
wid = AddGeom( "WING", "" ) # Add Wing ss_line_id = AddSubSurf( wid, SS_LINE ) # Add Sub Surface Line ss_rec_id = AddSubSurf( wid, SS_RECTANGLE ) # Add Sub Surface Rectangle num_ss = GetNumSubSurf( wid ) num_str = "Number of SubSurfaces: {num_ss}" print( num_str )
- Parameters:
[in] – geom_id string Geom ID
- Return type:
int
- Returns:
int Number of Sub-surfaces
- openvsp.vsp.GetNumUnsteadyGroups()¶
Get the number of unsteady groups in the current VSPAERO set. Each propeller is placed in its own unsteady group. All symmetric copies of propellers are also placed in an unsteady group. All other component types are placed in a single fixed component unsteady group.
# Set VSPAERO set index to SET_ALL SetParmVal( FindParm( FindContainer( "VSPAEROSettings", 0 ), "GeomSet", "VSPAERO" ), SET_ALL ) # Add a propeller prop_id = AddGeom( "PROP" ) SetParmValUpdate( prop_id, "PropMode", "Design", PROP_DISK ) num_group = GetNumUnsteadyGroups() # Should be 0 SetParmValUpdate( prop_id, "PropMode", "Design", PROP_BLADES ) num_group = GetNumUnsteadyGroups() # Should be 1 wing_id = AddGeom( "WING" ) num_group = GetNumUnsteadyGroups() # Should be 2 (includes fixed component group)
See also: PROP_MODE, GetNumUnsteadyRotorGroups :rtype: int :return: Number of unsteady groups in the current VSPAERO set
- openvsp.vsp.GetNumUnsteadyRotorGroups()¶
Get the number of unsteady rotor groups in the current VSPAERO set. This is equivalent to the total number of propeller Geoms, including each symmetric copy, in the current VSPAERO set. While all fixed components (wings, fuseleage, etc.) are placed in their own unsteady group, this function does not consider them.
# Set VSPAERO set index to SET_ALL SetParmVal( FindParm( FindContainer( "VSPAEROSettings", 0 ), "GeomSet", "VSPAERO" ), SET_ALL ) # Add a propeller prop_id = AddGeom( "PROP" ) SetParmValUpdate( prop_id, "PropMode", "Design", PROP_DISK ) num_group = GetNumUnsteadyRotorGroups() # Should be 0 SetParmValUpdate( prop_id, "PropMode", "Design", PROP_BLADES ) num_group = GetNumUnsteadyRotorGroups() # Should be 1 wing_id = AddGeom( "WING" ) num_group = GetNumUnsteadyRotorGroups() # Should be 1 still (fixed group not included)
See also: PROP_MODE, GetNumUnsteadyGroups :rtype: int :return: Number of unsteady rotor groups in the current VSPAERO set
- openvsp.vsp.GetNumUserParms()¶
Get the number of user parameters
n = GetNumUserParms()
- Return type:
int
- Returns:
Number of user Parms
- openvsp.vsp.GetNumXSec(xsec_surf_id)¶
Get number of XSecs in an XSecSurf
# Add Stack sid = AddGeom( "STACK", "" ) # Get First (and Only) XSec Surf xsec_surf = GetXSecSurf( sid, 0 ) # Flatten ends num_xsecs = GetNumXSec( xsec_surf ) for i in range(num_xsecs): xsec = GetXSec( xsec_surf, i ) SetXSecTanAngles( xsec, XSEC_BOTH_SIDES, 0, -1.0e12, -1.0e12, -1.0e12 ) # Set Tangent Angles At Cross Section SetXSecTanStrengths( xsec, XSEC_BOTH_SIDES, 0.0, -1.0e12, -1.0e12, -1.0e12 ) # Set Tangent Strengths At Cross Section
- Parameters:
[in] – xsec_surf_id XSecSurf ID
- Return type:
int
- Returns:
Number of XSecs
- openvsp.vsp.GetNumXSecSurfs(geom_id)¶
Get the number of XSecSurfs for the specified Geom
#==== Add Fuselage Geometry ====// fuseid = AddGeom( "FUSELAGE", "" ) num_xsec_surfs = GetNumXSecSurfs( fuseid ) if num_xsec_surfs != 1 : print( "---> Error: API GetNumXSecSurfs " )
- Parameters:
[in] – geom_id string Geom ID
- Return type:
int
- Returns:
int Number of XSecSurfs
- openvsp.vsp.GetObjectName(attachID)¶
Get the name of an OpenVSP Entity by ID
attach_ids = vsp.FindAttributedObjects(); for id in attach_ids: name = vsp.GetObjectName( id ) print( name ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
string
- Returns:
return string of object name
- Parameters:
[in] – attachID string ID of an OpenVSP object
- openvsp.vsp.GetObjectParent(id)¶
Get the string ID of the entity’s parent Attributes -> Attribute Collections Attribute Collections -> Objects that contain attribute Collections Geoms->Parent Geoms Parms->ParmContainers etc.
wing_id = AddGeom( "WING" ) pod_id = AddGeom( "POD", wing_id ) parent_id = vsp.GetObjectParent( pod_id ) if parent_id == wing_id: print( "Parent of Pod is Wing") #Get first attribute in vehicle as an example AttrID = vsp.FindAllAttributes()[0] CollID = vsp.GetObjectParent( AttrID ) CollParentObjID = vsp.GetObjectParent( CollID ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
string
- Returns:
string ID of object parent
- openvsp.vsp.GetObjectType(attachID)¶
Get the type of an OpenVSP Entity by ID
attach_ids = vsp.FindAttributedObjects(); for id in attach_ids: int_type = vsp.GetObjectType( id ) print( int_type ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
int
- Returns:
return string of object name
- Parameters:
[in] – attachID string ID of an OpenVSP object
- openvsp.vsp.GetObjectTypeName(attachID)¶
Get the named type of an OpenVSP Entity by ID
attach_ids = vsp.FindAttributedObjects(); for id in attach_ids: type_name = vsp.GetObjectTypeName( id ) print( type_name ) #==== Write Some Fake Test Results =====// # not implemented
- Return type:
string
- Returns:
return string of object name
- Parameters:
[in] – attachID string ID of an OpenVSP object
- openvsp.vsp.GetParm(geom_id, name, group)¶
Get Parm ID
#==== Add Pod Geometry ====// pid = AddGeom( "POD" ) lenid = GetParm( pid, "Length", "Design" ) if not ValidParm( lenid ) : print( "---> Error: API GetParm " )
- Parameters:
[in] – geom_id string Geom ID
[in] – name string Parm name
[in] – group string Parm group name
- Return type:
string
- Returns:
string Parm ID
- openvsp.vsp.GetParmContainer(parm_id)¶
Get Parm Container ID for the specified Parm
# Add Fuselage Geom fuseid = AddGeom( "FUSELAGE", "" ) xsec_surf = GetXSecSurf( fuseid, 0 ) ChangeXSecShape( xsec_surf, GetNumXSec( xsec_surf ) - 1, XS_ROUNDED_RECTANGLE ) xsec = GetXSec( xsec_surf, GetNumXSec( xsec_surf ) - 1 ) wid = GetXSecParm( xsec, "RoundedRect_Width" ) cid = GetParmContainer( wid ) if len(cid)