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 = 31

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.AVEC_WSECT_DRIVER = 4

Average chord driver

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.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 goemetry

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 tripple on scale [0, 255]

  • [in] – diffuse vec3d Diffuse color RGB tripple on scale [0, 255]

  • [in] – specular vec3d Specular color RGB tripple on scale [0, 255]

  • [in] – emmissive vec3d Emissive color RGB tripple 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 Presets group

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "Tess" )

if  len(GetVarPresetGroupNames()) != 1 : print( "---> Error: API AddVarPresetGroup" )
Parameters:

[in] – group_name Variable Presets group name

openvsp.vsp.AddVarPresetParm(*args)

Overload 1:

Add a Parm to the currently active Variable Preset

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "Tess" )

AddVarPresetSetting( "Coarse" )

p1 = FindParm( pod1, "Tess_U", "Shape" )

AddVarPresetParm( p1 )
Parameters:

[in] – parm_id string Parm ID


Overload 2:

Add a Parm to the currently active Variable Preset

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "Tess" )

AddVarPresetSetting( "Coarse" )

p1 = FindParm( pod1, "Tess_U", "Shape" )

AddVarPresetParm( p1 )
Parameters:
  • [in] – parm_id string Parm ID

  • [in] – group_name string Variable Presets group name

openvsp.vsp.AddVarPresetSetting(setting_name)

Add a setting to the currently active Variable Preset

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "Tess" )

AddVarPresetSetting( "Coarse" )

if len(GetVarPresetSettingNamesWName( "Tess" )) != 1 : print( "---> Error: API AddVarPresetSetting" )
Parameters:

[in] – setting_name Variable Presets setting name

openvsp.vsp.AddVec3D(Vec3dVec INOUT, double x, double y, double z)
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.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.BarycentricWeights(vec3d v0, vec3d v1, vec3d v2, vec3d p) vec3d
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.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:

vec3d

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:

vec3d

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:

vec3d

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:

vec3d

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:

vec3d

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:

vec3d

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:

vec3d

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)

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:

vec3d

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:

vec3d

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.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.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.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 = 1

Double result data type

openvsp.vsp.DOUBLE_MATRIX_DATA = 4

Double matrix result 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)

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

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.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.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.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.DeleteVarPresetParm(*args)

Overload 1:

Remove a Parm from the currently active Variable Preset group

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "Tess" )

AddVarPresetSetting( "Coarse" )

p1 = FindParm( pod1, "Tess_U", "Shape" )

AddVarPresetParm( p1 )

DeleteVarPresetParm( p1 )
Parameters:

[in] – parm_id string Parm ID


Overload 2:

Remove a Parm from the currently active Variable Preset group

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "Tess" )

AddVarPresetSetting( "Coarse" )

p1 = FindParm( pod1, "Tess_U", "Shape" )

AddVarPresetParm( p1 )

DeleteVarPresetParm( p1 )
Parameters:
  • [in] – parm_id string Parm ID

  • [in] – group_name string Variable Presets group name

openvsp.vsp.DeleteVarPresetSet(group_name, setting_name)

Delete a Variable Preset

AddVarPresetGroup( "Tess" )

AddVarPresetSetting( "Fine" )

DeleteVarPresetSet( "Tess", "Fine" )

if  len(GetVarPresetSettingNamesWName( "Tess" )) != 0 : print( "---> Error: DeleteVarPresetSet" )
Parameters:
  • [in] – group_name Variable Presets group

  • [in] – setting_name Variable Presets setting name

Return type:

boolean

Returns:

true is successful, false otherwise

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.

InitGUI()
EnableStopGUIMenuItem()
DisableStopGUIMenuItem()
StartGUI()

See also: InitGUI, 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_BEM = 15

Blade Element (*.bem) export type

openvsp.vsp.EXPORT_BEZIER_AIRFOIL = 22

Airfoil curves (*.bz) export type

openvsp.vsp.EXPORT_CART3D = 6

Cart3D (*.tri) export type

openvsp.vsp.EXPORT_DXF = 16

AutoCAD (*.dxf) export type

openvsp.vsp.EXPORT_FACET = 17

Xpatch (*.facet) export type

openvsp.vsp.EXPORT_FELISA = 0

FELISA export type (NOT IMPLEMENTED)

openvsp.vsp.EXPORT_GMSH = 10

Gmsh (*.msh) export type

openvsp.vsp.EXPORT_IGES = 14

IGES (*.igs) export type

openvsp.vsp.EXPORT_IGES_STRUCTURE = 23

IGES structure (*.igs) export type

openvsp.vsp.EXPORT_NASCART = 4

NASCART (*.dat) export type

openvsp.vsp.EXPORT_OBJ = 20

OBJ (*.obj) export type

openvsp.vsp.EXPORT_PLOT3D = 13

PLOT3D (*.p3d) export type

openvsp.vsp.EXPORT_PMARC = 19

PMARC 12 (*.pmin) export type

openvsp.vsp.EXPORT_POVRAY = 5

POVRAY (*.pov) export type

openvsp.vsp.EXPORT_SELIG_AIRFOIL = 21

Airfoil points (*.dat) export type

openvsp.vsp.EXPORT_STEP = 12

STEP (*.stp) export type

openvsp.vsp.EXPORT_STEP_STRUCTURE = 24

STEP structure (*.stp) export type

openvsp.vsp.EXPORT_STL = 2

Stereolith (*.stl) export type

openvsp.vsp.EXPORT_SVG = 18

SVG (*.svg) export type

openvsp.vsp.EXPORT_VORXSEC = 8

VORXSEC export type (NOT IMPLEMENTED)

openvsp.vsp.EXPORT_VSPGEOM = 7

VSPGeom (*.vspgeom) export type

openvsp.vsp.EXPORT_X3D = 11

X3D (*.x3d) export type

openvsp.vsp.EXPORT_XSEC = 1

XSec (*.hrm) export type

openvsp.vsp.EXPORT_XSECGEOM = 9

XSECGEOM export type (NOT IMPLEMENTED)

openvsp.vsp.EditVarPresetParm(*args)

Overload 1:

Edit the value of a Parm in the currently active Variable Preset

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "Tess" )

AddVarPresetSetting( "Coarse" )

p1 = FindParm( pod1, "Tess_U", "Shape" )

AddVarPresetParm( p1 )

EditVarPresetParm( p1, 5 )
Parameters:
  • [in] – parm_id string Parm ID

  • [in] – parm_val double Parm value


Overload 2:

Edit the value of a Parm in the currently active Variable Preset

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "Tess" )

AddVarPresetSetting( "Coarse" )

p1 = FindParm( pod1, "Tess_U", "Shape" )

AddVarPresetParm( p1 )

EditVarPresetParm( p1, 5 )
Parameters:
  • [in] – parm_id string Parm ID

  • [in] – parm_val double Parameter value

  • [in] – group_name string Variable Presets group name

  • [in] – setting_name string Variable Presets setting name

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.

InitGUI()
EnableStopGUIMenuItem()
StartGUI()

See also: InitGUI, 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:

ErrorObj

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) :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.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 = 16

Add item to custom GUI Choice

openvsp.vsp.GDEV_BEGIN_SAME_LINE = 26

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 = 15

Custom GUI Choice

openvsp.vsp.GDEV_COLOR_PICKER = 23

Custom GUI ColorPicker

openvsp.vsp.GDEV_COUNTER = 14

Custom GUI Counter

openvsp.vsp.GDEV_DIVIDER_BOX = 25

Custom GUI divider box

openvsp.vsp.GDEV_END_SAME_LINE = 27

Set end same line flag for custom GUI

openvsp.vsp.GDEV_FORCE_WIDTH = 28

Set forced width for custom GUI

openvsp.vsp.GDEV_FRACT_PARM_SLIDER = 20

Custom GUI FractParmSlider

openvsp.vsp.GDEV_GROUP = 2

Custom GUI Group

openvsp.vsp.GDEV_INDEX_SELECTOR = 22

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 = 29

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 = 18

Custom GUI SliderAdjRangeInput

openvsp.vsp.GDEV_SLIDER_ADJ_RANGE_TWO_INPUT = 19

Custom GUI SliderAdjRangeInput with two inputs (NOT IMPLEMENTED)

openvsp.vsp.GDEV_SLIDER_INPUT = 17

Custom GUI SliderInput

openvsp.vsp.GDEV_STRING_INPUT = 21

Custom GUI StringInput

openvsp.vsp.GDEV_TAB = 0

Custom GUI Tab

openvsp.vsp.GDEV_TOGGLE_BUTTON = 11

Custom GUI ToggleButton

openvsp.vsp.GDEV_TOGGLE_RADIO_GROUP = 12

Custom GUI ToggleRadioGroup (NOT IMPLEMENTED)

openvsp.vsp.GDEV_TRIGGER_BUTTON = 13

Custom GUI TriggerButton

openvsp.vsp.GDEV_YGAP = 24

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.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.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.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.GetCurrentGroupName()

Get the currently active Variable Presets group name

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "Tess" )

AddVarPresetSetting( "Coarse" )

p1 = FindParm( pod1, "Tess_U", "Shape" )

AddVarPresetParm( p1 )

AddVarPresetGroup( "New_Group" )

AddVarPresetSetting( "New_Setting" )

print( "Current Group: " )

print( GetCurrentGroupName() )
Return type:

string

Returns:

Variable Presets group name

openvsp.vsp.GetCurrentSettingName()

Get the currently active Variable Presets setting name

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "Tess" )

AddVarPresetSetting( "Coarse" )

p1 = FindParm( pod1, "Tess_U", "Shape" )

AddVarPresetParm( p1 )

AddVarPresetGroup( "New_Group" )

AddVarPresetSetting( "New_Setting" )

print( "Current Setting: " )

print( GetCurrentSettingName() )
Return type:

string

Returns:

Variable Presets setting 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.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.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.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.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) == 0 : print( "---> Error: API GetParmContainer " )
Parameters:

[in] – parm_id string Parm ID

Return type:

string

Returns:

Parm Container ID

openvsp.vsp.GetParmDescript(parm_id)

Get the description of the specified Parm

pod_id = AddGeom( "POD" )

length = FindParm( pod_id, "Length", "Design" )

SetParmValLimits( length, 10.0, 0.001, 1.0e12 )

desc = GetParmDescript( length )
print( desc )
Parameters:

[in] – parm_id string Parm ID

Return type:

string

Returns:

desc Parm description

openvsp.vsp.GetParmDisplayGroupName(parm_id)

Get the display group name for the specified Parm

veh_id = FindContainer( "Vehicle", 0 )

#==== Get and List All Parms in the Container ====//
parm_ids = FindContainerParmIDs( veh_id )

print( "Parm Group Display Names and IDs in Vehicle Parm Container: " )

for i in range(len(parm_ids)):

    group_str = GetParmDisplayGroupName( parm_ids[i] ) + ": " + parm_ids[i] + "\n"

    print( group_str )
Parameters:

[in] – parm_id string Parm ID

Return type:

string

Returns:

Parm display group name

openvsp.vsp.GetParmGroupName(parm_id)

Get the group name for the specified Parm

veh_id = FindContainer( "Vehicle", 0 )

#==== Get and List All Parms in the Container ====//
parm_ids = FindContainerParmIDs( veh_id )

print( "Parm Groups and IDs in Vehicle Parm Container: " )

for i in range(len(parm_ids)):

    group_str = GetParmGroupName( parm_ids[i] ) + ": " + parm_ids[i] + "\n"

    print( group_str )
Parameters:

[in] – parm_id string Parm ID

Return type:

string

Returns:

Parm group name

openvsp.vsp.GetParmLowerLimit(parm_id)

Get the lower limit value for the specified Parm

#==== Add Prop Geometry ====//
prop_id = AddGeom( "PROP" )

num_blade_id = GetParm( prop_id, "NumBlade", "Design" )

min_blade = GetParmLowerLimit( num_blade_id )
Parameters:

[in] – parm_id string Parm ID

Return type:

float

Returns:

Parm lower limit

openvsp.vsp.GetParmName(parm_id)

Get the name for the specified Parm

#==== 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_id string Parm ID

Return type:

string

Returns:

Parm name

openvsp.vsp.GetParmType(parm_id)

Get the data type 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" )

if  GetParmType( wid ) != PARM_DOUBLE_TYPE : print( "---> Error: API GetParmType " )

See also: PARM_TYPE :param [in]: parm_id string Parm ID :rtype: int :return: Parm data type enum (i.e. PARM_BOOL_TYPE)

openvsp.vsp.GetParmUpperLimit(parm_id)

Get the upper limit value for the specified Parm

#==== Add Prop Geometry ====//
prop_id = AddGeom( "PROP" )

num_blade_id = GetParm( prop_id, "NumBlade", "Design" )

max_blade = GetParmUpperLimit( num_blade_id )
Parameters:

[in] – parm_id string Parm ID

Return type:

float

Returns:

double Parm upper limit

openvsp.vsp.GetParmVal(*args)

Overload 1:

Get the value of the specified Parm. The data type of the Parm value will be cast to a double

# 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" )

SetParmVal( wid, 23.0 )

if  abs( GetParmVal( wid ) - 23 ) > 1e-6 : print( "---> Error: API Parm Val Set/Get " )
Parameters:

[in] – parm_id string Parm ID

Return type:

float

Returns:

Parm value


Overload 2:

Get the value of the specified Parm. The data type of the Parm value will be cast to a double

# 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" )

SetParmVal( wid, 23.0 )

if  abs( GetParmVal( wid ) - 23 ) > 1e-6 : print( "---> Error: API Parm Val Set/Get " )
Parameters:
  • [in] – geom_id string Geom ID

  • [in] – name string Parm name

  • [in] – group string Parm group name

Return type:

float

Returns:

double Parm value

openvsp.vsp.GetResultsEntryDoc(std::string const & results_id, std::string const & data_name) std::string
openvsp.vsp.GetResultsName(results_id)

Get the name of a result given its ID

#==== Analysis: VSPAero Compute Geometry ====//
analysis_name = "VSPAEROComputeGeometry"

# Set defaults
SetAnalysisInputDefaults( analysis_name )

res_id = ( ExecAnalysis( analysis_name ) )

print( "Results Name: ", False )

print( GetResultsName( res_id ) )
Parameters:

[in] – results_id Result ID

Return type:

string

Returns:

Result name

openvsp.vsp.GetResultsSetDoc(results_id)

Get the documentation string for a result given its ID

#==== Analysis: VSPAero Compute Geometry ====//
analysis_name = "VSPAEROComputeGeometry"

# Set defaults
SetAnalysisInputDefaults( analysis_name )

res_id = ( ExecAnalysis( analysis_name ) )

print( "Results doc: ", False )

print( GetResultsSetDoc( res_id ) )
Parameters:

[in] – results_id Result ID

Return type:

string

Returns:

Result documentation string

openvsp.vsp.GetResultsType(results_id, data_name)

Get the data type for a given result ID and data name

#==== Write Some Fake Test Results =====//
WriteTestResults()

res_id = FindResultsID( "Test_Results" )

res_array = GetAllDataNames( res_id )

for j in range(int( len(res_array) )):

    typ = GetResultsType( res_id, res_array[j] )

See also: RES_DATA_TYPE :param [in]: results_id Result ID :param [in]: data_name Data name :rtype: int :return: Data type enum (i.e. DOUBLE_DATA)

openvsp.vsp.GetSetFlag(geom_id, set_index)

Check if a Geom is in the set at the specified set index

# Add Fuselage Geom
fuseid = AddGeom( "FUSELAGE", "" )

SetSetFlag( fuseid, 3, True )

if not GetSetFlag(fuseid, 3):
    print("---> Error: API Set/Get Set Flag")
Parameters:
  • [in] – geom_id string Geom ID

  • [in] – set_index Set index

Return type:

boolean

Returns:

True if geom is in the set, false otherwise

openvsp.vsp.GetSetIndex(name)

Get the set index for the specified set name

SetSetName( 3, "SetFromScript" )

if GetSetIndex("SetFromScript") != 3:
    print("ERROR: GetSetIndex")
Parameters:

[in] – name Set name

Return type:

int

Returns:

Set index

openvsp.vsp.GetSetName(index)

Get the name of a set at specified index

SetSetName( 3, "SetFromScript" )

if GetSetName(3) != "SetFromScript":
    print("---> Error: API Get/Set Set Name")

See also: SET_TYPE :param [in]: index Set index :rtype: string :return: Set name

openvsp.vsp.GetStringAnalysisInput(analysis, name, index=0)

Get the current string values for the particular analysis, input, and data index

fileNameInput = GetStringAnalysisInput( "ParasiteDrag", "FileName" )

fileNameInput = ["ParasiteDragExample"]

SetStringAnalysisInput( "ParasiteDrag", "FileName", fileNameInput )

See also: RES_DATA_TYPE, SetStringAnalysisInput :param [in]: analysis string Analysis name :param [in]: name string Input name :param [in]: index int Data index :rtype: std::vector< std::string,std::allocator< std::string > > :return: vector<string> Array of analysis input values

openvsp.vsp.GetStringResults(id, name, index=0)

Get all string values for a particular result, name, and index

#==== Write Some Fake Test Results =====//
WriteTestResults()

res_id = FindResultsID( "Test_Results" )

str_arr = GetStringResults( res_id, "Test_String" )

if ( str_arr[0] != "This Is A Test" ): print( "---> Error: API GetStringResults" )
Parameters:
  • [in] – id Result ID

  • [in] – name Data name

  • [in] – index Data index

Return type:

std::vector< std::string,std::allocator< std::string > >

Returns:

Array of data values

openvsp.vsp.GetSubSurf(*args)

Overload 1:

Get the ID of the specified sub-surface

wid = AddGeom( "WING", "" ) # Add Wing

ss_rec_1 = AddSubSurf( wid, SS_RECTANGLE ) # Add Sub Surface Rectangle #1

ss_rec_2 = AddSubSurf( wid, SS_RECTANGLE ) # Add Sub Surface Rectangle #2

print( ss_rec_2, False )

print( " = ", False )

print( GetSubSurf( wid, 1 ) )
Parameters:
  • [in] – geom_id string Geom ID

  • [in] – index Sub-surface index

Return type:

string

Returns:

Sub-surface ID


Overload 2:

Get the ID of the specified sub-surface

wid = AddGeom( "WING", "" ) # Add Wing

ss_rec_1 = AddSubSurf( wid, SS_RECTANGLE ) # Add Sub Surface Rectangle #1

ss_rec_2 = AddSubSurf( wid, SS_RECTANGLE ) # Add Sub Surface Rectangle #2

print( ss_rec_2, False )

print( " = ", False )

print( GetSubSurf( wid, 1 ) )
Parameters:
  • [in] – geom_id string Geom ID

  • [in] – name string Sub surface name

Return type:

std::vector< std::string,std::allocator< std::string > >

Returns:

vector<string> Vector of sub-surface ID

openvsp.vsp.GetSubSurfIDVec(geom_id)

Get a vector of all sub-surface IDs for the specified geometry

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

id_vec = GetSubSurfIDVec( wid )

id_type_str = "SubSurface IDs and Type Indexes -> "

for i in range(len(id_vec)):

    id_type_str += id_vec[i]

    id_type_str += ": "

    id_type_str += f'{GetSubSurfType(id_vec[i])}'

    id_type_str += "\t"

id_type_str += "\n"

print( id_type_str )
Parameters:

[in] – geom_id string Geom ID

Return type:

std::vector< std::string,std::allocator< std::string > >

Returns:

vector<int> Array of sub-surface IDs

openvsp.vsp.GetSubSurfIndex(sub_id)

Get the index of the specified sub-surface in its parent Geom’s sub-surface vector

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

ind = GetSubSurfIndex( ss_rec_id )

ind_str = f"Index of SS_Rectangle: {ind}"

print( ind_str )
Parameters:

[in] – sub_id string Sub-surface ID

Return type:

int

Returns:

int Sub-surface index

openvsp.vsp.GetSubSurfName(*args)

Overload 1:

Get the name of the specified sub-surface

wid = AddGeom( "WING", "" )                             # Add Wing

ss_rec_id = AddSubSurf( wid, SS_RECTANGLE )                        # Add Sub Surface Rectangle

rec_name = GetSubSurfName( wid, ss_rec_id )

name_str = "Current Name of SS_Rectangle: " + rec_name + "\n"

print( name_str )
Parameters:
  • [in] – geom_id string Geom ID

  • [in] – sub_id string Sub-surface ID

Return type:

string

Returns:

Sub-surface name


Overload 2:

Get the name of the specified sub-surface

wid = AddGeom( "WING", "" )                             # Add Wing

ss_rec_id = AddSubSurf( wid, SS_RECTANGLE )                        # Add Sub Surface Rectangle

rec_name = GetSubSurfName( wid, ss_rec_id )

name_str = "Current Name of SS_Rectangle: " + rec_name + "\n"

print( name_str )
Parameters:

[in] – sub_id string Sub-surface ID

Return type:

string

Returns:

string Sub-surface name

openvsp.vsp.GetSubSurfParmIDs(sub_id)

Get the vector of Parm IDs for specified sub-surface

wid = AddGeom( "WING", "" )                             # Add Wing

ss_line_id = AddSubSurf( wid, SS_LINE )                      # Add Sub Surface Line

# Get and list all Parm info for SS_Line
parm_id_vec = GetSubSurfParmIDs( ss_line_id )

for i in range(len(parm_id_vec)):

    id_name_str = "\tName: " + GetParmName(parm_id_vec[i]) + ", Group: " + GetParmDisplayGroupName(parm_id_vec[i]) + ", ID: " + str(parm_id_vec[i]) + "\n"


    print( id_name_str )
Parameters:

[in] – sub_id string Sub-surface ID

Return type:

std::vector< std::string,std::allocator< std::string > >

