×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

python scripting

python scripting

python scripting

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

RE: python scripting

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

RE: python scripting

Hello Alan

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

RE: python scripting

(OP)
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

RE: python scripting

Convert your *.py file in *.psf, these two extension files accept python language.

RE: python scripting

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

RE: python scripting

the command is >>abq651 cae startup=name.py
this should work

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources