Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

python scripting

Status
Not open for further replies.

alan14

Mechanical
Joined
Feb 26, 2006
Messages
13
Location
DE
hi all,

i am trying to start Abaqus with a python script directly from the command prompt using the command:

abaqus python name.py

where name is the python file name.

I am getting an import error:

C:\Abaqus\Commands>abaqus python shelf.py
Traceback (most recent call last):
File "shelf.py", line 1, in ?
from abaqus import *
File "Python/abaqus.py", line 12, in ?
ImportError: ababltin failed to import

it has to do with the import command(from abaqus import *). when i start abaqus cae and try to run the same script from cae everything works just fine.

please help.

thx in a advance.
 
hallo alan,
i'm not sure whether you can import the abaqus module without the session object. this could be the reason for the message.

cheers
 
Hello Alan

Indeed, it's impossible to import ABAQUS/CAE or ABAQUS/VIEWER.
To execute a script : abaqus script=shelf
 
i tried abaqus script=shelf

but this requires a *.psf file. while i have a python shelf.py file. how can i solve this?

thx
 
Convert your *.py file in *.psf, these two extension files accept python language.
 
I changed the extension to *.psf still getting errors.

C:\sctest>abaqus script=shelf.psf
Traceback (most recent call last):
File "Python/driver/script.py", line 86, in ?
File "Python/driver/application.py", line 119, in run
File "Python/driver/script.py", line 65, in execute
File "gear.psf", line 1, in ?
from abaqus import *
File "Python/abaqus.py", line 12, in ?
ImportError: ababltin failed to import

thanks for your patience.
 
the command is >>abq651 cae startup=name.py
this should work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top