Returns:

vector<string> Vector of Parm IDs

openvsp.vsp.GetSubSurfType(sub_id)

Get the type for the specified sub-surface (i.e. SS_RECTANGLE)

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

id_vec = GetSubSurfIDVec( wid )

id_type_str = "SubSurface IDs and Type Indexes -> "

for i in range(len(id_vec)):

    id_type_str += id_vec[i]

    id_type_str += ": "

    id_type_str += f'{GetSubSurfType(id_vec[i])}'

    id_type_str += "\t"

id_type_str += "\n"

print( id_type_str )

See also: SUBSURF_TYPE :param [in]: sub_id string Sub-surface ID :rtype: int :return: int Sub-surface type enum (i.e. SS_RECTANGLE)

openvsp.vsp.GetTotalNumSurfs(geom_id)

Get the total number of surfaces for the specified Geom. This is equivalent to the number of main surface multiplied by the number of symmetric copies.

#==== Add Wing Geometry ====//
wing_id = AddGeom( "WING" )

num_surf = 0

num_surf = GetTotalNumSurfs( wing_id ) # Wings default with XZ symmetry on -> 2 surfaces

print( "Total Number of Wing Surfaces: ", False )

print( num_surf )
Parameters:

[in] – geom_id string Geom ID

Return type:

int

Returns:

Number of main surfaces

openvsp.vsp.GetUWTess01(geom_id, surf_indx)

Get the surface coordinate point of each intersection of the tessellated wireframe for a particular surface

# Add Pod Geom
geom_id = AddGeom( "POD", "" )

surf_indx = 0

utess, wtess = GetUWTess01( geom_id, surf_indx )
Parameters:
  • [in] – geom_id string Parent Geom ID

  • [in] – surf_indx int Main surface index from the parent Geom

  • [out] – u_out_vec vector<double> Output vector of U (0 - 1) surface coordinates

  • [out] – w_out_vec vector<double> Output vector of W (0 - 1) surface coordinates

openvsp.vsp.GetUnsteadyGroupCompIDs(group_index)

Get an array of IDs for all components in the unsteady group at the specified index.

# Add a pod and wing
pod_id = AddGeom( "POD", "" )
wing_id = AddGeom( "WING", pod_id ) # Default with symmetry on -> 2 surfaces

SetParmVal( wing_id, "X_Rel_Location", "XForm", 2.5 )
Update()

comp_ids = GetUnsteadyGroupCompIDs( 0 )

if  len(comp_ids) != 3 :
    print( "ERROR: GetUnsteadyGroupCompIDs" )

See also: GetUnsteadyGroupSurfIndexes :param [in]: group_index Unsteady group index for the current VSPAERO set :rtype: std::vector< std::string,std::allocator< std::string > > :return: Array of component IDs

openvsp.vsp.GetUnsteadyGroupName(group_index)

Get the name of the unsteady group at the specified index.

# Add a pod and wing
pod_id = AddGeom( "POD", "" )
wing_id = AddGeom( "WING", pod_id )

SetParmVal( wing_id, "X_Rel_Location", "XForm", 2.5 )
Update()

print( GetUnsteadyGroupName( 0 ) )

See also: SetUnsteadyGroupName :param [in]: group_index Unsteady group index for the current VSPAERO set :rtype: string :return: Unsteady group name

openvsp.vsp.GetUnsteadyGroupSurfIndexes(group_index)

Get an array of surface indexes for all components in the unsteady group at the specified index.

# Add a pod and wing
pod_id = AddGeom( "POD", "" )
wing_id = AddGeom( "WING", pod_id ) # Default with symmetry on -> 2 surfaces

SetParmVal( wing_id, "X_Rel_Location", "XForm", 2.5 )
Update()

surf_indexes = GetUnsteadyGroupSurfIndexes( 0 )

if  len(surf_indexes) != 3 :
    print( "ERROR: GetUnsteadyGroupSurfIndexes" )

See also: GetUnsteadyGroupCompIDs :param [in]: group_index Unsteady group index for the current VSPAERO set :rtype: std::vector< int,std::allocator< int > > :return: Array of surface indexes

openvsp.vsp.GetUpperCSTCoefs(xsec_id)

Get the CST coefficients for the upper surface of an airfoil. The XSec must be of type XS_CST_AIRFOIL See also: SetUpperCST :param [in]: xsec_id string XSec ID :rtype: std::vector< double,std::allocator< double > > :return: vector<double> Vector of CST coefficients for the upper airfoil surface

openvsp.vsp.GetUpperCSTDegree(xsec_id)

Get the CST degree for the upper surface of an airfoil. The XSec must be of type XS_CST_AIRFOIL See also: SetUpperCST :param [in]: xsec_id string XSec ID :rtype: int :return: int CST Degree for upper airfoil surface

openvsp.vsp.GetUserParmContainer()

Get the user parm container ID

up_id = GetUserParmContainer()
Return type:

string

Returns:

User parm container ID

openvsp.vsp.GetVKTAirfoilCpDist(alpha, epsilon, kappa, tau, xyz_data)

Get the pressure coefficient (Cp) along a Von Kármán-Trefftz airfoil of specified shape at specified points along the airfoil

pi = 3.14159265358979323846

npts = 122

alpha = 0.0

epsilon = 0.1

kappa = 0.1

tau = 10

xyz_airfoil = GetVKTAirfoilPnts(npts, alpha, epsilon, kappa, tau*(pi/180) )

cp_dist = GetVKTAirfoilCpDist( alpha, epsilon, kappa, tau*(pi/180), xyz_airfoil )

See also: GetVKTAirfoilPnts :param [in]: alpha double Airfoil angle of attack (Radians) :param [in]: epsilon double Airfoil thickness :param [in]: kappa double Airfoil camber :param [in]: tau double Airfoil trailing edge angle (Radians) :param [in]: xyz_data vector<vec3d> Vector of points on the airfoil to evaluate :rtype: std::vector< double,std::allocator< double > > :return: vector<double> Vector of Cp values for each point in xydata

openvsp.vsp.GetVKTAirfoilPnts(npts, alpha, epsilon, kappa, tau)

Get the 2D coordinates an input number of points along a Von K�rm�n-Trefftz airfoil of specified shape

pi = 3.14159265358979323846

npts = 122

alpha = 0.0

epsilon = 0.1

kappa = 0.1

tau = 10

xyz_airfoil = GetVKTAirfoilPnts(npts, alpha, epsilon, kappa, tau*(pi/180) )

cp_dist = GetVKTAirfoilCpDist( alpha, epsilon, kappa, tau*(pi/180), xyz_airfoil )
Parameters:
  • [in] – npts Number of points along the airfoil to return

  • [in] – alpha Airfoil angle of attack (Radians)

  • [in] – epsilon Airfoil thickness

  • [in] – kappa Airfoil camber

  • [in] – tau Airfoil trailing edge angle (Radians)

Return type:

std::vector< vec3d,std::allocator< vec3d > >

Returns:

Array of points on the VKT airfoil (size = npts)

openvsp.vsp.GetVSPAEROControlGroupName(CSGroupIndex)

Get the name of 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

SetVSPAEROControlGroupName( "Example_CS_Group", group_index )

print( "CS Group name: ", False )

print( GetVSPAEROControlGroupName( group_index ) )
Parameters:

[in] – CSGroupIndex Index of the control surface group

openvsp.vsp.GetVSPAEROPath()

Get the path that OpenVSP will use to look for all VSPAERO executables (Solver, Slicer, and Viewer) when attempting to execute VSPAERO. If the VSPAERO executables are not in this location, they must either be copied there or the VSPAERO path must be set using SetVSPAEROPath.

if  not CheckForVSPAERO( GetVSPAEROPath() ) :
    print( "VSPAERO is not where OpenVSP thinks it is. I should move the VSPAERO executable or call SetVSPAEROPath." )

See also: GetVSPExePath, CheckForVSPAERO, SetVSPAEROPath :rtype: string :return: Path OpenVSP will look for VSPAERO

openvsp.vsp.GetVSPAERORefWingID()

Get ID of the current VSPAERO reference Geom :rtype: string :return: Reference Geom ID

openvsp.vsp.GetVSPExePath()

Get the path to the OpenVSP executable. OpenVSP will assume that the VSPAERO, VSPSLICER, and VSPVIEWER are in the same directory unless instructed otherwise.

print( "The current VSP executable path is: ", False )

print( GetVSPExePath() )

See also: SetVSPAEROPath, CheckForVSPAERO, GetVSPAEROPath :rtype: string :return: Path to the OpenVSP executable

openvsp.vsp.GetVSPFileName()

Get the file name of the current OpenVSP project

fid = AddGeom( "FUSELAGE", "" )             # Add Fuselage

fname = "example_fuse.vsp3"

SetVSP3FileName( fname )

Update()

#==== Save Vehicle to File ====//
print( "\tSaving vehicle file to: ", False )

print( fname )

WriteVSPFile( GetVSPFileName(), SET_ALL )
Return type:

string

Returns:

File name for the current OpenVSP project

openvsp.vsp.GetVSPVersion()

Get the version of the OpenVSP instance currently running

print( "The current OpenVSP version is: ", False )

print( GetVSPVersion() )
Return type:

string

Returns:

OpenVSP version string (i.e. “OpenVSP 3.17.1”)

openvsp.vsp.GetVSPVersionChange()

Get the change version of the OpenVSP instance currently running as an integer

print( "The current OpenVSP version is: ", False )

major = GetVSPVersionMajor()
minor = GetVSPVersionMinor()
change = GetVSPVersionChange()

print( f"{major}.{minor}.{change}" )
Return type:

int

Returns:

OpenVSP change version number (i.e. Y in 3.X.Y)

openvsp.vsp.GetVSPVersionMajor()

Get the major version of the OpenVSP instance currently running as an integer

print( "The current OpenVSP version is: ", False )

major = GetVSPVersionMajor()
minor = GetVSPVersionMinor()
change = GetVSPVersionChange()

print( f"{major}.{minor}.{change}" )
Return type:

int

Returns:

OpenVSP major version number (i.e. 3 in 3.X.Y)

openvsp.vsp.GetVSPVersionMinor()

Get the minor version of the OpenVSP instance currently running as an integer

print( "The current OpenVSP version is: ", False )

major = GetVSPVersionMajor()
minor = GetVSPVersionMinor()
change = GetVSPVersionChange()

print( f"{major}.{minor}.{change}" )
Return type:

int

Returns:

OpenVSP minor version number (i.e. X in 3.X.Y)

openvsp.vsp.GetVarPresetGroupNames()

Get all Variable Preset group names

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "Tess" )

if  len(GetVarPresetGroupNames()) != 1 : print( "---> Error: API AddVarPresetGroup" )
Return type:

std::vector< std::string,std::allocator< std::string > >

Returns:

Array of Variable Presets group names

openvsp.vsp.GetVarPresetParmIDs()

Get the Parm IDs contained in the currently active Variable Presets group

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "Tess" )

AddVarPresetSetting( "Coarse" )

p1 = FindParm( pod1, "Tess_U", "Shape" )

AddVarPresetParm( p1 )

p_IDs = GetVarPresetParmIDs()

if  len(p_IDs) != 1 : print( "---> Error: API AddVarPresetParm" )
Return type:

std::vector< std::string,std::allocator< std::string > >

Returns:

Array of Variable Presets Parm IDs

openvsp.vsp.GetVarPresetParmIDsWName(group_name)

Get the Parm IDs contained in the specitied Variable Presets group

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "New_Group" )

AddVarPresetSetting( "New_Setting_1" )
AddVarPresetSetting( "New_Setting_2" )

p1 = FindParm( pod1, "Y_Rel_Rotation", "XForm" )
p2 = FindParm( pod1, "Z_Rel_Rotation", "XForm" )

AddVarPresetParm( p1 )
AddVarPresetParm( p2 )

parm_ids = GetVarPresetParmIDsWName( "New_Group" )

if  len(parm_ids) != 2 : print( "---> Error: API GetVarPresetParmIDsWName" )
Parameters:

[in] – group_name Variable Presets group name

Return type:

std::vector< std::string,std::allocator< std::string > >

Returns:

Array of Parm IDs

openvsp.vsp.GetVarPresetParmVals()

Get the value of each Parm in the currently active Variable Preset group and setting

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "Tess" )

AddVarPresetSetting( "Coarse" )

p1 = FindParm( pod1, "Tess_U", "Shape" )

AddVarPresetParm( p1 )

EditVarPresetParm( p1, 5 )

p_vals = GetVarPresetParmVals()

if  p_vals[0] != 5 : print ( "---> Error: API EditVarPresetParm" )
Return type:

std::vector< double,std::allocator< double > >

Returns:

Array of Variable Presets Parm values

openvsp.vsp.GetVarPresetParmValsWNames(group_name, setting_name)

Get the value of each Parm in the specified Variable Preset group and setting param [in] group_name Variable Presets group name param [in] setting_name Variable Presets setting name

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "New_Group" )

AddVarPresetSetting( "New_Setting_1" )
AddVarPresetSetting( "New_Setting_2" )

p1 = FindParm( pod1, "Y_Rel_Rotation", "XForm" )
p2 = FindParm( pod1, "Z_Rel_Rotation", "XForm" )

AddVarPresetParm( p1 )
AddVarPresetParm( p2 )

EditVarPresetParm( p2, 2, "New_Group", "New_Setting_2" )

parm_vals = GetVarPresetParmValsWNames( "New_Group", "New_Setting_2" )

if  len(parm_vals) != 2 : print( "---> Error: API GetVarPresetParmValsWNames" )
Return type:

std::vector< double,std::allocator< double > >

Returns:

Array of Variable Presets Parm values

openvsp.vsp.GetVarPresetSettingNamesWIndex(group_index)

Get the name of each settings in the specified Variable Presets group index

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "Tess" )

AddVarPresetSetting( "Coarse" )

p1 = FindParm( pod1, "Tess_U", "Shape" )

AddVarPresetParm( p1 )

AddVarPresetGroup( "New_Group" )

AddVarPresetSetting( "New_Setting_1" )
AddVarPresetSetting( "New_Setting_2" )

group_1_settings = GetVarPresetSettingNamesWIndex( 1 )

if  len(group_1_settings) != 2 : print( "---> Error: API GetVarPresetSettingNamesWIndex" )
Parameters:

[in] – group_index Variable Presets group index

Return type:

std::vector< std::string,std::allocator< std::string > >

Returns:

Array of Variable Presets setting names

openvsp.vsp.GetVarPresetSettingNamesWName(group_name)

Get the name of each settings in the specified Variable Presets group name

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "Tess" )

AddVarPresetSetting( "Coarse" )

if len(GetVarPresetSettingNamesWName( "Tess" )) != 1 : print( "---> Error: API AddVarPresetSetting" )
Parameters:

[in] – group_name Variable Presets group name

Return type:

std::vector< std::string,std::allocator< std::string > >

Returns:

Array of Variable Presets setting names

openvsp.vsp.GetVec3dAnalysisInput(analysis, name, index=0)

Get the current vec3d values for the particular analysis, input, and data index

# PlanarSlice
norm = GetVec3dAnalysisInput( "PlanarSlice", "Norm" )

norm[0].set_xyz( 0.23, 0.6, 0.15 )

SetVec3dAnalysisInput( "PlanarSlice", "Norm", norm )

See also: RES_DATA_TYPE, SetVec3dAnalysisInput :param [in]: analysis string Analysis name :param [in]: name string Input name :param [in]: index int Data index :rtype: std::vector< vec3d,std::allocator< vec3d > > :return: vector<vec3d> Array of analysis input values

openvsp.vsp.GetVec3dResults(id, name, index=0)

Get all vec3d values for a particular result, name, and index

#==== Write Some Fake Test Results =====//

tol = 0.00001

WriteTestResults()

res_id = FindLatestResultsID( "Test_Results" )

vec3d_vec = GetVec3dResults( res_id, "Test_Vec3d" )

print( "X: ", False )
print( vec3d_vec[0].x(), False )

print( "\tY: ", False )
print( vec3d_vec[0].y(), False )

print( "\tZ: ", False )
print( vec3d_vec[0].z() )
Parameters:
  • [in] – id Result ID

  • [in] – name Data name

  • [in] – index Data index

Return type:

std::vector< vec3d,std::allocator< vec3d > >

Returns:

Array of data values

openvsp.vsp.GetVehicleID()

Get the ID of the Vehicle Parm Container

#===== Get Vehicle Parm Container ID ====//
veh_id = GetVehicleID()
Return type:

string

Returns:

Vehicle ID

openvsp.vsp.GetXSec(xsec_surf_id, xsec_index)

Get Xsec ID for a particular XSecSurf at given index

# Add Stack
sid = AddGeom( "STACK", "" )

# Get First (and Only) XSec Surf
xsec_surf = GetXSecSurf( sid, 0 )

# Identify XSec 1
xsec_1 = GetXSec( xsec_surf, 1 )
Parameters:
  • [in] – xsec_surf_id XSecSurf ID

  • [in] – xsec_index Xsec index

Return type:

string

Returns:

Xsec ID

openvsp.vsp.GetXSecHeight(xsec_id)

Get the height of an XSec. Note that POINT type XSecs have a width and height of 0, regardless of what width and height it is set to.

# Add Fuselage Geom
fuseid = AddGeom( "FUSELAGE", "" )

xsec_surf = GetXSecSurf( fuseid, 0 )

xsec = GetXSec( xsec_surf, GetNumXSec( xsec_surf ) - 2 ) # Get 2nd to last XSec

SetXSecWidthHeight( xsec, 3.0, 6.0 )

if  abs( GetXSecHeight( xsec ) - 6.0 ) > 1e-6 : print( "---> Error: API Get/Set Width " )

See also: SetXSecHeight :param [in]: xsec_id XSec ID :rtype: float :return: Xsec height

openvsp.vsp.GetXSecParm(xsec_id, name)

Get a specific Parm ID from an Xsec

# 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" )

if  not ValidParm( wid ) : print( "---> Error: API GetXSecParm " )
Parameters:
  • [in] – xsec_id XSec ID

  • [in] – name Parm name

Return type:

string

Returns:

Parm ID

openvsp.vsp.GetXSecParmIDs(xsec_id)

Get all Parm IDs for specified XSec Parm Container

# Add Fuselage Geom
fuseid = AddGeom( "FUSELAGE", "" )

xsec_surf = GetXSecSurf( fuseid, 0 )

xsec = GetXSec( xsec_surf, GetNumXSec( xsec_surf ) - 1 )

parm_array = GetXSecParmIDs( xsec )

if  len(parm_array) < 1 : print( "---> Error: API GetXSecParmIDs " )
Parameters:

[in] – xsec_id XSec ID

Return type:

std::vector< std::string,std::allocator< std::string > >

Returns:

Array of Parm IDs

openvsp.vsp.GetXSecShape(xsec_id)

Get the shape of an XSec

# Add Stack
sid = AddGeom( "STACK", "" )

# Get First (and Only) XSec Surf
xsec_surf = GetXSecSurf( sid, 0 )

ChangeXSecShape( xsec_surf, 1, XS_EDIT_CURVE )

xsec = GetXSec( xsec_surf, 1 )

if  GetXSecShape( xsec ) != XS_EDIT_CURVE : print( "ERROR: GetXSecShape" )

See also: XSEC_CRV_TYPE :param [in]: xsec_id XSec ID :rtype: int :return: XSec type enum (i.e. XS_ELLIPSE)

openvsp.vsp.GetXSecSurf(geom_id, index)

Get the XSecSurf ID for a particular Geom and XSecSurf index

# Add Stack
sid = AddGeom( "STACK", "" )

# Get First (and Only) XSec Surf
xsec_surf = GetXSecSurf( sid, 0 )
Parameters:
  • [in] – geom_id string Geom ID

  • [in] – index XSecSurf index

Return type:

string

Returns:

XSecSurf ID

openvsp.vsp.GetXSecSurfGlobalXForm(xsec_surf_id)

Get the global surface transform matrix for given XSecSurf :param [in]: xsec_surf_id XSecSurf ID :rtype: Matrix4d :return: Transformation matrix

openvsp.vsp.GetXSecWidth(xsec_id)

Get the width of an XSec. Note that POINT type XSecs have a width and height of 0, regardless of what width and height it is set to.

# Add Fuselage Geom
fuseid = AddGeom( "FUSELAGE", "" )

xsec_surf = GetXSecSurf( fuseid, 0 )

xsec = GetXSec( xsec_surf, GetNumXSec( xsec_surf ) - 2 ) # Get 2nd to last XSec

SetXSecWidthHeight( xsec, 3.0, 6.0 )

if  abs( GetXSecWidth( xsec ) - 3.0 ) > 1e-6 : print( "---> Error: API Get/Set Width " )

See also: SetXSecWidth :param [in]: xsec_id XSec ID :rtype: float :return: Xsec width

openvsp.vsp.HEIGHT_XSEC_DRIVER = 2

Height driver

openvsp.vsp.HINGE_GEOM_SCREEN = 9

Hinge geom screen

openvsp.vsp.HUMAN_GEOM_SCREEN = 15

Human geom screen

openvsp.vsp.HWRATIO_XSEC_DRIVER = 3

Height/width ratio driver

openvsp.vsp.HideAllBackground3Ds()

Hide all Background3Ds in model

# Add Background3D
AddBackground3D()
AddBackground3D()
AddBackground3D()

HideAllBackground3Ds()

DelAllBackground3Ds()
openvsp.vsp.IMPORT_BEM = 6

Blade Element (*.bem) import

openvsp.vsp.IMPORT_CART3D_TRI = 2

Cart3D (*.try) import

openvsp.vsp.IMPORT_NASCART = 1

NASCART (*.dat) import

openvsp.vsp.IMPORT_P3D_WIRE = 8

