OpenVSP Python Scripting

201 views
Skip to first unread message

Isaac Kocherla

unread,
Jun 24, 2020, 3:38:50 PM6/24/20
to OpenVSP
Hello
When I am combining NDARC solution to OpenVSP to generate a .vsp3 file using Alpine, I get this error 
Reading solution file...

Traceback (most recent call last):
  File "C:\Users\admin\AppData\Local\Temp\alpine_job1712764679325115039\run.py", line 3, in <module>
    test = alpineVehicle.vehicle('tiltwingTE.soln', 'AlpineGenerated', '')
  File "C:\ProgramData\Anaconda3\envs\aiden_env\lib\site-packages\alpine-2.0-py3.6.egg\alpine\Core\alpineVehicle.py", line 29, in __init__
    self.geom, self.weights = parseSolution.GeomParse(solnfile)
  File "C:\ProgramData\Anaconda3\envs\aiden_env\lib\site-packages\alpine-2.0-py3.6.egg\alpine\Core\parseSolution.py", line 102, in GeomParse
    geom['area_panel{}_w{}'.format(p+1,j+1)]= soln['WING'][j]['AREA_PANEL'][p]
  File "C:\ProgramData\Anaconda3\envs\aiden_env\lib\site-packages\rcotools-2.0.2-py3.6.egg\rcotools\utils\parser_support.py", line 533, in __getitem__
    raise IndexError(msg)
IndexError: Requested index is 0, indices less than 1 are not allowed.
Thanks,
Isaac Kocherla

Chris Silva

unread,
Jun 25, 2020, 9:14:02 AM6/25/20
to OpenVSP
The problem is that the latest version of RCOTOOLS (2.0.6) has changed from zero-based indexing of arrays (Python style) to 1-based indexing (Fortran and natural counting style). This was an attempt to make the indexing less confusing, but naturally has rippling consequences. Solution for now is to either go to an earlier version of RCOTOOLS, wait for a fix (planned for next week or two) or go in and edit the scripts in ALPINE for 1-based indexing (may be a lot of work for little gain).

Isaac Kocherla

unread,
Jun 26, 2020, 4:37:38 PM6/26/20
to OpenVSP
Hi, 
I have reinstalled RCTOOLS(2.0.0). I got a new error,
Reading solution file...

Traceback (most recent call last):
  File "C:\Users\admin\AppData\Local\Temp\alpine_job7879997342491394283\run.py", line 3, in <module>
    test = alpineVehicle.vehicle('Solution.soln', 'AlpineGenerated', '')
  File "C:\ProgramData\Anaconda3\envs\aiden_env\lib\site-packages\alpine-2.0-py3.6.egg\alpine\Core\alpineVehicle.py", line 55, in __init__
    self.vehicle['cfg'] = cfg
AttributeError: 'vehicle' object has no attribute 'vehicle'
Thanks,
Isaac Kocherla

Chris Silva

unread,
Jun 27, 2020, 2:02:57 PM6/27/20
to OpenVSP
Not sure how you ended up with your line 3 in run.py. There is no default vehicle configuration, so you should be specifying a configuration (e.g. 'helicopter', 'coaxial', 'tilt rotor', 'tandem'), and in any event, you should not be specifying an empty string for configuration.

Isaac Kocherla

unread,
Jun 29, 2020, 12:13:43 PM6/29/20
to OpenVSP
Hello Chris,
Thank you, that worked. I am able to generate the .vsp3 files
Thanks,
Isaac Kocherla

Samiul Hassan

unread,
Sep 4, 2021, 12:37:49 PM9/4/21
to OpenVSP
Hello. Hope everyone is doing well. 

I am facing the same error "Requested index is 0, indices less than 1 are not allowed" while trying to run to the "test.py" file provided with the Alpine file. And I am using RCOTOOL-2.1.3. 

Can anyone kindly help me out? 

Thanks. 

Reply all
Reply to author
Forward
0 new messages