Meanwhile MSC confirmed it's not working and they've created the product defect ADMS-43687 Error on loading Adams module in Python shell on RH6 .
But instead of admitting it was a bug the official MSC answer was: "Is not supported in Adams as of now. This could be supported an future version of Adams."
Well it was working in former versions, so why could anyone have the crazy thought it automatically would be required in future versions ? (<- please note the slight trace of irony in this statement)
the 'Adams' module is *new* in v2017 and it is built upon Adams/View libraries and functionality. Because of this it only runs within Adams/View. You can't import import it on the command line in a 'standalone' shell and you never have been able to.
Perhaps Martin's comments relate to the old 'ADAMS' module that you could import from anywhere. Note the spelling. It's possible that that didn't have View dependencies and could be imported, but it's not the same thing as the new 'Adams' module that you want to be using.
Regardless of the (blurred) details here: yes: we really want to be able to "import Adams" from both the 'View Python' shell AND the 'standalone Python' shell. But the first iteration of this new module is limited to running only in View (Car, etc.) now. That was a design decision that we had to make. It is not the long-term plan for this, so please excuse the trouble in the meantime and stick to the 'View Python' shell.
One more thing: a future vision that makes a lot of sense is to have a 'View Python' shell that can be directly embedded within an IDE such as PyCharm. That would be the perfect solution, in my opinion. Suggestions for improvement as you use it are appreciated.
In the past I was using mdi -c python to test stuff locally.
As I didn't recall having errors, I assumed import aview_main should have worked somehow.
But as I tested it with 2014.0.1 and 2015.1.2, I found Kent is right: It's not working to simply enter "import aview_main".
Seems I had something like this in the code I tested at that time:
if __name__ != '__main__':
import aview_main
else:
class aview_main:
def evaluate_exp(exp): print exp; return exp
def execute_cmd (cmd): print cmd
evaluate_exp = staticmethod(evaluate_exp)
execute_cmd = staticmethod(execute_cmd)
Anyway: There are cases where we'd want to run it that way.
So what about starting the AMD in background without a GUI to make "import Adams" work ?
In the old C-SDK you did quite exactly the same (i.e. C program could be started standalone and inside the code you could build an ADAMS model and run it)
Yah: very much agreed with all that you've said here. You'd think that this would be possible.. Our PD group has heard this request loud & clear; I'm hopeful that we can get it working in a release soon..