Plot3D as Wireframe (*.p3d) import

openvsp.vsp.IMPORT_PTS = 4

Point Cloud (*.pts) import

openvsp.vsp.IMPORT_STL = 0

Stereolith (*.stl) import

openvsp.vsp.IMPORT_V2 = 5

OpenVSP v2 (*.vsp) import

openvsp.vsp.IMPORT_XSEC_MESH = 3

XSec as Tri Mesh (*.hrm) import

openvsp.vsp.IMPORT_XSEC_WIRE = 7

XSec as Wireframe (*.hrm) import

openvsp.vsp.INSIDE = 0

The interior of the sub-surface is its surface

openvsp.vsp.INTERSECT_CURV_FILE_NAME = 1

CURV intersection file type

openvsp.vsp.INTERSECT_IGES_FILE_NAME = 3

IGES intersection file type

openvsp.vsp.INTERSECT_NUM_FILE_NAMES = 5

Number of surface intersection file types

openvsp.vsp.INTERSECT_PLOT3D_FILE_NAME = 2

PLOT3D intersection file type

openvsp.vsp.INTERSECT_SRF_FILE_NAME = 0

SRF intersection file type

openvsp.vsp.INTERSECT_STEP_FILE_NAME = 4

STEP intersection file type

openvsp.vsp.INT_DATA = 0

Integer result data type

openvsp.vsp.INVALID_TYPE = -1

Invalid result data type

openvsp.vsp.ImportFile(file_name, file_type, parent)

Import a file into OpenVSP. Many formats are available, such as NASCART, V2, and BEM). The imported Geom, mesh, or other object is inserted as a child of the specified parent. If no parent or an invalid parent is given, the import will be done at the top level. See also: IMPORT_TYPE :param [in]: file_name Import file name :param [in]: file_type File type enum (i.e. IMPORT_PTS) :param [in]: parent Parent Geom ID (ignored with empty string)

openvsp.vsp.InitGUI()

Initialize the GUI so it can be called from the API. Must be called before other GUI related API calls. In a multi-threaded environment, this must be called from the main thread only.

InitGUI()
StartGUI()

See also: StartGUI

openvsp.vsp.InsertVSPFile(file_name, parent_geom_id)

Insert an external OpenVSP project into the current project. All Geoms in the external project are placed as children of the specified parent. If no parent or an invalid parent is given, the Geoms are inserted at the top level. :param [in]: file_name string *.vsp3 filename :param [in]: parent_geom_id string Parent geom ID (ignored with empty string)

openvsp.vsp.InsertXSec(geom_id, index, type)

Insert a cross-section of particular type to the specified geometry after the given index

wing_id = AddGeom( "WING" )

#===== Add XSec ====//
InsertXSec( wing_id, 1, XS_SIX_SERIES )

See also: XSEC_CRV_TYPE :param [in]: geom_id string Geom ID :param [in]: index XSec index :param [in]: type XSec type enum (i.e. XS_GENERAL_FUSE)

openvsp.vsp.InsideSurf(geom_id, surf_indx, pt)

Test whether a given point is inside a specified surface.

# 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 )

res = InsideSurf( geom_id, surf_indx, pnt )

if  res :
    print( "Inside" )
else:
    print( "Outside" )

See also: VecInsideSurf :param [in]: geom_id string Parent Geom ID :param [in]: surf_indx int Main surface index from the parent Geom :param [in]: pt Input 3D coordinate point :rtype: boolean :return: Boolean true if the point is inside the surface, false otherwise.

class openvsp.vsp.IntVector(*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.IntegrateEllipsoidFlow(vec3d abc_rad, int const & abc_index) double
openvsp.vsp.IsFacade()

Returns True if the facade API is in use.

is_facade = IsFacade()
openvsp.vsp.IsGUIBuild()

Test if the current OpenVSP build includes graphics capabilities.

if ( IsGUIBuild() ):
    print( "OpenVSP build is graphics capable." )
else:
    print( "OpenVSP build is not graphics capable." )
Return type:

boolean

Returns:

bool True if the current OpenVSP build includes graphics capabilities. False otherwise.

openvsp.vsp.IsGUIRunning()

Returns True if the GUI event loop is running.

is_gui_active = IsGUIRunning()
openvsp.vsp.LEN_CM = 1

Centimeter

openvsp.vsp.LEN_FT = 4

Feet

openvsp.vsp.LEN_IN = 3

Inch

openvsp.vsp.LEN_M = 2

Meter

openvsp.vsp.LEN_MM = 0

Millimeter

openvsp.vsp.LEN_UNITLESS = 6

Unitless

openvsp.vsp.LEN_YD = 5

Yard

openvsp.vsp.LE_NORMAL = 1

FEA Rib or Rib Array is set perpendicular to the leading edge

openvsp.vsp.LINEAR = 0

Linear curve type

openvsp.vsp.LINE_SOURCE = 1

Line source

openvsp.vsp.L_TRIM = 1

Trim by L coordinate

openvsp.vsp.ListAnalysis()

Get the name of every available analysis in the Analysis Manager

analysis_array = ListAnalysis()

print( "List of Available Analyses: " )

for i in range(int( len(analysis_array) )):

    print( "    " + analysis_array[i] )
Return type:

std::vector< std::string,std::allocator< std::string > >

Returns:

Array of analysis names

openvsp.vsp.Lock()

Obtain the lock on the OpenVSP GUI event loop. This will prevent the interactive GUI from updating or accepting user input until the lock is released – thereby allowing longer-time commands including analyses to execute without the chance of the OpenVSP state changing during execution.

InitGUI()
StartGUI()

pod_id = AddGeom( "POD" )

Lock()
rid = ExecAnalysis( "CompGeom" )

mesh_id_vec = GetStringResults( rid, "Mesh_GeomID" )

DeleteGeomVec( mesh_id_vec )
Unlock()

See also: Unlock

openvsp.vsp.MALE = 0

Male Human component

openvsp.vsp.MANUAL_REF = 0

Manually specify the reference areas and lengths

openvsp.vsp.MASS_LBFSEC2IN = 5

lbf*sec^2/in

openvsp.vsp.MASS_UNIT_G = 0

Gram

openvsp.vsp.MASS_UNIT_KG = 1

Kilogram

openvsp.vsp.MASS_UNIT_LBM = 3

Pound-mass

openvsp.vsp.MASS_UNIT_SLUG = 4

Slug

openvsp.vsp.MASS_UNIT_TONNE = 2

Tonne

openvsp.vsp.MAX_CAMB = 0

Input maximum camber, calculate ideal lift coefficient

openvsp.vsp.MAX_LEN_CONSTRAINT = 1

Maximum edge length.

openvsp.vsp.MAX_NUM_SETS = 1000

Maximum possible number of sets

openvsp.vsp.MESH_GEOM_SCREEN = 4

Mesh geom screen

openvsp.vsp.MESH_INDEXED_TRI = 0

Indexed triangulated mesh Geom type

openvsp.vsp.MESH_INDEX_AND_SLICE_TRI = 3

Both indexed and sliced triangulated mesh Geom type

openvsp.vsp.MESH_SLICE_TRI = 1

Sliced Triangulated mesh Geom type

openvsp.vsp.MIN_GROW_LIMIT = 10

Reason marker for minimum reason to apply growth limit.

openvsp.vsp.MIN_LEN_CONSTRAINT = 5

Minimum edge length.

openvsp.vsp.MIN_LEN_CONSTRAINT_CURV_GAP = 6

Maximum gap constrained by minimum length.

openvsp.vsp.MIN_LEN_CONSTRAINT_CURV_NCIRCSEG = 7

Number of segments to define a circle constrained by minimum length.

openvsp.vsp.MIN_LEN_CONSTRAINT_SOURCES = 8

Mesh sources constrained by minimum length (not applied).

openvsp.vsp.MIN_LEN_INCREMENT = 4

Reason increment when adding minimum length constraint.

openvsp.vsp.MIN_NUM_USER = 20

Minimum number of user sets

openvsp.vsp.MPA_UNIT = 2

FEA Files output in (mm, tonne)

openvsp.vsp.MS_WING_GEOM_SCREEN = 2

Wing geom screen

openvsp.vsp.MULT_GEOM_SCREEN = 10

Multiple geom screen

openvsp.vsp.MapFromPlane(vec2d const & uw, vec3d planeOrig, vec3d planeVec1, vec3d planeVec2) vec3d
openvsp.vsp.MapToPlane(vec3d p, vec3d planeOrig, vec3d planeVec1, vec3d planeVec2) vec2d
class openvsp.vsp.Matrix4d

Bases: object

Matrix4d is typically used to perform rotations, translations, scaling, projections, and other transformations in 3D space.

affineInverse()

Perform an affine transform on the Matrix4d

    #==== Test Matrix4d ====//
Matrix4d m()                            # Default Constructor

m.loadIdentity()

m.rotateY( 10.0 )
m.rotateX( 20.0 )
m.rotateZ( 30.0 )

vec3d c = m.xform( vec3d( 1.0, 1.0, 1.0 ) )

m.affineInverse()
buildXForm(pos, rot, cent_rot)

Translate the Matrix4d to a given position and rotate it a about a given center of rotation :param [in]: pos Position to translate to :param [in]: rot Angle of rotation (degrees) :param [in]: cent_rot Center of rotation

data(Matrix4d self) double *
flipx(Matrix4d self)
getAngles()

Calculate the Matrix4d’s angles between the X, Y and Z axes

    Matrix4d mat
PI = 3.14

mat.loadIdentity()

m.rotate( PI / 4, vec3d( 0.0, 0.0, 1.0 ) )      # Radians

vec3d angles = mat.getAngles()
Return type:

vec3d

Returns:

Angle measurement between each axis (degrees)

getBasis(Matrix4d self, vec3d xdir, vec3d ydir, vec3d zdir)
getMat(Matrix4d self, double * m)
getTranslation(Matrix4d self) vec3d
initMat(Matrix4d self, double const * m)
initMat(Matrix4d self, Matrix4d m) None
loadIdentity()

Create a 4x4 identity matrix

    #==== Test Matrix4d ====//
Matrix4d m()                            # Default Constructor
m.loadIdentity()
Return type:

void

Returns:

Identity Matrix4d

loadXYRef()

Load an identy Matrix4d and set the Z coordinate of the diagonal (index 10) to -1

    #==== Test Matrix4d ====//
Matrix4d m()                            # Default Constructor

m.loadXYRef()

vec3d b = m.xform( vec3d( 1, 2, 3 ) )
loadXZRef()

Load an identy Matrix4d and set the Y coordinate of the diagonal (index 5) to -1

    #==== Test Matrix4d ====//
Matrix4d m()                            # Default Constructor

m.loadXZRef()

vec3d b = m.xform( vec3d( 1, 2, 3 ) )
loadYZRef()

Load an identy Matrix4d and set the X coordinate of the diagonal (index 0) to -1

    #==== Test Matrix4d ====//
Matrix4d m()                            # Default Constructor

m.loadYZRef()

vec3d b = m.xform( vec3d( 1, 2, 3 ) )
matMult(Matrix4d self, double const * m)
matMult(Matrix4d self, Matrix4d m) None
mult(Matrix4d self, double const [4] _in, double [4] out)
postMult(Matrix4d self, double const * m)
postMult(Matrix4d self, Matrix4d m) None
rotate(angle, axis)

Rotate the Matrix4d about an arbitrary axis

    #==== Test Matrix4d ====//
Matrix4d m()                            # Default Constructor
PI = 3.14

m.loadIdentity()

m.rotate( PI / 4, vec3d( 0.0, 0.0, 1.0 ) )      # Radians
Parameters:
  • [in] – ang Angle of rotation (rad)

  • [in] – axis Vector to rotate about

rotateX(ang)

Rotate the Matrix4d about the X axis

    #==== Test Matrix4d ====//
Matrix4d m()                            # Default Constructor

m.loadIdentity()

m.rotateX( 90.0 )
Parameters:

[in] – ang Angle of rotation (degrees)

rotateY(ang)

Rotate the Matrix4d about the Y axis

    #==== Test Matrix4d ====//
Matrix4d m()                            # Default Constructor

m.loadIdentity()

m.rotateY( 90.0 )
Parameters:

[in] – ang Angle of rotation (degrees)

rotateZ(ang)

Rotate the Matrix4d about the Z axis

    #==== Test Matrix4d ====//
Matrix4d m()                            # Default Constructor

m.loadIdentity()

m.rotateZ( 90.0 )
Parameters:

[in] – ang Angle of rotation (degrees)

rotatealongX(Matrix4d self, vec3d dir1)
scale(scale)

Multiply the Matrix4d by a scalar value

    #==== Test Matrix4d ====//
Matrix4d m()                            # Default Constructor

m.loadXZRef()

m.scale( 10.0 )
Parameters:

[in] – scale Value to scale by

scalex(Matrix4d self, double const & scalex)
scaley(Matrix4d self, double const & scaley)
scalez(Matrix4d self, double const & scalez)
setBasis(Matrix4d self, vec3d xdir, vec3d ydir, vec3d zdir)
static setIdentity(double * m)
property thisown

The membership flag

toQuat(Matrix4d self, double & qw, double & qx, double & qy, double & qz, double & tx, double & ty, double & tz)
translatef(x, y, z)

Translate the Matrix4d along the given axes values

    #==== Test Matrix4d ====//
Matrix4d m()                            # Default Constructor

m.loadIdentity()

m.translatef( 1.0, 0.0, 0.0 )
Parameters:
  • [in] – x Translation along the X axis

  • [in] – y Translation along the Y axis

  • [in] – z Translation along the Z axis

Return type:

void

Returns:

Translated Matrix4d

translatev(Matrix4d self, vec3d v)
xform(_in)

Transform the Matrix4d by the given vector

    #==== Test Matrix4d ====//
Matrix4d m()                            # Default Constructor

m.loadIdentity()

vec3d a = m.xform( vec3d( 1.0, 2.0, 3.0 ) )
Parameters:

[in] – v Transformation vector

xformmat(Matrix4d self, std::vector< std::vector< vec3d, std::allocator< vec3d > >, std::allocator< std::vector< vec3d, std::allocator< vec3d > > > > & _in)
xformnorm(Matrix4d self, vec3d _in) vec3d
xformnormmat(Matrix4d self, std::vector< std::vector< vec3d, std::allocator< vec3d > >, std::allocator< std::vector< vec3d, std::allocator< vec3d > > > > & _in)
xformnormvec(Matrix4d self, Vec3dVec _in)
xformvec(Matrix4d self, Vec3dVec _in)
zeroTranslations(Matrix4d self)
class openvsp.vsp.Matrix4dVec(*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.MoveEditXSecPnt(xsec_id, indx, new_pnt)

Move an EditCurveXSec control point. The XSec points are nondimensionalized by m_Width and m_Height and defined in 2D, so the Z value of the new coordinate point will be ignored.

# 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 )

# Turn off R/L symmetry
SetParmVal( GetXSecParm( xsec_1, "SymType"), SYM_NONE )

# 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

# Identify a control point that lies on the curve and shift it in Y
move_pnt_ind = 3

new_pnt = vec3d( xsec1_pts[move_pnt_ind].x(), 2 * xsec1_pts[move_pnt_ind].y(), 0.0 )

# Move the control point
MoveEditXSecPnt( xsec_1, move_pnt_ind, new_pnt )

new_pnts = GetEditXSecCtrlVec( xsec_1, True ) # The returned control points will not be scaled by width and height

if  dist( new_pnt, new_pnts[move_pnt_ind] ) > 1e-6 :
    print( "Error: MoveEditXSecPnt" )
Parameters:
  • [in] – xsec_id XSec ID

  • [in] – indx Control point index

  • [in] – new_pnt Coordinate of the new point

openvsp.vsp.NOISE_ENGLISH = 1

Assume geometry and VSPAERO inputs in english (ft lbf slug s) units, will convert to SI (m N kg s) for PSU-WOPWOP

openvsp.vsp.NOISE_FLYBY = 0

Set up fly by noise analysis in VSPAERO for PSU-WOPWOP

openvsp.vsp.NOISE_FOOTPRINT = 1

Set up footprint noise analysis in VSPAERO for PSU-WOPWOP

openvsp.vsp.NOISE_SI = 0

Assume geometry and VSPAERO inputs in SI (m N kg s) for PSU-WOPWOP

openvsp.vsp.NOISE_STEADY = 2

Set up steady state noise analysis in VSPAERO for PSU-WOPWOP

openvsp.vsp.NONE = 2

No part of the parent surface belongs to the sub-surface

openvsp.vsp.NORMAL_SURF = 0

Normal VSP surface

openvsp.vsp.NO_BOUNDARY = 0

No boundary

openvsp.vsp.NO_END_CAP = 0

No end cap

openvsp.vsp.NO_FILE_TYPE = 0

No export file type

openvsp.vsp.NO_NORMAL = 0

FEA Rib or Rib Array has no set perpendicular edge

openvsp.vsp.NO_REASON = 0

No reason determined.

openvsp.vsp.NUM_ALIGN_TYPE = 7

Number of alignment types

openvsp.vsp.NUM_ANG = 4

Number of angle choices

openvsp.vsp.NUM_DEPTH_TYPE = 3

Number of depth types

openvsp.vsp.NUM_END_CAP_OPTIONS = 10

Number of end cap options

openvsp.vsp.NUM_FILE_CHOOSER_MODES = 2

Number of file chooser modes

openvsp.vsp.NUM_FILE_CHOOSER_TYPES = 2

Number of file chooser types

openvsp.vsp.NUM_GDEV_TYPES = 30

Number of GDEV types

openvsp.vsp.NUM_GEOM_SCREENS = 16

Number of geom screens

openvsp.vsp.NUM_LEN_UNIT = 7

Number of length unit types

openvsp.vsp.NUM_MASS_UNIT = 6

Number of mass unit types

openvsp.vsp.NUM_MESH_REASON = 17

Number of reasons that can set the mesh local minimum edge length.

openvsp.vsp.NUM_PCURV_TYPE = 4

Number of curve types

openvsp.vsp.NUM_PRES_UNIT = 11

Number of pressure unit choices

openvsp.vsp.NUM_PROJ_BNDY_OPTIONS = 3

Number of projected area boundary options

openvsp.vsp.NUM_PROJ_DIR_OPTIONS = 5

Number of Projected Area direction types

openvsp.vsp.NUM_PROJ_TGT_OPTIONS = 2

Number of Projected Area target types

openvsp.vsp.NUM_PROP_AZI = 3

Number of propeller blade azimuth modes

openvsp.vsp.NUM_PROP_PCURVE = 9

Number of propeller blade curve parameterization options

openvsp.vsp.NUM_REF_TYPES = 2

Number of wing reference types

openvsp.vsp.NUM_REORDER_TYPES = 4

Number reordering instructions

openvsp.vsp.NUM_RHO_UNIT = 7

Number of density unit options

openvsp.vsp.NUM_SCALE_TYPES = 4

Number of ways to scale 3D background image.

openvsp.vsp.NUM_SOURCE_TYPES = 5

Number of CFD Mesh source types

openvsp.vsp.NUM_SURF_TYPES = 3

Number of VSP surface types

openvsp.vsp.NUM_TEMP_UNIT = 4

Number of temperature unit choices

openvsp.vsp.NUM_TRIM_TYPES = 3

Number of conformal component trim types

openvsp.vsp.NUM_WSECT_DRIVER = 8

Number of wing section drivers

openvsp.vsp.NUM_XSEC_DRIVER = 4

Number of XSec drivers

openvsp.vsp.NumFeaBCs(fea_struct_id)

Return number of FEA BC’s in 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 )

nbc = NumFeaBCs( struct_id )
Parameters:

[in] – string fea_struct_id FEA Structure ID

Return type:

int

Returns:

Number of FEA BCs

openvsp.vsp.NumFeaParts(fea_struct_id)

Get the number of FEA Parts for a particular 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 )

#==== Add FEA Parts ====//
slice_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE )
dome_id = AddFeaPart( pod_id, struct_ind, FEA_DOME )

if  NumFeaParts( struct_id ) != 3 : # Includes FeaSkin

    print( "Error: NumFeaParts" )

See also: GetFeaPartIDVec :param [in]: fea_struct_id FEA Structure ID :rtype: int :return: Number of FEA Parts

openvsp.vsp.NumFeaStructures()

Get the total number of FEA Subsurfaces in the vehicle

#==== Add Pod Geometry ====//
wing_id = AddGeom( "WING" )

#==== Add FeaStructure to Pod ====//
struct_1 = AddFeaStruct( wing_id )
struct_2 = AddFeaStruct( wing_id )

if  NumFeaStructures() != 2 :
    print( "Error: NumFeaStructures" )

See also: GetFeaStructIDVec :rtype: int :return: Total Number of FEA Structures

openvsp.vsp.NumFeaSubSurfs(fea_struct_id)

Get the number of FEA Subsurfaces for a particular FEA Structure

#==== Add Pod Geometry ====//
wing_id = AddGeom( "WING" )

#==== Add FeaStructure to Pod ====//
struct_ind = AddFeaStruct( wing_id )

struct_id = GetFeaStructID( wing_id, struct_ind )

#==== Add SubSurfaces ====//
line_array_id = AddFeaSubSurf( wing_id, struct_ind, SS_LINE_ARRAY )
rectangle_id = AddFeaSubSurf( wing_id, struct_ind, SS_RECTANGLE )

if  NumFeaSubSurfs( struct_id ) != 2 :
    print( "Error: NumFeaSubSurfs" )

See also: GetFeaSubSurfIDVec :param [in]: fea_struct_id FEA Structure ID :rtype: int :return: Number of FEA SubSurfaces

openvsp.vsp.OPEN = 0

Browse files that already exist

openvsp.vsp.OUTSIDE = 1

