I'm not very familiar with this, but I think you might need to somehow create a OpenVSP file to be working with, or to open one that already exists. I found it easier to create a design in the GUI that was roughly along the lines of what I wanted and then to use the Python API to identify and modify the parms as required. The below code works for me if it doesn't for you (if you create a file with a simple wing, body and tail in it and point it at the right path, also run an analysis with VSPAERO through the GUI just to make sure it solves) then maybe it's an installation issue with VSPAERO. I'm not completely clear on how this API is actually working, but all the degen geom files etc all get dumped in the folder that the original file that's read in is based, so I think it's important that you have that original file.
path = '/home/timbo/AMRC/MACH_UAV/analysis/APItest/'
fname = 'apitest.vsp3'
vsp.VSPRenew()
errorMgr.PopErrorAndPrint(stdout)
vsp.ReadVSPFile((path+fname))
geoms = vsp.FindGeoms()
print("All geoms in Vehicle.")
print(geoms)
def analyseVLM(AoAStart, AoAEnd,AlphaNpts):
analysis_name = "VSPAEROComputeGeometry"
vsp.SetAnalysisInputDefaults(analysis_name)
analysis_method = list(vsp.GetIntAnalysisInput(analysis_name, "AnalysisMethod" ))
analysis_method[0] = vsp.VORTEX_LATTICE
vsp.SetIntAnalysisInput(analysis_name, "AnalysisMethod", analysis_method)
res_id = vsp.ExecAnalysis( analysis_name )
analysis_name = "VSPAEROSweep"
vsp.SetAnalysisInputDefaults(analysis_name)
vsp.SetDoubleAnalysisInput(analysis_name, "AlphaStart", (AoAStart,), 0)
vsp.SetDoubleAnalysisInput(analysis_name, "AlphaEnd", (AoAEnd,), 0)
vsp.SetIntAnalysisInput(analysis_name, "AlphaNpts", (AlphaNpts,), 0)
vsp.Update()
vsp.DeleteAllResults()
res_id = vsp.ExecAnalysis(analysis_name)
return res_id