The exterior of the sub-surface is its surface

openvsp.vsp.PANEL = 1

VSPAERO panel method

openvsp.vsp.PARM_BOOL_TYPE = 2

Bool Parm type (BoolParm)

openvsp.vsp.PARM_DOUBLE_TYPE = 0

Double Parm type (Parm)

openvsp.vsp.PARM_FRACTION_TYPE = 3

Fraction Parm type (FractionParm)

openvsp.vsp.PARM_INT_TYPE = 1

Integer Parm type (IntParm)

openvsp.vsp.PARM_LIMITED_INT_TYPE = 4

Limited integer Parm type (LimIntParm)

openvsp.vsp.PARM_NOTEQ_TYPE = 5

Not equal Parm type (NotEqParm)

openvsp.vsp.PARM_POWER_INT_TYPE = 6

Power integer Parm type (PowIntParm)

openvsp.vsp.PATCH_COPY = 3

Copy patch type

openvsp.vsp.PATCH_HALFWAY = 4

Halfway patch type

openvsp.vsp.PATCH_LINE = 2

Line patch type

openvsp.vsp.PATCH_NONE = 0

No patch

openvsp.vsp.PATCH_NUM_TYPES = 5

Number of patch types

openvsp.vsp.PATCH_POINT = 1

Point patch type

openvsp.vsp.PCHIP = 1

Piecewise Cubic Hermite Interpolating Polynomial curve type

openvsp.vsp.PCurveConvertTo(geom_id, pcurveid, newtype)

Change the type of a propeller blade curve (P Curve) See also: PCURV_TYPE :param [in]: geom_id string Parent Geom ID :param [in]: pcurveid P Curve index :param [in]: newtype Curve type enum (i.e. CEDIT)

openvsp.vsp.PCurveDeletePt(geom_id, pcurveid, indx)

Delete a propeller blade curve (P Curve) point :param [in]: geom_id string Parent Geom ID :param [in]: pcurveid P Curve index :param [in]: indx Point index

openvsp.vsp.PCurveGetTVec(geom_id, pcurveid)

Get the parameters of a propeller blade curve (P Curve). Each parameter is a fraction of propeller radius. :param [in]: geom_id string Parent Geom ID :param [in]: pcurveid P Curve index :rtype: std::vector< double,std::allocator< double > > :return: Array of parameters

openvsp.vsp.PCurveGetType(geom_id, pcurveid)

Get the type of a propeller blade curve (P Curve) See also: PCURV_TYPE :param [in]: geom_id string Parent Geom ID :param [in]: pcurveid P Curve index :rtype: int :return: Curve type enum (i.e. CEDIT)

openvsp.vsp.PCurveGetValVec(geom_id, pcurveid)

Get the values of a propeller blade curve (P Curve). What the values represent id dependent on the curve type (i.e. twist, chord, etc.). :param [in]: geom_id string Parent Geom ID :param [in]: pcurveid P Curve index :rtype: std::vector< double,std::allocator< double > > :return: Array of values

openvsp.vsp.PCurveSplit(geom_id, pcurveid, tsplit)

Split a propeller blade curve (P Curve) at the specified 1D parameter :param [in]: geom_id string Parent Geom ID :param [in]: pcurveid P Curve index :param [in]: tsplit 1D parameter split location :rtype: int :return: Index of new control point

openvsp.vsp.PD_UNITS_IMPERIAL = 0

Imperial unit system

openvsp.vsp.PD_UNITS_METRIC = 1

Metric unit system

openvsp.vsp.POD_GEOM_SCREEN = 0

Pod geom screen

openvsp.vsp.POINT_SOURCE = 0

Point source

openvsp.vsp.PRECON_JACOBI = 1

Jacobi preconditioner

openvsp.vsp.PRECON_MATRIX = 0

Matrix preconditioner

openvsp.vsp.PRECON_SSOR = 2

Symmetric successive over-relaxation preconditioner

openvsp.vsp.PRES_UNIT_ATM = 10

Atmosphere

openvsp.vsp.PRES_UNIT_BA = 2

Barye

openvsp.vsp.PRES_UNIT_INCHHG = 6

Inch of mercury

openvsp.vsp.PRES_UNIT_KPA = 4

Kilopascal

openvsp.vsp.PRES_UNIT_MB = 9

Millibar

openvsp.vsp.PRES_UNIT_MMH20 = 8

Millimeter of water

openvsp.vsp.PRES_UNIT_MMHG = 7

Millimeter of mercury

openvsp.vsp.PRES_UNIT_MPA = 5

Megapascal

openvsp.vsp.PRES_UNIT_PA = 3

Pascal

openvsp.vsp.PRES_UNIT_PSF = 0

Pounds per square foot

openvsp.vsp.PRES_UNIT_PSI = 1

Pounds per square inch

openvsp.vsp.PROP_AXIAL = 7

Axial parameterization

openvsp.vsp.PROP_AZI_BALANCED = 2

Propeller blade balance is enforced

openvsp.vsp.PROP_AZI_FREE = 1

Propeller blades are free to spaced arbitrarially

openvsp.vsp.PROP_AZI_UNIFORM = 0

Propeller blades are uniformly spaced

openvsp.vsp.PROP_BLADES = 0

Propeller Geom is defined by individual propeller blades

openvsp.vsp.PROP_BOTH = 1

Propeller Geom is defined by blades and a disk together

openvsp.vsp.PROP_CHORD = 0

Chord parameterization

openvsp.vsp.PROP_CLI = 6

Induced lift coefficient parameterization

openvsp.vsp.PROP_DISK = 2

Propeller Geom is defined by a flat circular disk

openvsp.vsp.PROP_GEOM_SCREEN = 8

Propeller geom screen

openvsp.vsp.PROP_RAKE = 2

Rake parameterization

openvsp.vsp.PROP_SKEW = 3

Skew parameterization

openvsp.vsp.PROP_SWEEP = 4

Sweep parameterization

openvsp.vsp.PROP_TANGENTIAL = 8

Tangential parameterization

openvsp.vsp.PROP_THICK = 5

Thickness parameterization

openvsp.vsp.PROP_TWIST = 1

Twist parameterization

openvsp.vsp.PT_CLOUD_GEOM_SCREEN = 7

Point cloud geom screen

openvsp.vsp.PasteGeomClipboard(*args)

Paste Geom from clipboard into the model. The Geom is pasted as a child of the specified parent, but will be placed at top level if no parent or an invalid one is provided.

#==== 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  " )
Parameters:

[in] – parent string Parent Geom ID

Return type:

std::vector< std::string,std::allocator< std::string > >

Returns:

vector<string> Vector of pasted Geom IDs

openvsp.vsp.PasteXSec(geom_id, index)

Paste the cross-section currently held in memory to the specified geometry

# Add Stack
sid = AddGeom( "STACK", "" )

# Copy XSec To Clipboard
CopyXSec( sid, 1 )

# Paste To XSec 3
PasteXSec( sid, 3 )

See also: CutXSec, CopyXSec :param [in]: geom_id string Geom ID :param [in]: index XSec index

openvsp.vsp.PopupMsg(msg)

Cause OpenVSP to display a popup message.

InitGUI()
StartGUI()

PopupMsg( "This is a popup message." )
Parameters:

[in] – msg string Message to display.

openvsp.vsp.PrintAnalysisDocs(analysis_name)

Print to stdout all current input documentation for a specific analysis

#==== Analysis: VSPAero Compute Geometry ====//
analysis_name = "VSPAEROComputeGeometry"

# list inputs, type, and documentation
PrintAnalysisDocs( analysis_name )
Parameters:

[in] – analysis_name string Name of analysis

openvsp.vsp.PrintAnalysisInputs(analysis_name)

Print to stdout all current input values for a specific analysis

#==== Analysis: VSPAero Compute Geometry ====//
analysis_name = "VSPAEROComputeGeometry"

# list inputs, type, and current values
PrintAnalysisInputs( analysis_name )
Parameters:

[in] – analysis_name string Name of analysis

openvsp.vsp.PrintResults(results_id)

Print a result’s name value pairs to stdout

# Add Pod Geom
pid = AddGeom( "POD" )

analysis_name = "VSPAEROComputeGeometry"

rid = ExecAnalysis( analysis_name )

# Get & Display Results
PrintResults( rid )
Parameters:

[in] – results_id string Result ID

openvsp.vsp.PrintResultsDocs(results_id)

Print a result’s names and documentation to stdout

# Add Pod Geom
pid = AddGeom( "POD" )

analysis_name = "VSPAEROComputeGeometry"

rid = ExecAnalysis( analysis_name )

# Get & Display Results Docs
PrintResultsDocs( rid )
Parameters:

[in] – results_id string Result ID

openvsp.vsp.ProjPnt01(geom_id, surf_indx, pt)

Determine the nearest surface coordinate for an input 3D coordinate point and calculate the distance between the 3D point and the closest point of the surface.

# Add Pod Geom
geom_id = AddGeom( "POD", "" )

surf_indx = 0

u = 0.12345
w = 0.67890

pnt = CompPnt01( geom_id, surf_indx, u, w )

norm = CompNorm01( geom_id, surf_indx, u, w )


# Offset point from surface
pnt.set_xyz( pnt.x() + norm.x(), pnt.y() + norm.y(), pnt.z() + norm.z() )

d, uout, wout = ProjPnt01( geom_id, surf_indx, pnt )

print( f"Dist {d} u {uout} w {wout}" )

See also: ProjPnt01Guess, ProjPnt01I :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]: u_out double Output closest U (0 - 1) surface coordinate :param [out]: w_out double Output closest W (0 - 1) surface coordinate :rtype: float :return: double Distance between the 3D point and the closest point of the surface

openvsp.vsp.ProjPnt01Guess(geom_id, surf_indx, pt, u0, w0)

Determine the nearest surface coordinate for an input 3D coordinate point and calculate the distance between the 3D point and the closest point of the surface. This function takes an input surface coordinate guess for, offering a potential decrease in computation time compared to ProjPnt01.

# Add Pod Geom
geom_id = AddGeom( "POD", "" )

surf_indx = 0

u = 0.12345
w = 0.67890

d = 0

pnt = CompPnt01( geom_id, surf_indx, u, w )

norm = CompNorm01( geom_id, surf_indx, u, w )


# Offset point from surface
pnt.set_xyz( pnt.x() + norm.x(), pnt.y() + norm.y(), pnt.z() + norm.z() )

d, uout, wout = ProjPnt01Guess( geom_id, surf_indx, pnt, u + 0.1, w + 0.1 )

print( f"Dist {d} u {uout} w {wout}" )

See also: ProjPnt01, ProjPnt01I :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]: u0 double Input U (0 - 1) surface coordinate guess :param [in]: w0 double Input W (0 - 1) surface coordinate guess :param [out]: u_out double Output closest U (0 - 1) surface coordinate :param [out]: w_out double Output closest W (0 - 1) surface coordinate :rtype: float :return: double Distance between the 3D point and the closest point of the surface

openvsp.vsp.ProjPnt01I(geom_id, pt)

Determine the nearest surface coordinate and corresponding parent Geom main surface index for an input 3D coordinate point. Return the distance between the closest point and the input.

# Add Pod Geom
geom_id = AddGeom( "POD", "" )

surf_indx = 0

u = 0.12345
w = 0.67890

d = 0

pnt = CompPnt01( geom_id, surf_indx, u, w )

norm = CompNorm01( geom_id, surf_indx, u, w )



# Offset point from surface
pnt.set_xyz( pnt.x() + norm.x(), pnt.y() + norm.y(), pnt.z() + norm.z() )

d, surf_indx_out, uout, wout = ProjPnt01I( geom_id, pnt )

print( f"Dist {d} u {uout} w {wout} surf_index {surf_indx_out}" )

See also: ProjPnt01, ProjPnt01Guess :param [in]: geom_id string Parent Geom ID :param [in]: pt vec3d Input 3D coordinate point :param [out]: surf_indx_out int Output main surface index from the parent Geom :param [out]: u_out double Output closest U (0 - 1) surface coordinat :param [out]: w_out double Output closest W (0 - 1) surface coordinat :rtype: float :return: double Distance between the 3D point and the closest point of the surface

openvsp.vsp.ProjVecPnt01(geom_id, surf_indx, pts)

Determine the nearest surface coordinates for an input array of 3D coordinate points and calculate the distance between each 3D point and the closest point of the surface.

# 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 )

normvec = CompVecNorm01( geom_id, 0, uvec, wvec )

for i in range(n):

    ptvec[i].set_xyz( ptvec[i].x() + normvec[i].x(), ptvec[i].y() + normvec[i].y(), ptvec[i].z() + normvec[i].z() )

uoutv, woutv, doutv = ProjVecPnt01( geom_id, 0, ptvec )

See also: ProjVecPnt01Guess :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]: 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 distances for each 3D point and the closest point of the surface

openvsp.vsp.ProjVecPnt01Guess(geom_id, surf_indx, pts, u0s, w0s)

Determine the nearest surface coordinates for an input array of 3D coordinate points and calculate the distance between each 3D point and the closest point of the surface. This function takes an input array of surface coordinate guesses for each 3D coordinate, offering a potential decrease in computation time compared to ProjVecPnt01.

# 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 )

normvec = CompVecNorm01( geom_id, 0, uvec, wvec )

for i in range(n):

    ptvec[i].set_xyz( ptvec[i].x() + normvec[i].x(), ptvec[i].y() + normvec[i].y(), ptvec[i].z() + normvec[i].z() )

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 = ProjVecPnt01Guess( geom_id, 0, ptvec, u0v,  w0v )

See also: ProjVecPnt01, :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]: 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 array of distances for each 3D point and the closest point of the surface

openvsp.vsp.PromoteBORCSTLower(bor_id)

Promote 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.PromoteBORCSTUpper(bor_id)

Promote 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.PromoteCSTLower(xsec_id)

Promote 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.PromoteCSTUpper(xsec_id)

Promote 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.PtInTri(vec3d v0, vec3d v1, vec3d v2, vec3d p) bool
openvsp.vsp.REASON = 1

Color mesh by local edge length reason

openvsp.vsp.REL = 1

Relative position

openvsp.vsp.REORDER_MOVE_BOTTOM = 3

Move to bottom

openvsp.vsp.REORDER_MOVE_DOWN = 1

Move down one position

openvsp.vsp.REORDER_MOVE_TOP = 2

Move to top

openvsp.vsp.REORDER_MOVE_UP = 0

Move up one position

openvsp.vsp.RHO_UNIT_G_CM3 = 1

Gram per cubic centimeter

openvsp.vsp.RHO_UNIT_KG_M3 = 2

Kilogram per cubic meter

openvsp.vsp.RHO_UNIT_LBFSEC2_IN4 = 5

Pound-force-second squared per inch to the fourth

openvsp.vsp.RHO_UNIT_LBM_FT3 = 4

Pound-mass per cubic foot

openvsp.vsp.RHO_UNIT_LBM_IN3 = 6

Pound-mass per cubic inch

openvsp.vsp.RHO_UNIT_SLUG_FT3 = 0

Slug per cubic foot

openvsp.vsp.RHO_UNIT_TONNE_MM3 = 3

Tonne per cubic millimeter

openvsp.vsp.ROOTC_WSECT_DRIVER = 5

Root chord driver

openvsp.vsp.ROT_0 = 0

No rotation

openvsp.vsp.ROT_180 = 2

180 degree rotation

openvsp.vsp.ROT_270 = 3

270 degree rotation

openvsp.vsp.ROT_90 = 1

90 degree rotation

openvsp.vsp.ROUND_END_CAP = 2

Round end cap

openvsp.vsp.ROUND_EXT_END_CAP_BOTH = 9

Extended round end cap, extend both

openvsp.vsp.ROUND_EXT_END_CAP_LE = 7

Extended round end cap, extend LE

openvsp.vsp.ROUND_EXT_END_CAP_NONE = 6

Extended round end cap, but not extended

openvsp.vsp.ROUND_EXT_END_CAP_TE = 8

Extended round end cap, extend TE

openvsp.vsp.ReadApplyDESFile(file_name)

Read in and apply a design file (*.des) to the current OpenVSP project :param [in]: file_name *.des input file

openvsp.vsp.ReadApplyXDDMFile(file_name)

Read in and apply a Cart3D XDDM file (*.xddm) to the current OpenVSP project :param [in]: file_name *.xddm input file

openvsp.vsp.ReadBORFileAirfoil(bor_id, file_name)

Read in shape from airfoil file and set to the specified BOR XSecCurve. The XSecCurve must be of type XS_FILE_AIRFOIL. Airfoil files may be in Lednicer or Selig format with *.af or *.dat extensions.

# Add Body of Recolution
bor_id = AddGeom( "BODYOFREVOLUTION", "" )

ChangeBORXSecShape( bor_id, XS_FILE_AIRFOIL )

ReadBORFileAirfoil( bor_id, "airfoil/N0012_VSP.af" )
Parameters:
  • [in] – bor_id string Body of revolution Geom ID

  • [in] – file_name string Airfoil XSec file name

openvsp.vsp.ReadBORFileXSec(bor_id, file_name)

Set the coordinate points for a specific BOR. The BOR XSecCurve must be of type XS_FILE_FUSE.

# Add Body of Recolution
bor_id = AddGeom( "BODYOFREVOLUTION", "" )

ChangeBORXSecShape( bor_id, XS_FILE_FUSE )

vec_array = ReadBORFileXSec( bor_id, "TestXSec.fxs" )
Parameters:
  • [in] – bor_id string Body of revolution Geom ID

  • [in] – file_name string Fuselage XSec file name

Return type:

std::vector< vec3d,std::allocator< vec3d > >

Returns:

vector<vec3d> Array of coordinate points read from the file and set to the XSec

openvsp.vsp.ReadFileAirfoil(xsec_id, file_name)

Read in XSec shape from airfoil file and set to the specified XSec. The XSec must be of type XS_FILE_AIRFOIL. Airfoil files may be in Lednicer or Selig format with *.af or *.dat extensions.

# 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" )
Parameters:
  • [in] – xsec_id XSec ID

  • [in] – file_name Airfoil XSec file name

openvsp.vsp.ReadFileXSec(xsec_id, file_name)

Read in XSec shape from fuselage (*.fsx) file and set to the specified XSec. The XSec must be of type XS_FILE_FUSE.

# Add Fuselage Geom
fuseid = AddGeom( "FUSELAGE", "" )

xsec_surf = GetXSecSurf( fuseid, 0 )

ChangeXSecShape( xsec_surf, 2, XS_FILE_FUSE )

xsec = GetXSec( xsec_surf, 2 )

vec_array = ReadFileXSec(xsec, "TestXSec.fxs")
Parameters:
  • [in] – xsec_id XSec ID

  • [in] – file_name Fuselage XSec file name

Return type:

std::vector< vec3d,std::allocator< vec3d > >

Returns:

Array of coordinate points read from the file and set to the XSec

openvsp.vsp.ReadVSPFile(file_name)

Load an OpenVSP project from a VSP3 file

fid = AddGeom( "FUSELAGE", "" )             # Add Fuselage

fname = "example_fuse.vsp3"

SetVSP3FileName( fname )

Update()

#==== Save Vehicle to File ====//
print( "\tSaving vehicle file to: ", False )

print( fname )

WriteVSPFile( GetVSPFileName(), SET_ALL )

#==== Reset Geometry ====//
print( "--->Resetting VSP model to blank slate\n" )

ClearVSPModel()

ReadVSPFile( fname )
Parameters:

[in] – file_name *.vsp3 file name

openvsp.vsp.RegisterCFDMeshAnalyses()
openvsp.vsp.RemoveAllFromVSPAEROControlSurfaceGroup(CSGroupIndex)

Remove all used control surfaces from 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 )

RemoveAllFromVSPAEROControlSurfaceGroup( group_index ) # Empty control surface group
Parameters:

[in] – CSGroupIndex Index of the control surface group

openvsp.vsp.RemoveSelectedFromCSGroup(selected, CSGroupIndex)

Remove each control surfaces in the array of control surface indexes from the control surface group at the specified index.

Warning: The indexes in input “selected” must be matched with active control surfaces identified by GetActiveCSNameVec. 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 the available control surfaces to the group

remove_cs_ind_vec = [1]

RemoveSelectedFromCSGroup( remove_cs_ind_vec, group_index ) # Remove the first control surface

See also: GetActiveCSNameVec :param [in]: selected Array of control surface indexes to remove from the group. Note, the integer values are one based. :param [in]: CSGroupIndex Index of the control surface group

openvsp.vsp.ReparameterizeEditXSec(xsec_id)

Perform an equal arc length repareterization on an EditCurveXSec. The reparameterization is performed between specific U values if the Fixed U flag is true. This allows corners, such as at 0.25, 0.5, and 0.75 U, to be held constant while everything between them is reparameterized.

# 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, GetEditXSecFixedUVec :param [in]: xsec_id XSec ID

openvsp.vsp.ResetPropellerThicknessCurve(geom_id)

Reset propeller T/C curve to match basic thickness of file-type airfoils. Typically only used for a propeller that has been constructed with file-type airfoils across the blade. The new thickness curve will be a PCHIP curve with t/c matching the propeller’s XSecs – unless it is a file XSec, then the Base thickness is used.

# Add Propeller
prop = AddGeom( "PROP", "" )

ResetPropellerThicknessCurve( prop )
Parameters:

[in] – geom_id string Geom ID

openvsp.vsp.ResetViews()

Reset views of all viewports

ResetViews()
openvsp.vsp.ResetXSecSkinParms(xsec_id)

Reset all skinning Parms for a specified XSec. Set top, bottom, left, and right strengths, slew, angle, and curvature to 0. Set all symmetry and equality conditions to false.

fid = AddGeom( "FUSELAGE", "" )             # Add Fuselage

xsec_surf = GetXSecSurf( fid, 0 )           # Get First (and Only) XSec Surf

num_xsecs = GetNumXSec( xsec_surf )

xsec = GetXSec( xsec_surf, 1 )

SetXSecTanAngles( xsec, XSEC_BOTH_SIDES, 0.0, -1.0e12, -1.0e12, -1.0e12 )       # Set Tangent Angles At Cross Section
SetXSecContinuity( xsec, 1 )                       # Set Continuity At Cross Section

ResetXSecSkinParms( xsec )
Parameters:

[in] – xsec_id string XSec ID

openvsp.vsp.RotateArbAxis(vec3d p, double theta, vec3d r) vec3d
openvsp.vsp.RotateSet(set_index, x_rot_deg, y_rot_deg, z_rot_deg)

Rotate a set about the global X, Y, and Z axes

# Add Fuselage Geom
fuseid = AddGeom( "FUSELAGE" )

SetSetFlag( fuseid, 3, True )

# Rotate 90 degrees about Y
RotateSet( 3, 0, 90, 0 )
Parameters:
  • [in] – set_index Set index

  • [in] – x_rot_deg Rotation about the X axis (degrees)

  • [in] – y_rot_deg Rotation about the Y axis (degrees)

  • [in] – z_rot_deg Rotation about the Z axis (degrees)

openvsp.vsp.SAVE = 1

Browse file system and enter file name

openvsp.vsp.SCALE_HEIGHT = 1

Scale image to match desired height

openvsp.vsp.SCALE_RESOLUTION = 3

Scale image to specified resolution

openvsp.vsp.SCALE_WIDTH = 0

Scale image to match desired width

openvsp.vsp.SCALE_WIDTH_HEIGHT = 2

Scale image to match desired width and height

openvsp.vsp.SECSWEEP_WSECT_DRIVER = 7

Section sweep driver

openvsp.vsp.SELIG_AF_EXPORT = 0

Selig airfoil file format

openvsp.vsp.SET_2D = 1

2D DXF export

openvsp.vsp.SET_3D = 0

3D DXF export (default)

openvsp.vsp.SET_ALL = 0

All set

openvsp.vsp.SET_BOUNDARY = 1

Set boundary

openvsp.vsp.SET_FIRST_USER = 3

First user-defined set

openvsp.vsp.SET_NONE = -1

None set

openvsp.vsp.SET_NOT_SHOWN = 2

Not shown set

openvsp.vsp.SET_SHOWN = 1

Shown set

openvsp.vsp.SET_TARGET = 0

Set target type

openvsp.vsp.SHARP_END_CAP = 4

Sharp end cap

openvsp.vsp.SI_UNIT = 0

FEA Files output in (m, kg)

openvsp.vsp.SOURCES = 4

Mesh sources.

openvsp.vsp.SPAN_WSECT_DRIVER = 1

Span driver

openvsp.vsp.SPAR_NORMAL = 3

FEA Rib or Rib Array is set perpendicular to an FEA Spar

openvsp.vsp.SPINE_NORMAL = 6

Slice is perpendicular to thespine of the parent Geom

openvsp.vsp.SS_CONTROL = 3

Control sub-surface type

openvsp.vsp.SS_ELLIPSE = 2

Ellipse sub-surface type

openvsp.vsp.SS_FINITE_LINE = 5

Finite line sub-surface type

openvsp.vsp.SS_INC_SEPARATE_TREATMENT = 1

Treat the sub-surface separately from the parent

openvsp.vsp.SS_INC_TREAT_AS_PARENT = 0

Treat the sub-surface the same as the parent

openvsp.vsp.SS_INC_ZERO_DRAG = 2

No drag contribution for the sub-surface

openvsp.vsp.SS_LINE = 0

Line sub-surface type

openvsp.vsp.SS_LINE_ARRAY = 4

Line array sub-surface type

openvsp.vsp.SS_NUM_TYPES = 6

Number of sub-surface types

openvsp.vsp.SS_RECTANGLE = 1

Rectangle sub-surface type

openvsp.vsp.STABILITY_DEFAULT = 1

Steady 6DOF stability analysis

openvsp.vsp.STABILITY_NUM_TYPES = 6

Number of stability analysis types

openvsp.vsp.STABILITY_OFF = 0

No stability analysis (off)

openvsp.vsp.STABILITY_PITCH = 5

Simplified pitch stability analysis

openvsp.vsp.STABILITY_P_ANALYSIS = 2

Unsteady roll stability analysis

openvsp.vsp.STABILITY_Q_ANALYSIS = 3

Unsteady pitch stability analysis

openvsp.vsp.STABILITY_R_ANALYSIS = 4

Unsteady yaw stability analysis

openvsp.vsp.STACK_GEOM_SCREEN = 5

Stack geom screen

openvsp.vsp.STEP_BREP = 1

Manifold solid BREP STEP file representation

openvsp.vsp.STEP_SHELL = 0

Manifold shell surface STEP file representation

openvsp.vsp.STRING_DATA = 2

String result data type

openvsp.vsp.SYM_ALL = 3

All cross section symmetry.

openvsp.vsp.SYM_NONE = 0

No cross section symmetry.

openvsp.vsp.SYM_NUM_TYPES = 6

Number of symmetry types.

openvsp.vsp.SYM_PLANAR_TYPES = 3

Number of planar symmetry types.

openvsp.vsp.SYM_RL = 1

Right/left cross section symmetry.

openvsp.vsp.SYM_ROT_X = 8

X rotational symmetry.

openvsp.vsp.SYM_ROT_Y = 16

Y rotational symmetry.

openvsp.vsp.SYM_ROT_Z = 32

Z rotational symmetry.

openvsp.vsp.SYM_TB = 2

Top/bottom cross section symmetry.

openvsp.vsp.SYM_XY = 1

XY planar symmetry.

openvsp.vsp.SYM_XZ = 2

XZ planar symmetry.

openvsp.vsp.SYM_YZ = 4

YZ planar symmetry.

openvsp.vsp.ScaleSet(set_index, scale)

Apply a scale factor to a set

# Add Fuselage Geom
fuseid = AddGeom( "FUSELAGE" )

SetSetFlag( fuseid, 3, True )

# Scale by a factor of 2
ScaleSet( 3, 2.0 )
Parameters:
  • [in] – set_index Set index

  • [in] – scale Scale factor

openvsp.vsp.ScreenGrab(fname, w, h, transparentBG, autocrop=False)

Capture the specified screen and save to file. Note, VSP_USE_FLTK must be defined

screenw = 2000                                             # Set screenshot width and height
screenh = 2000

fname = "test_screen_grab.png"

ScreenGrab( fname, screenw, screenh, True, True )                # Take PNG screenshot
Parameters:
  • [in] – fname string Output file name

  • [in] – w int Width of screen grab

  • [in] – h int Height of screen grab

  • [in] – transparentBG bool Transparent background flag

  • [in] – autocrop bool Automatically crop transparent background flag

openvsp.vsp.SearchReplaceAdvLinkCode(index, _from, to)

Search and replace strings in the advanced link code

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;" )
SearchReplaceAdvLinkCode( indx, "10.0", "12.3" )

code = GetAdvLinkCode( indx )

print( code )

BuildAdvLinkScript( indx )
Parameters:
  • [in] – index int Index for advanced link

  • [in] – from string Search token

  • [in] – to string Replace token

openvsp.vsp.SetAdvLinkCode(index, code)

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 )
Parameters:
  • [in] – index int Index for advanced link

  • [in] – code string Code for advanced link

openvsp.vsp.SetAirfoilLowerPnts(xsec_id, low_pnt_vec)

Set the lower points for 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 )

for i in range(int( len(low_array) )):

    low_array[i].scale_y( 0.5 )

SetAirfoilUpperPnts( xsec, low_array )
Parameters:
  • [in] – xsec_id XSec ID

  • [in] – low_pnt_vec Array of points defining the lower surface of the airfoil

openvsp.vsp.SetAirfoilPnts(xsec_id, up_pnt_vec, low_pnt_vec)

Set the upper and lower points for 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 )

low_array = GetAirfoilLowerPnts( xsec )

for i in range(int( len(up_array) )):

    up_array[i].scale_y( 2.0 )

    low_array[i].scale_y( 0.5 )

SetAirfoilPnts( xsec, up_array, low_array )
Parameters:
  • [in] – xsec_id XSec ID

  • [in] – up_pnt_vec Array of points defining the upper surface of the airfoil

  • [in] – low_pnt_vec Array of points defining the lower surface of the airfoil

openvsp.vsp.SetAirfoilUpperPnts(xsec_id, up_pnt_vec)

Set the upper points for 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 )

for i in range(int( len(up_array) )):

    up_array[i].scale_y( 2.0 )

SetAirfoilUpperPnts( xsec, up_array )
Parameters:
  • [in] – xsec_id XSec ID

  • [in] – up_pnt_vec Array of points defining the upper surface of the airfoil

openvsp.vsp.SetAllViews(view)

Set the view of all viewports

SetAllViews( CAM_CENTER )
Parameters:

[in] – view int CAMERA_VIEW enum

openvsp.vsp.SetAnalysisInputDefaults(analysis)

Set all input values to their defaults for a specific analysis

#==== Analysis: VSPAero Compute Geometry ====//
analysis_name = "VSPAEROComputeGeometry"

# Set defaults
SetAnalysisInputDefaults( analysis_name )
param [in]:

analysis Analysis name

openvsp.vsp.SetBEMPropID(prop_id)

Set the ID of the propeller to be exported to a BEM file. Call this function before ExportFile.

#==== Add Prop Geometry ====//
prop_id = AddGeom( "PROP" )

SetBEMPropID( prop_id )

ExportFile( "ExampleBEM.bem", SET_ALL, EXPORT_BEM )

See also: EXPORT_TYPE, ExportFile :param [in]: prop_id Propeller Geom ID

openvsp.vsp.SetBORAirfoilLowerPnts(bor_id, low_pnt_vec)

Set the lower points for 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" )

low_array = GetBORAirfoilLowerPnts( bor_id )

for i in range(int( len(low_array) )):

    low_array[i].scale_y( 0.5 )

SetBORAirfoilLowerPnts( bor_id, low_array )
Parameters:
  • [in] – bor_id string Body of revolution Geom ID

  • [in] – low_pnt_vec vector<vec3d> Vector of points defining the lower surface of the airfoil

openvsp.vsp.SetBORAirfoilPnts(bor_id, up_pnt_vec, low_pnt_vec)

Set the upper and lower points for 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 )

low_array = GetBORAirfoilLowerPnts( bor_id )

for i in range(int( len(up_array) )):

    up_array[i].scale_y( 2.0 )

    low_array[i].scale_y( 0.5 )

SetBORAirfoilPnts( bor_id, up_array, low_array )
Parameters:
  • [in] – bor_id string Body of revolution Geom ID

  • [in] – up_pnt_vec vector<vec3d> Vector of points defining the upper surface of the airfoil

  • [in] – low_pnt_vec vector<_>vec3d> Vector of points defining the lower surface of the airfoil

openvsp.vsp.SetBORAirfoilUpperPnts(bor_id, up_pnt_vec)

Set the upper points for 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 )

for i in range(int( len(up_array) )):

    up_array[i].scale_y( 2.0 )

SetBORAirfoilUpperPnts( bor_id, up_array )
Parameters:
  • [in] – bor_id string Body of revolution Geom ID

  • [in] – up_pnt_vec vector<vec3d> Vector of points defining the upper surface of the airfoil

openvsp.vsp.SetBORLowerCST(bor_id, deg, coefs)

Set the CST degree and coefficients for the lower surface of an airfoil of a BOR. The number of coefficients should be one more than the CST degree. The XSecCurve must be of type XS_CST_AIRFOIL See also: GetLowerCSTDegree, GetLowerCSTCoefs :param [in]: bor_id string Body of revolution Geom ID :param [in]: deg int CST degree of lower airfoil surface :param [in]: coefs vector<double> Vector of CST coefficients for the lower airfoil surface

openvsp.vsp.SetBORUpperCST(bor_id, deg, coefs)

Set the CST degree and coefficients for the upper surface of an airfoil of a BOR. The number of coefficients should be one more than the CST degree. The XSecCurve must be of type XS_CST_AIRFOIL See also: GetUpperCSTDegree, GetUpperCSTCoefs :param [in]: bor_id string Body of revolution Geom ID :param [in]: deg CST degree of upper airfoil surface :param [in]: coefs Array of CST coefficients for the upper airfoil surface

openvsp.vsp.SetBORXSecPnts(bor_id, pnt_vec)

Set the coordinate points for a specific BOR. The BOR XSecCurve must be of type XS_FILE_FUSE.

# Add Body of Recolution
bor_id = AddGeom( "BODYOFREVOLUTION", "" )

ChangeBORXSecShape( bor_id, XS_FILE_FUSE )

vec_array = ReadBORFileXSec( bor_id, "TestXSec.fxs" )

if  len(vec_array) > 0 :
    vec_array[1] = vec_array[1] * 2.0
    vec_array[3] = vec_array[3] * 2.0

    SetBORXSecPnts( bor_id, vec_array )
Parameters:
  • [in] – bor_id string Body of revolution Geom ID

  • [in] – pnt_vec vector<vec3d> Vector of XSec coordinate points

openvsp.vsp.SetBackground(r, g, b)

Set the background color

SetBackground( 1.0, 1.0, 1.0 )                                 # Set background to bright white
Parameters:
  • [in] – r Red 8-bit unsigned integer (range: 0-255)

  • [in] – g Green 8-bit unsigned integer (range: 0-255)

  • [in] – b Blue 8-bit unsigned integer (range: 0-255)

openvsp.vsp.SetBackground3DAbsolutePath(id, fname)

Set absolute path to specified Background3D’s image.

# Add Background3D
bg_id = AddBackground3D()

SetBackground3DAbsolutePath( bg_id, "front.png" )
bg_file = GetBackground3DAbsolutePath( bg_id )

print( bg_file )

DelAllBackground3Ds()
Parameters:
  • [in] – id string Background3D ID

  • [in] – fname string Absolute path to Background3D image file

openvsp.vsp.SetBackground3DRelativePath(id, fname)

Set 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

  • [in] – fname string Relative path to Background3D image file

openvsp.vsp.SetCFDMeshVal(type, val)

Set the value of a specific CFD Mesh option

SetCFDMeshVal( CFD_MIN_EDGE_LEN, 1.0 )

See also: CFD_CONTROL_TYPE :param [in]: type int CFD Mesh control type enum (i.e. CFD_GROWTH_RATIO) :param [in]: val double Value to set

openvsp.vsp.SetCFDWakeFlag(geom_id, flag)

Activate or deactivate the CFD Mesh wake for a particular Geom. Note, the wake flag is only applicable for wing-type surfaces. Also, this function is simply an alternative to setting the value of the Parm with the available Parm setting API functions.

#==== Add Wing Geom ====//
wid = AddGeom( "WING", "" )

SetCFDWakeFlag( wid, True )
# This is equivalent to SetParmValUpdate( wid, "Wake", "Shape", 1.0 )
# To change the scale: SetParmValUpdate( wid, "WakeScale", "WakeSettings", 10.0 )
# To change the angle: SetParmValUpdate( wid, "WakeAngle", "WakeSettings", -5.0 )

See also: SetParmVal, SetParmValUpdate :param [in]: geom_id string Geom ID :param [in]: flag True to activate, false to deactivate

openvsp.vsp.SetComputationFileName(file_type, file_name)

Get the file name of a specified file type. Note, this function cannot be used to set FEA Mesh file names.

#==== Set File Name ====//
SetComputationFileName( DEGEN_GEOM_CSV_TYPE, "TestDegenScript.csv" )

#==== Run Degen Geom ====//
ComputeDegenGeom( SET_ALL, DEGEN_GEOM_CSV_TYPE )

See also: COMPUTATION_FILE_TYPE, SetFeaMeshFileName :param [in]: file_type File type enum (i.e. CFD_TRI_TYPE, COMP_GEOM_TXT_TYPE) :param [in]: file_name File name

openvsp.vsp.SetDoubleAnalysisInput(analysis, name, indata, index=0)

Set the value of a particular analysis input of double type

#==== Analysis: CpSlicer ====//
analysis_name = "CpSlicer"

# Setup cuts
ycuts = []
ycuts.append( 2.0 )
ycuts.append( 4.5 )
ycuts.append( 8.0 )

SetDoubleAnalysisInput( analysis_name, "YSlicePosVec", ycuts, 0 )

See also: GetDoubleAnalysisInput :param [in]: analysis string Analysis name :param [in]: name string Input name :param [in]: indata vector<double> Array of double values to set the input to :param [in]: index int Data index

openvsp.vsp.SetDriverGroup(geom_id, section_index, driver_0, driver_1=-1, driver_2=-1)

Set the driver group for a wing section or a XSecCurve. Care has to be taken when setting these driver groups to ensure a valid combination.

#==== Add Wing Geometry and Set Parms ====//
wing_id = AddGeom( "WING", "" )

#==== Set Wing Section Controls ====//
SetDriverGroup( wing_id, 1, AR_WSECT_DRIVER, ROOTC_WSECT_DRIVER, TIPC_WSECT_DRIVER )

Update()

#==== Set Parms ====//
SetParmVal( wing_id, "Root_Chord", "XSec_1", 2 )
SetParmVal( wing_id, "Tip_Chord", "XSec_1", 1 )

Update()

See also: WING_DRIVERS, XSEC_DRIVERS :param [in]: geom_id string Geom ID :param [in]: section_index Wing section index :param [in]: driver_0 First driver enum (i.e. SPAN_WSECT_DRIVER) :param [in]: driver_1 Second driver enum (i.e. ROOTC_WSECT_DRIVER) :param [in]: driver_2 Third driver enum (i.e. TIPC_WSECT_DRIVER)

openvsp.vsp.SetEditXSecFixedUVec(xsec_id, fixed_u_vec)

Set 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: GetEditXSecFixedUVec, ReparameterizeEditXSec :param [in]: xsec_id XSec ID :param [in]: fixed_u_vec Array of fixed U flags

openvsp.vsp.SetEditXSecPnts(xsec_id, u_vec, control_pts, r_vec)

Set the U parameter vector and the control point vector for an EditCurveXSec. The arrays must be of equal length, with the values for U defined in increasing order and range 0 - 1. The input control points to SetEditXSecPnts must be nondimensionalized in the approximate range of [-0.5, 0.5].

# 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 )

# Turn off R/L symmetry
SetParmVal( GetXSecParm( xsec_2, "SymType"), SYM_NONE )

# Define a square
xsec2_pts = [vec3d(0.5, 0.5, 0.0),
         vec3d(0.5, -0.5, 0.0),
         vec3d(-0.5, -0.5, 0.0),
         vec3d(-0.5, 0.5, 0.0),
         vec3d(0.5, 0.5, 0.0)]

# u vec must start at 0.0 and end at 1.0
u_vec = [0.0, 0.25, 0.5, 0.75, 1.0]

r_vec = [0.0, 0.0, 0.0, 0.0, 0.0]

SetEditXSecPnts( xsec_2, u_vec, xsec2_pts, r_vec ) # Note: points are unscaled by the width and height parms

new_pnts = GetEditXSecCtrlVec( xsec_2, True ) # The returned control points will not be scaled by width and height

if  dist( new_pnts[3], xsec2_pts[3] ) > 1e-6 :
    print( "Error: SetEditXSecPnts")
Parameters:
  • [in] – xsec_id XSec ID

  • [in] – u_vec Array of U parameter values

  • [in] – r_vec Array of R parameter values

  • [in] – control_pts Nondimensionalized array of control points

openvsp.vsp.SetFeaMeshFileName(geom_id, fea_struct_ind, file_type, file_name)

Set the name of a particular FEA Mesh output file for a specified Structure

#==== Add Pod Geometry ====//
pod_id = AddGeom( "POD" )

#==== Add FeaStructure to Pod ====//
struct_ind = AddFeaStruct( pod_id )

struct_id = GetFeaStructID( pod_id, struct_ind )

#=== Set Export File Name ===//
export_name = "FEAMeshTest_calculix.dat"

#==== Get Parent Geom ID and Index ====//
parent_id = GetFeaStructParentGeomID( struct_id ) # same as pod_id

SetFeaMeshFileName( parent_id, struct_ind, FEA_CALCULIX_FILE_NAME, export_name )
Parameters:
  • [in] – geom_id string Parent Geom ID

  • [in] – fea_struct_ind FEA Structure index

  • [in] – file_type FEA output file type enum (i.e. FEA_EXPORT_TYPE)

  • [in] – file_name Name for the output file

openvsp.vsp.SetFeaMeshStructIndex(struct_index)

Sets FeaMeshMgr m_FeaMeshStructIndex member using passed in index of a FeaStructure

#==== Add Pod Geometry ====//
pod_id = AddGeom( "POD" )

#==== Add FeaStructure to Pod ====//
struct_ind = AddFeaStruct( pod_id )

SetFeaMeshStructIndex( struct_ind )

if  len(FindGeoms()) != 0 : print( "ERROR: VSPRenew" )
openvsp.vsp.SetFeaMeshVal(geom_id, fea_struct_ind, type, val)

Set the value of a particular FEA Mesh option for the specified Structure. Note, FEA Mesh makes use of enums initially created for CFD Mesh but not all CFD Mesh options are available for FEA Mesh.

#==== Add Pod Geometry ====//
pod_id = AddGeom( "POD" )

#==== Add FeaStructure to Pod ====//
struct_ind = AddFeaStruct( pod_id )

#==== Adjust FeaMeshSettings ====//
SetFeaMeshVal( pod_id, struct_ind, CFD_MAX_EDGE_LEN, 0.75 )

SetFeaMeshVal( pod_id, struct_ind, CFD_MIN_EDGE_LEN, 0.2 )

See also: CFD_CONTROL_TYPE :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind FEA Structure index :param [in]: type FEA Mesh option type enum (i.e. CFD_MAX_EDGE_LEN) :param [in]: val Value the option is set to

openvsp.vsp.SetFeaPartName(part_id, name)

Set the name of an FEA Part

#==== 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 )

SetFeaPartName( bulkhead_id, "Bulkhead" )

See also: GetFeaPartName :param [in]: part_id FEA Part ID :param [in]: name New name for the FEA Part

openvsp.vsp.SetFeaPartPerpendicularSparID(part_id, perpendicular_spar_id)

Set the ID of the perpendicular spar for an FEA Rib or Rib Array. Note, the FEA Rib or Rib Array should have “SPAR_NORMAL” set for the “PerpendicularEdgeType” Parm. If it is not, the ID will still be set, but the orientation of the Rib or Rib Array will not change.

#==== 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: SetFeaPartPerpendicularSparID" )

See also: FEA_RIB_NORMAL, GetFeaPartPerpendicularSparID :param [in]: part_id FEA Part ID (Rib or Rib Array Type) :param [in]: perpendicular_spar_id FEA Spar ID

openvsp.vsp.SetFeaStructName(geom_id, fea_struct_ind, name)

Set the name of an FEA Structure

#==== Add Pod Geometry ====//
pod_id = AddGeom( "POD" )

#==== Add FeaStructure to Pod ====//
struct_ind = AddFeaStruct( pod_id )

#==== Change the Structure Name ====//
SetFeaStructName( pod_id, struct_ind, "Example_Struct" )

parm_container_id = FindContainer( "Example_Struct", struct_ind )

display_id = "New Structure Parm Container ID: " + parm_container_id + "\n"

print( display_id )

See also: GetFeaStructName :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind FEA Structure index :param [in]: name New name for the FEA Structure

openvsp.vsp.SetFeaSubSurfName(subsurf_id, name)

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 )

SetFeaSubSurfName( line_array_id, "Stiffener_array" )
Parameters:
  • [in] – subsurf_id FEA SubSurface ID

  • [in] – name New name for the FEA SubSurface

openvsp.vsp.SetGUIElementDisable(e, state)

Set whether all instances of GUI device type are disabled

SetGUIElementDisable( GDEV_INPUT, True )
Parameters:
  • [in] – e int GDEV enum for GUI device type

  • [in] – state bool True to disable GUI device type

openvsp.vsp.SetGUIScreenDisable(s, state)

Set whether screen is disabled

SetGUIScreenDisable( VSP_CFD_MESH_SCREEN, True )
Parameters:
  • [in] – e int GUI_VSP_SCREEN enum for screen

  • [in] – state bool True to disable screen

openvsp.vsp.SetGeomDisplayType(geom_id, type)

Set the display type of the specified goemetry

pid = AddGeom( "POD" )                             # Add Pod for testing

SetGeomDisplayType( pid, DISPLAY_DEGEN_PLATE )                       # Make pod appear as Bezier plate (Degen Geom)

See also: DISPLAY_TYPE :param [in]: geom_id string Geom ID :param [in]: type Display type enum (i.e. DISPLAY_BEZIER)

openvsp.vsp.SetGeomDrawType(geom_id, type)

Set the draw type of the specified goemetry

pid = AddGeom( "POD", "" )                             # Add Pod for testing

SetGeomDrawType( pid, GEOM_DRAW_SHADE )                       # Make pod appear as shaded

See also: DRAW_TYPE :param [in]: geom_id string Geom ID :param [in]: type Draw type enum (i.e. GEOM_DRAW_SHADE)

openvsp.vsp.SetGeomMaterialName(geom_id, name)

Set the visualization material the specified goemetry

pid = AddGeom( "POD" )

SetGeomMaterialName( pid, "Ruby" )
Parameters:
  • [in] – geom_id string Geom ID

  • [in] – name string Material name

openvsp.vsp.SetGeomName(geom_id, name)

Set the name of the specified Geom

#==== Add Pod Geometry ====//
pid = AddGeom( "POD", "" )

SetGeomName( pid, "ExamplePodName" )

geom_ids = FindGeomsWithName( "ExamplePodName" )

if  len(geom_ids) != 1 :
    print( "---> Error: API FindGeomsWithName " )
Parameters:
  • [in] – geom_id string Geom ID

  • [in] – name Geom name

openvsp.vsp.SetGeomScreenDisable(s, state)

Set whether geom screen is disabled

SetGeomScreenDisable( ALL_GEOM_SCREENS, True )
Parameters:
  • [in] – e int GUI_GEOM_SCREEN enum for geom screen

  • [in] – state bool True to disable geom screen

openvsp.vsp.SetGeomWireColor(geom_id, r, g, b)

Set the wireframe color of the specified goemetry

pid = AddGeom( "POD", "" )

SetGeomWireColor( pid, 0, 0, 255 )
Parameters:
  • [in] – geom_id string Geom ID

  • [in] – r int Red component of color [0, 255]

  • [in] – g int Green component of color [0, 255]

  • [in] – b int Blue component of color [0, 255]

openvsp.vsp.SetIntAnalysisInput(analysis, name, indata, index=0)

Set the value of a particular analysis input of integer type

#==== 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: GetIntAnalysisInput :param [in]: analysis string Analysis name :param [in]: name string Input name :param [in]: indata vector<int> Array of integer values to set the input to :param [in]: index int Data index

openvsp.vsp.SetLowerCST(xsec_id, deg, coefs)

Set the CST degree and coefficients for the lower surface of an airfoil. The number of coefficients should be one more than the CST degree. The XSec must be of type XS_CST_AIRFOIL See also: GetLowerCSTDegree, GetLowerCSTCoefs :param [in]: xsec_id string XSec ID :param [in]: deg int CST degree of lower airfoil surface :param [in]: coefs vector<double> Vector of CST coefficients for the lower airfoil surface

openvsp.vsp.SetPCurve(geom_id, pcurveid, tvec, valvec, newtype)

Set the parameters, values, and curve type of a propeller blade curve (P Curve) See also: PCURV_TYPE :param [in]: geom_id string Parent Geom ID :param [in]: pcurveid P Curve index :param [in]: tvec Array of parameter values :param [in]: valvec Array of values :param [in]: newtype Curve type enum (i.e. CEDIT)

openvsp.vsp.SetParmDescript(parm_id, desc)

Set the description of the specified Parm

pod_id = AddGeom( "POD" )

length = FindParm( pod_id, "Length", "Design" )

SetParmValLimits( length, 10.0, 0.001, 1.0e12 )

SetParmDescript( length, "Total Length of Geom" )
Parameters:
  • [in] – parm_id string Parm ID

  • [in] – desc Parm description

openvsp.vsp.SetParmLowerLimit(parm_id, val)

Set the lower limit value 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" )

SetParmVal( wid, 13.0 )

SetParmLowerLimit( wid, 15.0 )

if  abs( GetParmVal( wid ) - 15 ) > 1e-6 : print( "---> Error: API SetParmLowerLimit " )

See also: SetParmValLimits :param [in]: parm_id string Parm ID :param [in]: val Parm lower limit

openvsp.vsp.SetParmUpperLimit(parm_id, val)

Set the upper limit value 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" )

SetParmVal( wid, 23.0 )

SetParmUpperLimit( wid, 13.0 )

if  abs( GetParmVal( wid ) - 13 ) > 1e-6 : print( "---> Error: API SetParmUpperLimit " )

See also: SetParmValLimits :param [in]: parm_id string Parm ID :param [in]: val double Parm upper limit

openvsp.vsp.SetParmVal(*args)

Overload 1:

Set the value of 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" )

SetParmVal( wid, 23.0 )

if  abs( GetParmVal( wid ) - 23 ) > 1e-6 : print( "---> Error: API Parm Val Set/Get " )

See also: SetParmValUpdate :param [in]: parm_id string Parm ID :param [in]: val Parm value to set :rtype: float :return: Value that the Parm was set to


Overload 2:

Set the value of 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" )

SetParmVal( wid, 23.0 )

if  abs( GetParmVal( wid ) - 23 ) > 1e-6 : print( "---> Error: API Parm Val Set/Get " )

See also: SetParmValUpdate :param [in]: geom_id string Geom ID :param [in]: name string Parm name :param [in]: group string Parm group name :param [in]: val double Parm value to set :rtype: float :return: double Value that the Parm was set to

openvsp.vsp.SetParmValLimits(parm_id, val, lower_limit, upper_limit)

Set the value along with the upper and lower limits of the specified Parm

pod_id = AddGeom( "POD" )

length = FindParm( pod_id, "Length", "Design" )

SetParmValLimits( length, 10.0, 0.001, 1.0e12 )

SetParmDescript( length, "Total Length of Geom" )

See also: SetParmLowerLimit, SetParmUpperLimit :param [in]: parm_id string Parm ID :param [in]: val Parm value to set :param [in]: lower_limit Parm lower limit :param [in]: upper_limit Parm upper limit :rtype: float :return: Value that the Parm was set to

openvsp.vsp.SetParmValUpdate(*args)

Overload 1:

Set the value of the specified Parm and force an Update.

#==== Add Pod Geometry ====//
pod_id = AddGeom( "POD" )

parm_id = GetParm( pod_id, "X_Rel_Location", "XForm" )

SetParmValUpdate( parm_id, 5.0 )

See also: SetParmVal :param [in]: parm_id string Parm ID :param [in]: val Parm value to set :rtype: float :return: Value that the Parm was set to


Overload 2:

Set the value of the specified Parm and force an Update.

#==== Add Pod Geometry ====//
pod_id = AddGeom( "POD" )

parm_id = GetParm( pod_id, "X_Rel_Location", "XForm" )

SetParmValUpdate( parm_id, 5.0 )

See also: SetParmVal :param [in]: geom_id string Geom ID :param [in]: parm_name string Parm name :param [in]: parm_group_name string Parm group name :param [in]: val double Parm value to set :rtype: float :return: double Value that the Parm was set to

openvsp.vsp.SetSetFlag(geom_id, set_index, flag)

Set whether or not a Geom is a member of the set at specified set index

# Add Fuselage Geom
fuseid = AddGeom( "FUSELAGE", "" )

SetSetFlag( fuseid, 3, True )

if not GetSetFlag(fuseid, 3):
    print("---> Error: API Set/Get Set Flag")
Parameters:
  • [in] – geom_id string Geom ID

  • [in] – set_index Set index

  • [in] – flag Flag that indicates set membership

openvsp.vsp.SetSetName(index, name)

Set the name of a set at specified index

SetSetName( 3, "SetFromScript" )

if GetSetName(3) != "SetFromScript":
    print("---> Error: API Get/Set Set Name")

See also: SET_TYPE :param [in]: index Set index :param [in]: name Set name

openvsp.vsp.SetShowBorders(brdr)

Toggle viewing the border frame

SetShowBorders( False )                                        # Turn off red/black border on active window
Parameters:

[in] – brdr True to show the border frame, false to hide the border frame

openvsp.vsp.SetStringAnalysisInput(analysis, name, indata, index=0)

Set the value of a particular analysis input of string type

fileNameInput = GetStringAnalysisInput( "ParasiteDrag", "FileName" )

fileNameInput = ["ParasiteDragExample"]

SetStringAnalysisInput( "ParasiteDrag", "FileName", fileNameInput )

See also: GetStringAnalysisInput :param [in]: analysis string Analysis name :param [in]: name string Input name :param [in]: indata vector<string> Array of string values to set the input to :param [in]: index int Data index

openvsp.vsp.SetSubSurfName(*args)

Overload 1:

Set the name of the specified sub-surface

wid = AddGeom( "WING", "" )                             # Add Wing

ss_rec_id = AddSubSurf( wid, SS_RECTANGLE )                        # Add Sub Surface Rectangle

new_name = "New_SS_Rec_Name"

SetSubSurfName( wid, ss_rec_id, new_name )
Parameters:
  • [in] – geom_id string Geom ID

  • [in] – sub_id string Sub-surface ID

  • [in] – name string Sub-surface name


Overload 2:

Set the name of the specified sub-surface

wid = AddGeom( "WING", "" )                             # Add Wing

ss_rec_id = AddSubSurf( wid, SS_RECTANGLE )                        # Add Sub Surface Rectangle

new_name = "New_SS_Rec_Name"

SetSubSurfName( ss_rec_id, new_name )
Parameters:
  • [in] – sub_id string Sub-surface ID

  • [in] – name string Sub-surface name

openvsp.vsp.SetUpperCST(xsec_id, deg, coefs)

Set the CST degree and coefficients for the upper surface of an airfoil. The number of coefficients should be one more than the CST degree. The XSec must be of type XS_CST_AIRFOIL See also: GetUpperCSTDegree, GetUpperCSTCoefs :param [in]: xsec_id string XSec ID :param [in]: deg int CST degree of upper airfoil surface :param [in]: coefs vector<double> Vector of CST coefficients for the upper airfoil surface

openvsp.vsp.SetVSP3FileName(file_name)

Set the file name of a OpenVSP project

fid = AddGeom( "FUSELAGE", "" )             # Add Fuselage

fname = "example_fuse.vsp3"

SetVSP3FileName( fname )

Update()

#==== Save Vehicle to File ====//
print( "\tSaving vehicle file to: ", False )

print( fname )

WriteVSPFile( GetVSPFileName(), SET_ALL )

#==== Reset Geometry ====//
print( "--->Resetting VSP model to blank slate\n" )

ClearVSPModel()

ReadVSPFile( fname )
Parameters:

[in] – file_name File name

openvsp.vsp.SetVSPAEROControlGroupName(name, CSGroupIndex)

Set the name for 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

SetVSPAEROControlGroupName( "Example_CS_Group", group_index )

print( "CS Group name: ", False )

print( GetVSPAEROControlGroupName( group_index ) )
Parameters:
  • [in] – name Name to set for the control surface group

  • [in] – CSGroupIndex Index of the control surface group

openvsp.vsp.SetVSPAEROPath(path)

Set the path to the VSPAERO executables (Solver, Viewer, and Slicer). By default, OpenVSP will assume that the VSPAERO executables are in the same directory as the VSP executable. However, this may need to be changed when using certain API languages like MATLAB and Python. For example, Python may treat the location of the Python executable as the VSP executable path, so either the VSPAERO executable needs to be moved to the same directory or this function can be called to tell Python where to look for VSPAERO.

if  not CheckForVSPAERO( GetVSPExePath() ) :
    vspaero_path = "C:/Users/example_user/Documents/OpenVSP_3.4.5"
    SetVSPAEROPath( vspaero_path )

See also: GetVSPExePath, CheckForVSPAERO, GetVSPAEROPath :param [in]: path Absolute path to directory containing VSPAERO executable :rtype: boolean :return: Flag that indicates whether or not the path was set correctly

openvsp.vsp.SetVSPAERORefWingID(geom_id)

Set the current VSPAERO reference Geom ID

#==== Add Wing Geom and set some parameters =====//
wing_id = AddGeom( "WING" )

SetGeomName( wing_id, "MainWing" )

#==== 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 )

#==== Set VSPAERO Reference lengths & areas ====//
SetVSPAERORefWingID( wing_id ) # Set as reference wing for VSPAERO

print( "VSPAERO Reference Wing ID: ", False )

print( GetVSPAERORefWingID() )
Parameters:

[in] – geom_id Reference Geom ID

openvsp.vsp.SetVec3dAnalysisInput(analysis, name, indata, index=0)

Set the value of a particular analysis input of vec3d type

# PlanarSlice
norm = GetVec3dAnalysisInput( "PlanarSlice", "Norm" )

norm[0].set_xyz( 0.23, 0.6, 0.15 )

SetVec3dAnalysisInput( "PlanarSlice", "Norm", norm )

See also: GetVec3dAnalysisInput :param [in]: analysis string Analysis name :param [in]: name string Input name :param [in]: indata vector<vec3d> Array of vec3d values to set the input to :param [in]: index int Data index

openvsp.vsp.SetView(viewport, view)

Set the view of a particular viewports

SetView( 0, CAM_CENTER )
Parameters:

[in] – view int CAMERA_VIEW enum

openvsp.vsp.SetViewAxis(vaxis)

Toggle viewing the axis

SetViewAxis( False )                                           # Turn off axis marker in corner of viewscreen
Parameters:

[in] – vaxis True to show the axis, false to hide the axis

openvsp.vsp.SetWindowLayout(r, c)

Set the rows and columns of the window layout

SetWindowLayout( 2, 2 )
Parameters:
  • [in] – r int Number of viewport rows

  • [in] – c int Number of viewport columns

openvsp.vsp.SetXSecContinuity(xsec_id, cx)

Set C-type continuity enforcement for a particular XSec

fid = AddGeom( "FUSELAGE", "" )             # Add Fuselage

xsec_surf = GetXSecSurf( fid, 0 )           # Get First (and Only) XSec Surf

num_xsecs = GetNumXSec( xsec_surf )

for i in range(num_xsecs):

    xsec = GetXSec( xsec_surf, i )

    SetXSecContinuity( xsec, 1 )                       # Set Continuity At Cross Section
Parameters:
  • [in] – xsec_id string XSec ID

  • [in] – cx int Continuity level (0, 1, or 2)

openvsp.vsp.SetXSecCurvatures(xsec_id, side, top, right, bottom, left)

Set curvatures for the specified XSec

# 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 )

    SetXSecCurvatures( xsec, XSEC_BOTH_SIDES, 0.2, -1.0e12, -1.0e12, -1.0e12 )  # Set Tangent Strengths At Cross Section

See also: XSEC_SIDES_TYPE :param [in]: xsec_id XSec ID :param [in]: side Side type enum (i.e. XSEC_BOTH_SIDES) :param [in]: top Top curvature :param [in]: right Right curvature :param [in]: bottom Bottom curvature :param [in]: left Left curvature

openvsp.vsp.SetXSecHeight(xsec_id, h)

Set the height of an XSec. Note that POINT type XSecs have a width and height of 0, regardless of what is input to SetXSecHeight.

# Add Stack
sid = AddGeom( "STACK", "" )

# Get First (and Only) XSec Surf
xsec_surf = GetXSecSurf( sid, 0 )

# Identify XSec 2
xsec_2 = GetXSec( xsec_surf, 2 )

SetXSecHeight( xsec_2, 1.5 )

See also: GetXSecHeight :param [in]: xsec_id XSec ID :param [in]: h Xsec height

openvsp.vsp.SetXSecPnts(xsec_id, pnt_vec)

Set the coordinate points for a specific XSec. The XSec must be of type XS_FILE_FUSE.

# Add Fuselage Geom
fuseid = AddGeom( "FUSELAGE", "" )

xsec_surf = GetXSecSurf( fuseid, 0 )

ChangeXSecShape( xsec_surf, 2, XS_FILE_FUSE )

xsec = GetXSec( xsec_surf, 2 )

vec_array = ReadFileXSec(xsec, "TestXSec.fxs")


if  len(vec_array) > 0 :
    vec_array[1] = vec_array[1] * 2.0
    vec_array[3] = vec_array[3] * 2.0

    SetXSecPnts( xsec, vec_array )
Parameters:
  • [in] – xsec_id string XSec ID

  • [in] – pnt_vec vector<vec3d> Vector of XSec coordinate points

openvsp.vsp.SetXSecSurfGlobalXForm(xsec_surf_id, mat)

Set the global surface transform matrix for given XSecSurf :param [in]: xsec_surf_id XSecSurf ID :param [in]: mat Transformation matrix

openvsp.vsp.SetXSecTanAngles(xsec_id, side, top, right, bottom, left)

Set the tangent angles for the specified XSec

# Add Stack
sid = AddGeom( "STACK", "" )

# Get First (and Only) XSec Surf
xsec_surf = GetXSecSurf( sid, 0 )

num_xsecs = GetNumXSec( xsec_surf )

for i in range(num_xsecs):

    xsec = GetXSec( xsec_surf, i )

    SetXSecTanAngles( xsec, XSEC_BOTH_SIDES, 10.0, -1.0e12, -1.0e12, -1.0e12 )       # Set Tangent Angles At Cross Section

See also: XSEC_SIDES_TYPE :param [in]: xsec_id string XSec ID :param [in]: side int Side type enum (i.e. XSEC_BOTH_SIDES) :param [in]: top double Top angle (degrees) :param [in]: right double Right angle (degrees) :param [in]: bottom double Bottom angle (degrees) :param [in]: left double Left angle (degrees)

openvsp.vsp.SetXSecTanSlews(xsec_id, side, top, right, bottom, left)

Set the tangent slew angles for the specified XSec

# Add Stack
sid = AddGeom( "STACK", "" )

# Get First (and Only) XSec Surf
xsec_surf = GetXSecSurf( sid, 0 )

num_xsecs = GetNumXSec( xsec_surf )

for i in range(num_xsecs):

    xsec = GetXSec( xsec_surf, i )

    SetXSecTanSlews( xsec, XSEC_BOTH_SIDES, 5.0, -1.0e12, -1.0e12, -1.0e12 )       # Set Tangent Slews At Cross Section

See also: XSEC_SIDES_TYPE :param [in]: xsec_id XSec ID :param [in]: side Side type enum (i.e. XSEC_BOTH_SIDES) :param [in]: top Top angle (degrees) :param [in]: right Right angle (degrees) :param [in]: bottom Bottom angle (degrees) :param [in]: left Left angle (degrees)

openvsp.vsp.SetXSecTanStrengths(xsec_id, side, top, right, bottom, left)

Set the tangent strengths for the specified XSec

# 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 )

    SetXSecTanStrengths( xsec, XSEC_BOTH_SIDES, 0.8, -1.0e12, -1.0e12, -1.0e12 )  # Set Tangent Strengths At Cross Section

See also: XSEC_SIDES_TYPE :param [in]: xsec_id XSec ID :param [in]: side Side type enum (i.e. XSEC_BOTH_SIDES) :param [in]: top Top strength :param [in]: right Right strength :param [in]: bottom Bottom strength :param [in]: left Left strength

openvsp.vsp.SetXSecWidth(xsec_id, w)

Set the width of an XSec. Note that POINT type XSecs have a width and height of 0, regardless of what is input to SetXSecWidth.

# Add Stack
sid = AddGeom( "STACK", "" )

# Get First (and Only) XSec Surf
xsec_surf = GetXSecSurf( sid, 0 )

# Identify XSec 2
xsec_2 = GetXSec( xsec_surf, 2 )

SetXSecWidth( xsec_2, 1.5 )

See also: GetXSecWidth :param [in]: xsec_id XSec ID :param [in]: w Xsec width

openvsp.vsp.SetXSecWidthHeight(xsec_id, w, h)

Set the width and height of an XSec. Note, if the XSec is an EDIT_CURVE type and PreserveARFlag is true, the input width value will be ignored and instead set from on the input height and aspect ratio. Use SetXSecWidth and SetXSecHeight directly to avoid this.

# Add Stack
sid = AddGeom( "STACK", "" )

# Get First (and Only) XSec Surf
xsec_surf = GetXSecSurf( sid, 0 )

# Identify XSec 2
xsec_2 = GetXSec( xsec_surf, 2 )

SetXSecWidthHeight( xsec_2, 1.5, 1.5 )

See also: SetXSecWidth, SetXSecHeight :param [in]: xsec_id XSec ID :param [in]: w Xsec width :param [in]: h Xsec height

openvsp.vsp.ShowAllBackground3Ds()

Show all Background3Ds in model

# Add Background3D
AddBackground3D()
AddBackground3D()
AddBackground3D()

ShowAllBackground3Ds()

DelAllBackground3Ds()
openvsp.vsp.SnapParm(*args)

Snap the specified Parm to input target minimum clearance distance

#Add Geoms
fid = AddGeom( "FUSELAGE", "" )             # Add Fuselage

pid = AddGeom( "POD", "" )                     # Add Pod

x = GetParm( pid, "X_Rel_Location", "XForm" )

SetParmVal( x, 3.0 )

Update()

min_dist = SnapParm( x, 0.1, True, SET_ALL )
Parameters:
  • [in] – parm_id string Parm ID

  • [in] – target_min_dist Target minimum clearance distance

  • [in] – inc_flag Direction indication flag. If true, upper parm limit is used and direction is set to positive

  • [in] – set Collision set enum (i.e. SET_ALL)

Return type:

float

Returns:

Minimum clearance distance

openvsp.vsp.StartGUI()

Launch the interactive OpenVSP GUI. In a multi-threaded environment, this must be called from the main thread only. This starts the GUI event loop. It will also show the main screen and screens displayed when StopGUI() was previously called.

InitGUI()
StartGUI()

See also: InitGUI

openvsp.vsp.StopGUI()

Stop OpenVSP GUI event loop and hide screens. Keep OpenVSP running and in memory.

InitGUI()
StartGUI()

StopGUI()

StartGUI()

See also: InitGUI, StartGUI

class openvsp.vsp.StringVector(*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.SwigPyIterator(*args, **kwargs)

Bases: object

advance(n)
copy()
decr(n=1)
distance(x)
equal(x)
incr(n=1)
next()
previous()
property thisown

The membership flag

value()
openvsp.vsp.SwitchVarPreset(group_name, setting_name)

Change the currently active Variable Preset

# Add Pod Geom
pod1 = AddGeom( "POD", "" )

AddVarPresetGroup( "Config" )

AddVarPresetSetting( "Default" )

p1 = FindParm( pod1, "Y_Rel_Rotation", "XForm" )
p2 = FindParm( pod1, "Z_Rel_Rotation", "XForm" )

AddVarPresetParm( p1 )
AddVarPresetParm( p2 )

SwitchVarPreset( "Config", "Default" )
Parameters:
  • [in] – group_name Variable Presets group name

  • [in] – setting_name Variable Presets setting name

openvsp.vsp.TAG = 0

Color mesh by tag value (component, subsurface, part, etc)

openvsp.vsp.TAPER_WSECT_DRIVER = 3

Taper driver

openvsp.vsp.TEMP_UNIT_C = 1

Celsius

openvsp.vsp.TEMP_UNIT_F = 2

Fahrenheit

openvsp.vsp.TEMP_UNIT_K = 0

Kelvin

openvsp.vsp.TEMP_UNIT_R = 3

Rankine

openvsp.vsp.TE_NORMAL = 2

FEA Rib or Rib Array is set perpendicular to the trailing edge

openvsp.vsp.TIPC_WSECT_DRIVER = 6

Tip chord driver

openvsp.vsp.TRIM_NONE = 0

No trimming

openvsp.vsp.TRIM_NUM_TYPES = 3

Number of trimming types

openvsp.vsp.TRIM_THICK = 2

Trim XSec by thickness

openvsp.vsp.TRIM_X = 1

Trim XSec by X

openvsp.vsp.TransformSet(set_index, translation_vec, x_rot_deg, y_rot_deg, z_rot_deg, scale, scale_translations_flag)

Apply translation, rotation, and scale transformations to a set

# Add Fuselage Geom
fuseid = AddGeom( "FUSELAGE" )

SetSetFlag( fuseid, 3, True )

# Translate 2 units in X and 3 units in Y, rotate 90 degrees about Y, and scale by a factor of 2
TransformSet( 3, vec3d( 2, 3, 0 ), 0, 90, 0, 2.0, True )

See also: TranslateSet, RotateSet, ScaleSet :param [in]: set_index Set index :param [in]: translation_vec Translation vector :param [in]: x_rot_deg Rotation about the X axis (degrees) :param [in]: y_rot_deg Rotation about the Y axis (degrees) :param [in]: z_rot_deg Rotation about the Z axis (degrees) :param [in]: scale Scale factor :param [in]: scale_translations_flag Flag to apply the scale factor to translations

openvsp.vsp.TranslateSet(set_index, translation_vec)

Translate a set along a given vector

# Add Fuselage Geom
fuseid = AddGeom( "FUSELAGE" )

SetSetFlag( fuseid, 3, True )

# Translate 2 units in X and 3 units in Y
TranslateSet( 3, vec3d( 2, 3, 0 ) )
Parameters:
  • [in] – set_index Set index

  • [in] – translation_vec Translation vector

openvsp.vsp.ULINE_SOURCE = 3

Constant U Line source

openvsp.vsp.U_TRIM = 0

Trim by U coordinate

openvsp.vsp.Unlock()

Release the lock on the OpenVSP GUI event loop.

InitGUI()
StartGUI()

pod_id = AddGeom( "POD" )

Lock()
rid = ExecAnalysis( "CompGeom" )

mesh_id_vec = GetStringResults( rid, "Mesh_GeomID" )

DeleteGeomVec( mesh_id_vec )
Unlock()

See also: Lock

openvsp.vsp.Update(update_managers=True)

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

fid = AddGeom( "FUSELAGE", "" )             # Add Fuselage

xsec_surf = GetXSecSurf( fid, 0 )           # Get First (and Only) XSec Surf

num_xsecs = GetNumXSec( xsec_surf )

#==== Set Tan Angles At Nose/Tail
SetXSecTanAngles( GetXSec( xsec_surf, 0 ), XSEC_BOTH_SIDES, 90, -1.0e12, -1.0e12, -1.0e12 )
SetXSecTanAngles( GetXSec( xsec_surf, num_xsecs - 1 ), XSEC_BOTH_SIDES, -90, -1.0e12, -1.0e12, -1.0e12 )

Update()       # Force Surface Update
Parameters:

update_managers (boolean, optional) – Flag to indicate if managers should be updated

openvsp.vsp.UpdateGUI()

Tell OpenVSP that the GUI needs to be updated.

InitGUI()
StartGUI()

pod_id = AddGeom( "POD" )

length = FindParm( pod_id, "Length", "Design" )

SetParmVal( length, 13.0 )

UpdateGUI()

See also: InitGUI, StartGUI

openvsp.vsp.UpdateGeom(geom_id)

Perform an update for the specified Geom

#==== Add Wing Geometry ====//
wing_id = AddGeom( "WING" )

#==== Add Pod Geometry ====//
pod_id = AddGeom( "POD" )

SetParmVal( pod_id, "X_Rel_Location", "XForm", 5.0 )

UpdateGeom( pod_id ) # Faster than updating the whole vehicle

See also: Update() :param [in]: geom_id string Geom ID

openvsp.vsp.UpdateParasiteDrag()

Update any reference geometry, atmospheric properties, excressences, etc. in the Parasite Drag Tool

openvsp.vsp.VEC3D_DATA = 3

Vec3d result data type

openvsp.vsp.VEC_PROJ = 4

Project along a 3D vector

openvsp.vsp.VIEW_1 = 0

One 2D view

openvsp.vsp.VIEW_2HOR = 1

Two horizontal 2D views

openvsp.vsp.VIEW_2VER = 2

Two vertical 2D views

openvsp.vsp.VIEW_4 = 3

Four 2D views

openvsp.vsp.VIEW_BOTTOM = 3

Bottom 2D view type

openvsp.vsp.VIEW_FRONT = 4

Front 2D view type

openvsp.vsp.VIEW_LEFT = 0

Left 2D view type

openvsp.vsp.VIEW_NONE = 6

No 2D view type

openvsp.vsp.VIEW_NUM_TYPES = 7

Number of 2D view types

openvsp.vsp.VIEW_REAR = 5

Rear 2D view type

openvsp.vsp.VIEW_RIGHT = 1

Right 2D view type

openvsp.vsp.VIEW_TOP = 2

Top 2D view type

openvsp.vsp.VORTEX_LATTICE = 0

VSPAERO vortex lattice method

openvsp.vsp.VSPCheckSetup()

Check if OpenVSP has been initialized successfully. If not, the OpenVSP instance will be exited. This call should be placed at the beginning of all API scripts.

VSPCheckSetup()

# Continue to do things...
openvsp.vsp.VSPExit(error_code)

Exit the program with a specific error code :param [in]: error_code Error code

openvsp.vsp.VSPRenew()

Clear and reinitialize OpenVSP to all default settings

#==== Add Pod Geometry ====//
pod_id = AddGeom( "POD" )

SetParmVal( pod_id, "Y_Rel_Location", "XForm", 2.0 )

VSPRenew()

if  len(FindGeoms()) != 0 : print( "ERROR: VSPRenew" )

Advanced link build failure

Advanced linking screen

Advanced link variable rename screen

openvsp.vsp.VSP_AERO_STRUCT_SCREEN = 2

Aero / structural analysis screen

openvsp.vsp.VSP_AIRFOIL_CURVES_EXPORT_SCREEN = 3

Airfoil curves export screen

openvsp.vsp.VSP_AIRFOIL_POINTS_EXPORT_SCREEN = 4

Airfoil points screen

openvsp.vsp.VSP_ALL_SCREENS = 60

Flag for all screens

openvsp.vsp.VSP_AMBIGUOUS_SUBSURF = 17

Ambiguous flow-through sub-surface error

openvsp.vsp.VSP_BACKGROUND3D_PREVIEW_SCREEN = 7

Background3D preview screen

openvsp.vsp.VSP_BACKGROUND3D_SCREEN = 6

Background3D control screen

openvsp.vsp.VSP_BACKGROUND_SCREEN = 5

Background control screen

openvsp.vsp.VSP_BEM_OPTIONS_SCREEN = 8

Blade element method options screen

openvsp.vsp.VSP_CANT_FIND_NAME = 5

Can’t find name error

openvsp.vsp.VSP_CANT_FIND_PARM = 4

Can’t find parm error

openvsp.vsp.VSP_CANT_FIND_TYPE = 3

Can’t find type error

openvsp.vsp.VSP_CANT_SET_NOT_EQ_PARM = 16

Can’t set NotEqParm error

openvsp.vsp.VSP_CFD_MESH_SCREEN = 9

CFD Mesh screen

openvsp.vsp.VSP_CLIPPING_SCREEN = 10

Clipping screen

openvsp.vsp.VSP_COMP_GEOM_SCREEN = 11

CompGeom screen

openvsp.vsp.VSP_CONFORMAL_PARENT_UNSUPPORTED = 20

Unsupported Conformal Geom parent error

openvsp.vsp.VSP_COR_SCREEN = 12

Center of rotation screen

openvsp.vsp.VSP_COULD_NOT_CREATE_BACKGROUND3D = 30

Could not create and add Background3D

openvsp.vsp.VSP_CURVE_EDIT_SCREEN = 13

Curve edit screen

openvsp.vsp.VSP_DEGEN_GEOM_SCREEN = 14

Degen geom screen

openvsp.vsp.VSP_DEPRECATED = 26

This capability has been deprecated and is not longer supported

openvsp.vsp.VSP_DESIGN_VAR_SCREEN = 15

Design variables screen

openvsp.vsp.VSP_DUPLICATE_NAME = 28

A duplicate name has been provided

openvsp.vsp.VSP_DXF_OPTIONS_SCREEN = 16

DXF options screen

openvsp.vsp.VSP_EXPORT_CUSTOM_SCRIPT = 23

Custom geom export screen

openvsp.vsp.VSP_EXPORT_SCREEN = 17

Export screen

openvsp.vsp.VSP_FEA_PART_EDIT_SCREEN = 18

FEA Part edit screen

openvsp.vsp.VSP_FEA_XSEC_SCREEN = 19

FEA XSec screen

openvsp.vsp.VSP_FILE_DOES_NOT_EXIST = 7

File does not exist error

openvsp.vsp.VSP_FILE_READ_FAILURE = 9

File read failure error

openvsp.vsp.VSP_FILE_WRITE_FAILURE = 8

File write failure error

openvsp.vsp.VSP_FIT_MODEL_SCREEN = 20

Fit model screen

openvsp.vsp.VSP_GUI_DEVICE_DEACTIVATED = 29

A deactivated GUI device was touched

openvsp.vsp.VSP_IGES_OPTIONS_SCREEN = 21

IGES options screen

openvsp.vsp.VSP_IGES_STRUCTURE_OPTIONS_SCREEN = 22

IGES structure options screen

openvsp.vsp.VSP_IMPORT_SCREEN = 24

Import screen

openvsp.vsp.VSP_INDEX_OUT_RANGE = 13

Index out of range error

openvsp.vsp.VSP_INVALID_CF_EQN = 23

Invalid friction coefficient equation error

openvsp.vsp.VSP_INVALID_DRIVERS = 24

Invalid drivers for driver group

openvsp.vsp.VSP_INVALID_GEOM_ID = 6

Invalid Geom ID error

openvsp.vsp.VSP_INVALID_ID = 15

Invalid ID error

openvsp.vsp.VSP_INVALID_INPUT_VAL = 22

Invalid input value error

openvsp.vsp.VSP_INVALID_PTR = 1

Invalid pointer error

openvsp.vsp.VSP_INVALID_TYPE = 2

Invalid type error

openvsp.vsp.VSP_INVALID_VARPRESET_GROUPNAME = 19

Invalid Variable Preset group name error

openvsp.vsp.VSP_INVALID_VARPRESET_SETNAME = 18

Invalid Variable Preset set name error

openvsp.vsp.VSP_INVALID_XSEC_ID = 14

Invalid XSec ID error

openvsp.vsp.VSP_LIGHTING_SCREEN = 25

Lighting screen

A parameter link loop was detected and stopped

openvsp.vsp.VSP_MAIN_SCREEN = 58

Main screen

openvsp.vsp.VSP_MANAGE_GEOM_SCREEN = 26

Manage geom screen

openvsp.vsp.VSP_MANAGE_TEXTURE_SCREEN = 27

Texture mapping screen

openvsp.vsp.VSP_MASS_PROP_SCREEN = 28

Mass properties screen

openvsp.vsp.VSP_MATERIAL_EDIT_SCREEN = 29

Material edit screen

openvsp.vsp.VSP_MEASURE_SCREEN = 30

Measure screen

openvsp.vsp.VSP_NERF_MANAGE_GEOM_SCREEN = 31

NERF’ed (limited to make safe) Manage geom screen

openvsp.vsp.VSP_NUM_ERROR_CODE = 31

Total number of VSP error codes

openvsp.vsp.VSP_NUM_SCREENS = 59

Number of screens

openvsp.vsp.VSP_OK = 0

No error

openvsp.vsp.VSP_PARASITE_DRAG_SCREEN = 33

Parasite drg screen

openvsp.vsp.VSP_PARM_DEBUG_SCREEN = 34

Parameter debug screen

Parameter linking screen

openvsp.vsp.VSP_PARM_SCREEN = 36

Parameter screen

openvsp.vsp.VSP_PICK_SET_SCREEN = 37

Pick set screen

openvsp.vsp.VSP_PREFERENCES_SCREEN = 38

Preferences screen

openvsp.vsp.VSP_PROJECTION_SCREEN = 39

Projected area screen

openvsp.vsp.VSP_PSLICE_SCREEN = 40

Planar slicing screen

openvsp.vsp.VSP_SCREENSHOT_SCREEN = 41

Screenshot screen

openvsp.vsp.VSP_SELECT_FILE_SCREEN = 42

Select file screen

openvsp.vsp.VSP_SET_EDITOR_SCREEN = 43

Set editor screen

openvsp.vsp.VSP_SNAP_TO_SCREEN = 32

Snap to screen

openvsp.vsp.VSP_STEP_OPTIONS_SCREEN = 44

STEP options screen

openvsp.vsp.VSP_STEP_STRUCTURE_OPTIONS_SCREEN = 45

STEP structure options screen

openvsp.vsp.VSP_STL_OPTIONS_SCREEN = 46

STL options screen

openvsp.vsp.VSP_STRUCT_ASSEMBLY_SCREEN = 48

Structure assembly screen

openvsp.vsp.VSP_STRUCT_SCREEN = 47

Structure definition screen

openvsp.vsp.VSP_SURFACE_INTERSECTION_SCREEN = 49

Surface intersection screen

openvsp.vsp.VSP_SVG_OPTIONS_SCREEN = 50

SVG options screen

openvsp.vsp.VSP_UNEXPECTED_RESET_REMAP_ID = 21

Unexpected reset remap ID error

openvsp.vsp.VSP_USER_PARM_SCREEN = 51

User parameter screen

openvsp.vsp.VSP_VAR_PRESET_SCREEN = 52

Variable presets screen

openvsp.vsp.VSP_VIEW_SCREEN = 53

Adjust viewpoint screen

openvsp.vsp.VSP_VSPAERO_PLOT_SCREEN = 54

VSPAERO results manager screen

openvsp.vsp.VSP_VSPAERO_SCREEN = 55

VSPAERO screen

openvsp.vsp.VSP_WAVEDRAG_SCREEN = 57

Wave drag screen

openvsp.vsp.VSP_WRONG_FILE_TYPE = 12

Wrong file type error

openvsp.vsp.VSP_WRONG_GEOM_TYPE = 10

Wrong Geom type error

openvsp.vsp.VSP_WRONG_XSEC_TYPE = 11

Wrong XSec type error

openvsp.vsp.VSP_XSEC_SCREEN = 56

XSec screen

openvsp.vsp.V_UNIT_FT_S = 0

Feet per second

openvsp.vsp.V_UNIT_KEAS = 4

Knots equivalent airspeed

openvsp.vsp.V_UNIT_KM_HR = 3

Kilometer per hour

openvsp.vsp.V_UNIT_KTAS = 5

Knots true airspeed

openvsp.vsp.V_UNIT_MACH = 6

Mach

openvsp.vsp.V_UNIT_MPH = 2

Mile per hour

openvsp.vsp.V_UNIT_M_S = 1

Meter per second

openvsp.vsp.ValidParm(id)

Check if given Parm is valid

#==== Add Pod Geometry ====//
pid = AddGeom( "POD" )

lenid = GetParm( pid, "Length", "Design" )

if  not ValidParm( lenid ) : print( "---> Error: API GetParm  " )
Parameters:

[in] – id Parm ID

Return type:

boolean

Returns:

True if Parm ID is valid, false otherwise

openvsp.vsp.ValidateAdvLinkParms(index)

Validate the input and output parameters for 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 )

valid = ValidateAdvLinkParms( indx )

if  valid :
    print( "Advanced link Parms are valid." )
else:
    print( "Advanced link Parms are not valid." )
Parameters:

[in] – index int Index for advanced link

Return type:

boolean

Returns:

Flag indicating whether parms are valid

class openvsp.vsp.Vec3dVec(*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.VecInsideSurf(geom_id, surf_indx, pts)

Test whether a vector of points are inside a specified surface.

# Add Pod Geom
geom_id = AddGeom( "POD", "" )

surf_indx = 0

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 )


res = VecInsideSurf( geom_id, surf_indx, ptvec )

See also: VecInsideSurf :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 :rtype: std::vector< bool,std::allocator< bool > > :return: Boolean vector for each point. True if it is inside the surface, false otherwise.

openvsp.vsp.WING_SURF = 1

Wing VSP surface

openvsp.vsp.WIRE_FRAME_GEOM_SCREEN = 14

Wireframe geom screen

openvsp.vsp.WLINE_SOURCE = 4

Constant W Line source

openvsp.vsp.W_BOTTOM = 1

Chevron start/ends at bottom of cross section

openvsp.vsp.W_FREE = 5

Chevron start/ends at user specified point on cross section

openvsp.vsp.W_LEFT = 2

Chevron start/ends at left of cross section

openvsp.vsp.W_RIGHT_0 = 0

Chevron start/ends at right (W = 0) of cross section

openvsp.vsp.W_RIGHT_1 = 4

Chevron start/ends at right (W = 1) of cross section

openvsp.vsp.W_TOP = 3

Chevron start/ends at top of cross section

openvsp.vsp.WriteAtmosphereCSVFile(file_name, atmos_type)

Calculate the atmospheric properties determined by a specified model for a preset array of altitudes ranging from 0 to 90000 m and write the results to a CSV output file

print( "Starting USAF Atmosphere 1966 Table Creation. \n" )

WriteAtmosphereCSVFile( "USAFAtmosphere1966Data.csv", ATMOS_TYPE_HERRINGTON_1966 )

See also: ATMOS_TYPE :param [in]: file_name Output CSV file :param [in]: atmos_type Atmospheric model enum (i.e. ATMOS_TYPE_HERRINGTON_1966)

openvsp.vsp.WriteBezierAirfoil(file_name, geom_id, foilsurf_u)

Write out the untwisted unit-length 2D Bezier curve for the specified airfoil in custom *.bz format. The output will describe the analytical shape of the airfoil. See BezierAirfoilExample.m and BezierCtrlToCoordPnts.m for examples of discretizing the Bezier curve and generating a Selig airfoil file.

#==== Add Wing Geometry and Set Parms ====//
wing_id = AddGeom( "WING", "" )

u = 0.5 # export airfoil at mid span location

#==== Write Bezier Airfoil File ====//
WriteBezierAirfoil( "Example_Bezier.bz", wing_id, u )
Parameters:
  • [in] – file_name Airfoil (*.bz) output file name

  • [in] – geom_id string Geom ID

  • [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.WriteBodyFFCSVFile(file_name)

Calculate the form factor from each body FF equation (i.e. Hoerner Streamlined Body) and write the results to a CSV output file

print( "Starting Body Form Factor Data Creation. \n" )
WriteBodyFFCSVFile( "BodyFormFactorData.csv" )
Parameters:

[in] – file_name Output CSV file

openvsp.vsp.WriteCfEqnCSVFile(file_name)

Calculate the coefficient of friction from each Cf equation (i.e. Power Law Blasius) and write the results to a CSV output file

print( "Starting Turbulent Friciton Coefficient Data Creation. \n" )
WriteCfEqnCSVFile( "FrictionCoefficientData.csv" )
Parameters:

[in] – file_name Output CSV file

openvsp.vsp.WriteDESFile(file_name)

Write all design variables to a design file (*.des) :param [in]: file_name *.des output file

openvsp.vsp.WritePartialCfMethodCSVFile(file_name)

Calculate the partial coefficient of friction and write the results to a CSV output file

print( "Starting Partial Friction Method Data Creation. \n" )
WritePartialCfMethodCSVFile( "PartialFrictionMethodData.csv" )
Parameters:

[in] – file_name Output CSV file

openvsp.vsp.WriteResultsCSVFile(id, file_name)

Export a result to CSV

# Add Pod Geom
pid = AddGeom( "POD" )

analysis_name = "VSPAEROComputeGeometry"

rid = ExecAnalysis( analysis_name )

WriteResultsCSVFile( rid, "CompGeomRes.csv" )
Parameters:
  • [in] – id Rsult ID

  • [in] – file_name CSV output file name

openvsp.vsp.WriteSeligAirfoil(file_name, geom_id, foilsurf_u)

Write out the untwisted unit-length 2D coordinate points for the specified airfoil in Selig format. Coordinate points follow the on-screen wire frame W tessellation.

#==== Add Wing Geometry and Set Parms ====//
wing_id = AddGeom( "WING", "" )

u = 0.5 # export airfoil at mid span location

#==== Write Selig Airfoil File ====//
WriteSeligAirfoil( "Example_Selig.dat", wing_id, u )

See also: GetAirfoilCoordinates :param [in]: file_name Airfoil (*.dat) output file name :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.WriteTestResults()

Generate some example results for testing.

#==== Write Some Fake Test Results =====//
WriteTestResults()

results_array = GetAllResultsNames()

for i in range( len( results_array ) ):
    resid = FindLatestResultsID( results_array[i] )
    PrintResults( resid )
openvsp.vsp.WriteVSPFile(*args)

Save the current OpenVSP project to a VSP3 file

fid = AddGeom( "FUSELAGE", "" )             # Add Fuselage

fname = "example_fuse.vsp3"

SetVSP3FileName( fname )

Update()

#==== Save Vehicle to File ====//
print( "\tSaving vehicle file to: ", False )

print( fname )

WriteVSPFile( GetVSPFileName(), SET_ALL )

#==== Reset Geometry ====//
print( "--->Resetting VSP model to blank slate\n" )

ClearVSPModel()

ReadVSPFile( fname )
Parameters:
  • [in] – file_name *.vsp3 file name

  • [in] – set Set index to write (i.e. SET_ALL)

openvsp.vsp.WriteWingFFCSVFile(file_name)

Calculate the form factor from each wing FF equation (i.e. Schemensky 4 Series Airfoil) and write the results to a CSV output file

print( "Starting Wing Form Factor Data Creation. \n" )
WriteWingFFCSVFile( "WingFormFactorData.csv" )
Parameters:

[in] – file_name Output CSV file

openvsp.vsp.WriteXDDMFile(file_name)

Write all design variables to a Cart3D XDDM file (*.xddm) :param [in]: file_name *.xddm output file

openvsp.vsp.XDDM_CONST = 1

Constant XDDM type

openvsp.vsp.XDDM_VAR = 0

Variable XDDM type

openvsp.vsp.XSEC_BOTH_SIDES = 0

Both sides

openvsp.vsp.XSEC_CUSTOM = 3

Custom XSec Geom

openvsp.vsp.XSEC_FUSE = 0

Fuselage XSec Geom

openvsp.vsp.XSEC_LEFT_SIDE = 1

Left side

openvsp.vsp.XSEC_NUM_TYPES = 5

Number of XSec types

openvsp.vsp.XSEC_PROP = 4

Propeller XSec Geom

openvsp.vsp.XSEC_RIGHT_SIDE = 2

Right side

openvsp.vsp.XSEC_STACK = 1

Stack XSec Geom

openvsp.vsp.XSEC_WING = 2

Wing XSec Geom

openvsp.vsp.XS_BICONVEX = 9

Biconvex XSec

openvsp.vsp.XS_CIRCLE = 1

Circle XSec

openvsp.vsp.XS_CST_AIRFOIL = 13

CST airfoil XSec

openvsp.vsp.XS_EDIT_CURVE = 11

Generic Edit Curve XSec

openvsp.vsp.XS_ELLIPSE = 2

Ellipse XSec

openvsp.vsp.XS_FILE_AIRFOIL = 12

Airfoil file XSec

openvsp.vsp.XS_FILE_FUSE = 6

Fuselage file XSec

openvsp.vsp.XS_FIVE_DIGIT = 16

Five digit XSec

openvsp.vsp.XS_FIVE_DIGIT_MOD = 17

Five digit modified XSec

openvsp.vsp.XS_FOUR_DIGIT_MOD = 15

Four digit modified XSec

openvsp.vsp.XS_FOUR_SERIES = 7

Four series XSec

openvsp.vsp.XS_GENERAL_FUSE = 5

General fuselage XSec

openvsp.vsp.XS_NUM_TYPES = 19

Number of XSec types

openvsp.vsp.XS_ONE_SIX_SERIES = 18

One six series XSec

openvsp.vsp.XS_POINT = 0

Point XSec

openvsp.vsp.XS_ROUNDED_RECTANGLE = 4

Rounded rectangle XSec

openvsp.vsp.XS_SHIFT_LE = 0

Shift leading edge

openvsp.vsp.XS_SIX_SERIES = 8

Six series XSec

openvsp.vsp.XS_SUPER_ELLIPSE = 3

Super ellipse XSec

openvsp.vsp.XS_VKT_AIRFOIL = 14

VKT airfoil XSec

openvsp.vsp.XS_WEDGE = 10

Wedge XSec

openvsp.vsp.XY_ABS = 3

Slice is parallel to absolute XY plane

openvsp.vsp.XY_BODY = 0

Slice is parallel to parent Geom body XY plane

openvsp.vsp.XZ_ABS = 5

Slice is parallel to absolute XZ plane

openvsp.vsp.XZ_BODY = 2

Slice is parallel to parent Geom body XZ plane

openvsp.vsp.X_DIR = 0

X direction

openvsp.vsp.X_PROJ = 0

Project in X axis direction

openvsp.vsp.YZ_ABS = 4

Slice is parallel to absolute YZ plane

openvsp.vsp.YZ_BODY = 1

Slice is parallel to parent Geom body YZ plane

openvsp.vsp.Y_PROJ = 1

Project in Y axis direction

openvsp.vsp.Z_PROJ = 2

Project in Z axis direction

openvsp.vsp.angle(vec3d a, vec3d b) double
openvsp.vsp.area(vec3d A, vec3d B, vec3d C) double
openvsp.vsp.center_of_circle(vec3d p1, vec3d p2, vec3d p3, vec3d center)
openvsp.vsp.cos_angle(vec3d a, vec3d b) double
openvsp.vsp.cross(vec3d a, vec3d b) vec3d
openvsp.vsp.dist(vec3d a, vec3d b) double
openvsp.vsp.dist3D_Segment_to_Segment(vec3d S1P0, vec3d S1P1, vec3d S2P0, vec3d S2P1) double
openvsp.vsp.dist3D_Segment_to_Segment(vec3d S1P0, vec3d S1P1, vec3d S2P0, vec3d S2P1, double * Lt, vec3d Ln, double * St, vec3d Sn) double
openvsp.vsp.dist_pnt_2_line(vec3d line_pt1, vec3d line_pt2, vec3d pnt) double
openvsp.vsp.dist_pnt_2_plane(vec3d org, vec3d norm, vec3d pnt) double
openvsp.vsp.dist_squared(vec3d a, vec3d b) double
openvsp.vsp.dot(vec3d a, vec3d b) double
openvsp.vsp.line_line_intersect(vec3d p1, vec3d p2, vec3d p3, vec3d p4, double * s, double * t) bool
openvsp.vsp.nearSegSeg(vec3d L0, vec3d L1, vec3d S0, vec3d S1, double * Lt, vec3d Ln, double * St, vec3d Sn) double
openvsp.vsp.plane_half_space(vec3d planeOrig, vec3d planeNorm, vec3d pnt) int
openvsp.vsp.plane_ray_intersect(vec3d A, vec3d B, vec3d C, vec3d D, vec3d E, double & t) int
openvsp.vsp.plane_ray_intersect(vec3d orig, vec3d norm, vec3d D, vec3d E, double & t) int
openvsp.vsp.pnt_tri_min_dist(vec3d v0, vec3d v1, vec3d v2, vec3d pnt) double
openvsp.vsp.pointLineDistSquared(vec3d p, vec3d lp0, vec3d lp1, double * t) double
openvsp.vsp.pointSegDistSquared(vec3d p, vec3d sp0, vec3d sp1, double * t) double
openvsp.vsp.point_on_line(vec3d lp0, vec3d lp1, double const & t) vec3d
openvsp.vsp.poly_area(Vec3dVec pnt_vec) double
openvsp.vsp.proj_pnt_on_line(vec3d line_pt1, vec3d line_pt2, vec3d pnt) vec3d
openvsp.vsp.proj_pnt_on_line_seg(vec3d line_pt1, vec3d line_pt2, vec3d pnt) vec3d
openvsp.vsp.proj_pnt_on_ray(vec3d line_pt1, vec3d line_pt2, vec3d pnt) vec3d
openvsp.vsp.proj_pnt_to_plane(vec3d org, vec3d plane_ln1, vec3d plane_ln2, vec3d pnt) vec3d
openvsp.vsp.proj_vec_to_plane(vec3d vec, vec3d norm) vec3d
openvsp.vsp.radius_of_circle(vec3d p1, vec3d p2, vec3d p3) double
openvsp.vsp.ray_ray_intersect(vec3d A, vec3d B, vec3d C, vec3d D, vec3d int_pnt1, vec3d int_pnt2) int
openvsp.vsp.signed_angle(vec3d a, vec3d b, vec3d ref) double
openvsp.vsp.slerp(vec3d a, vec3d b, double const & t) vec3d
openvsp.vsp.tetra_volume(vec3d A, vec3d B, vec3d C) double
openvsp.vsp.to_string(vec3d v) std::string
openvsp.vsp.tri_ray_intersect(vec3d A, vec3d B, vec3d C, vec3d D, vec3d E, double & u, double & w, double & t) int
openvsp.vsp.tri_seg_intersect(vec3d A, vec3d B, vec3d C, vec3d D, vec3d E, double & u, double & w, double & t) int
openvsp.vsp.tri_tri_min_dist(vec3d v0, vec3d v1, vec3d v2, vec3d v3, vec3d v4, vec3d v5) double
class openvsp.vsp.vec3d(*args)

Bases: object

vec3d is typically used to describe coordinate points and vectors in 3D space. All 3 elements in the vector are of type double.

as_vec2d_xy(vec3d self) vec2d
data(vec3d self) double *
get_pnt(vec3d self, double [3] pnt)
get_pnt(vec3d self, float [3] pnt) None
get_pnt(vec3d self, threed_point_type & pnt) None
isfinite(vec3d self) bool
isinf(vec3d self) bool
isnan(vec3d self) bool
mag()

Get the magnitude of a vec3d

import math
#==== Test Vec3d ====//
vec3d a()                                # Default Constructor

#==== Test Mag ====//
a.set_xyz( 1.0, 2.0, 3.0 )

if  abs( a.mag() - math.sqrt( 14 ) ) > 1e-6 : Print( "---> Error: Vec3d Mag " ); }
Return type:

float

Returns:

Magnitude

major_comp(vec3d self) int
minor_comp(vec3d self) int
normalize()

Normalize the vec3d

    #==== Test Vec3d ====//
vec3d a(), b(), c()                                # Default Constructor

#==== Test Cross ====//
a.set_xyz( 4.0, 0.0, 0.0 )
b.set_xyz( 0.0, 3.0, 0.0 )

c = cross( a, b )

c.normalize()
offset_i(vec3d self, double offset, int idir)
offset_x(offset)

Offset the X coordinate of the vec3d

    #==== Test Vec3d ====//
vec3d a()                                # Default Constructor

#===== Test Offset ====//
a.set_xyz( 2.0, 2.0, 2.0 )

a.offset_x( 10.0 )
Parameters:

[in] – offset Offset for the X value

offset_y(offset)

Offset the Y coordinate of the vec3d

    #==== Test Vec3d ====//
vec3d a()                                # Default Constructor

#===== Test Offset ====//
a.set_xyz( 2.0, 2.0, 2.0 )

a.offset_y( 10.0 )
Parameters:

[in] – offset Offset for the Y value

offset_z(offset)

Offset the Z coordinate of the vec3d

    #==== Test Vec3d ====//
vec3d a()                                # Default Constructor

#===== Test Offset ====//
a.set_xyz( 2.0, 2.0, 2.0 )

a.offset_z( 10.0 )
Parameters:

[in] – offset Offset for the Z value

reflect_xy()

Reflect the vec3d across the XY plane

    #==== Test Vec3d ====//
vec3d a(), b()                                # Default Constructor

#===== Test Reflect ====//
a.set_xyz( 1.0, 2.0, 3.0 )

b = a.reflect_xy()
Return type:

vec3d

Returns:

Reflected vec3d

reflect_xz()

Reflect the vec3d across the XZ plane

    #==== Test Vec3d ====//
vec3d a(), b()                                # Default Constructor

#===== Test Reflect ====//
a.set_xyz( 1.0, 2.0, 3.0 )

b = a.reflect_xz()
Return type:

vec3d

Returns:

Reflected vec3d

reflect_yz()

Reflect the vec3d across the YZ plane

    #==== Test Vec3d ====//
vec3d a(), b()                                # Default Constructor

#===== Test Reflect ====//
a.set_xyz( 1.0, 2.0, 3.0 )

b = a.reflect_yz()
Return type:

vec3d

Returns:

Reflected vec3d

rotate_x(cos_alpha, sin_alpha)

Rotate the vec3d about the X axis. = cos alpha * x + sin alpha * z = -sin alpha * old_y + cos alpha * z

import math
#==== Test Vec3d ====//
vec3d a()                                # Default Constructor
PI = 3.14

a.set_xyz( 1.0, 0.0, 0.0 )

a.rotate_x( math.cos( 0.5 * PI ), math.sin( 0.5 * PI ) )
Parameters:
  • [in] – cos_alpha Cosine of rotation angle

  • [in] – sin_alpha Sine of rotation angle

rotate_y(cos_alpha, sin_alpha)

Rotate the vec3d about the Y axis. = cos alpha * x - sin alpha * z = sin alpha * old_x + cos alpha * z

import math
#==== Test Vec3d ====//
vec3d a()                                # Default Constructor
PI = 3.14

a.set_xyz( 1.0, 0.0, 0.0 )

a.rotate_y( math.cos( 0.5 * PI ), math.sin( 0.5 * PI ) )
Parameters:
  • [in] – cos_alpha Cosine of rotation angle

  • [in] – sin_alpha Sine of rotation angle

rotate_z(cos_alpha, sin_alpha)

Rotate the vec3d about the Z axis. = cos alpha * x + sin alpha * y = -sin alpha * old_x + cos alpha * y

import math
#==== Test Vec3d ====//
vec3d a()                                # Default Constructor
PI = 3.14

a.set_xyz( 1.0, 0.0, 0.0 )

a.rotate_z( math.cos( 0.5 * PI ), math.sin( 0.5 * PI ) )
Parameters:
  • [in] – cos_alpha Cosine of rotation angle

  • [in] – sin_alpha Sine of rotation angle

rotate_z_zero_x(cos_alpha, sin_alpha)

Rotate the vec3d about the Z axis assuming zero X coordinate value :param [in]: cos_alpha Cosine of rotation angle :param [in]: sin_alpha Sine of rotation angle

rotate_z_zero_y(cos_alpha, sin_alpha)

Rotate the vec3d about the Z axis assuming zero Y coordinate value :param [in]: cos_alpha Cosine of rotation angle :param [in]: sin_alpha Sine of rotation angle

scale_x(scale)

Scale the X coordinate of the vec3d

    #==== Test Vec3d ====//
vec3d a()                                # Default Constructor

#===== Test Scale ====//
a.set_xyz( 2.0, 2.0, 2.0 )

a.scale_x( 2.0 )
Parameters:

[in] – scale Scaling factor for the X value

scale_y(scale)

Scale the Y coordinate of the vec3d

    #==== Test Vec3d ====//
vec3d a()                                # Default Constructor

#===== Test Scale ====//
a.set_xyz( 2.0, 2.0, 2.0 )

a.scale_y( 2.0 )
Parameters:

[in] – scale Scaling factor for the Y value

scale_z(scale)

Scale the Z coordinate of the vec3d

    #==== Test Vec3d ====//
vec3d a()                                # Default Constructor

#===== Test Scale ====//
a.set_xyz( 2.0, 2.0, 2.0 )

a.scale_z( 2.0 )
Parameters:

[in] – scale Scaling factor for the Z value

set_arr(vec3d self, double const [] a) vec3d
set_arr(vec3d self, float const [] a) vec3d
set_refx(vec3d self, vec3d a) vec3d
set_refy(vec3d self, vec3d a) vec3d
set_refz(vec3d self, vec3d a) vec3d
set_vec(vec3d self, DoubleVector a) vec3d
set_x(xx)

Set the X coordinate (index 0) of the vec3d

    #==== Test Vec3d ====//
vec3d a()                                # Default Constructor

a.set_x( 2.0 )
Parameters:

[in] – x New X value

Return type:

vec3d

Returns:

Updated vec3d

set_xyz(xx, yy, zz)

Set all three elements of the vec3d vector

    #==== Test Vec3d ====//
vec3d a()                                # Default Constructor

a.set_xyz( 2.0, 4.0, 6.0 )
Parameters:
  • [in] – x New X value

  • [in] – y New Y value

  • [in] – z New Z value

Return type:

vec3d

Returns:

Updated vec3d

set_y(yy)

Set the Y coordinate (index 1) of the vec3d

    #==== Test Vec3d ====//
vec3d a()                                # Default Constructor

a.set_y( 4.0 )
Parameters:

[in] – y New Y value

Return type:

vec3d

Returns:

Updated vec3d

set_z(zz)

Set the z coordinate (index 2) of the vec3d

    #==== Test Vec3d ====//
vec3d a()                                # Default Constructor

a.set_z( 6.0 )
Parameters:

[in] – z in double new z value

Return type:

vec3d

Returns:

vec3d result

swap_xy(vec3d self) vec3d
swap_xz(vec3d self) vec3d
swap_yz(vec3d self) vec3d
property thisown

The membership flag

property v

v : a(3).double

x()

Get the X coordinate (index 0) of the vec3d

    vec3d a()                                # Default Constructor

a.set_xyz( 2.0, 4.0, 6.0 )

Print( "a.x() = ", False )
Print( a.x() )

Print( "a[0]= ", False )
Print( a[0] )
Return type:

float

Returns:

X value

y()

Get the Y coordinate (index 1) of the vec3d

    vec3d a()                                # Default Constructor

a.set_xyz( 2.0, 4.0, 6.0 )

Print( "a.y() = ", False )
Print( a.y() )

Print( "a[1]= ", False )
Print( a[1] )
Return type:

float

Returns:

Y value

z()

Get the Z coordinate (index 2) of the vec3d

    vec3d a()                                # Default Constructor

a.set_xyz( 2.0, 4.0, 6.0 )

Print( "a.z() = ", False )
Print( a.z() )

Print( "a[2]= ", False )
Print( a[2] )
Return type:

float

Returns:

Z value