473,382 Members | 1,651 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

I want to make python script in abaqus 6.10

Hi all.

I try to make the python script with the macro.

As you know, the funtion of macro manager can record the every acticvity in python script. But this script work on the macro manager only. I want to make this script work on the run script menu.

The error message was done when I try to run the macro script.

Message says "C:/Temp/abaqusMacros.py:56: SyntaxWarning: import * only allowed at module level
def analzer2():
C:/Temp/abaqusMacros.py:56: SyntaxWarning: import * only allowed at module level
def analzer2():"
Following codes are the macro script what I try to transfer.
Plz help me.
Expand|Select|Wrap|Line Numbers
  1. # Do not delete the following import lines
  2. from abaqus import *
  3. from abaqusConstants import *
  4. import __main__
  5.  
  6. def analyzer():
  7.     import section
  8.     import regionToolset
  9.     import displayGroupMdbToolset as dgm
  10.     import part
  11.     import material
  12.     import assembly
  13.     import step
  14.     import interaction
  15.     import load
  16.     import mesh
  17.     import job
  18.     import sketch
  19.     import visualization
  20.     import xyPlot
  21.     import displayGroupOdbToolset as dgo
  22.     import connectorBehavior
  23.     o1 = session.openOdb(name='C:/Temp/1.odb')
  24.     session.viewports['Viewport: 1'].setValues(displayedObject=o1)
  25.     import sys
  26.     sys.path.insert(11, r'C:\SIMULIA\Abaqus\6.10-1\abaqus_plugins\reportGenerator')
  27.     from abaqus import *
  28.     from abaqusConstants import *
  29.     import form
  30.     import reportGenerator
  31.     report=reportGenerator.ReportGenerator()
  32.     report.setValues('C:/Temp/1.odb', interactionAdditionalFigure=r"(, , )", 
  33.         logo=r"*.gif", styleSheet=r"*.css", includeXYData=1, 
  34.         outputVariableList=r"(, , , , )", outputVariableView=r"(, , , , )", 
  35.         resultsXYData=r"(, , , , )", resultsAdditionalFigure=r"(, , , , )", 
  36.         userName=r"", includeUsername=1, includeTOC=1, includeLoadData=1, 
  37.         includeResultsData=1, includeStepData=1, imageStyle=r"INLINE", 
  38.         includeInteractionData=1, includePartData=1, includeJobData=1, 
  39.         includeAssemblyData=1, includeMaterialData=1, outputDir=r"C:\Temp", 
  40.         reportTitle=r"Report Generated by 'Abaqus Report Generator'", 
  41.         instanceFigureTop=1, instanceFigureBottom=0, instanceFigureUser2=0, 
  42.         instanceFigureUser1=0, instanceFigureUser3=0, instanceFigureFront=1, 
  43.         instanceThreeDXML=1, imageTogether=r"TOGETHER", instanceFigureIso=1, 
  44.         instanceFigureLeft=0, instanceFigureRight=0, 
  45.         instanceList=r"(ALL, , , , )", instanceFigureUser4=0, 
  46.         includeInstanceTable=1, instanceAdditionalFigure=r"(, , , , )", 
  47.         materialFigureBottom=0, materialFigureFront=1, materialFigureUser1=0, 
  48.         materialFigureUser3=0, materialFigureUser2=0, materialFigureRight=0, 
  49.         materialFigureTop=1, materialFigureUser4=0, materialFigureIso=1, 
  50.         includeMaterialDetails=1, materialThreeDXML=1, 
  51.         materialAdditionalFigure=r"(, , )", includeMaterialTable=1, 
  52.         materialFigureLeft=0, loadAdditionalFigure=r"(, , )", )
  53.     report.processRequest()
Feb 20 '12 #1
1 5306
bvdet
2,851 Expert Mod 2GB
As the error message indicates, "import *" is only allowed at the module level (outside of the function scope). Better yet, put all your imports at the top of the file just after module comments and doc strings. See Python PEP 8.
Feb 20 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Andrew Chalk | last post by:
Is this possible? In my CGI app. I display a web page with a link (anchor). When the link is clicked I want to exectute a python script rather than go to an HTML page. Many thanks.
2
by: Giraud, Sebastien | last post by:
Ok I was still looking for a 'make like' software and found one : MacMillan Entreprise Just work fine even if it's not easy to handle it... -----Message d'origine----- De :...
7
by: Arun | last post by:
Hi, This is a scripting question, but since I am writing the script in python I am posting this question here: I have a python script that runs a simulator (that was written in c++, so I use...
7
by: Lowell Kirsh | last post by:
I have a script which I use to find all duplicates of files within a given directory and all its subdirectories. It seems like it's longer than it needs to be but I can't figure out how to shorten...
8
by: Harlin Seritt | last post by:
I have a remote linux server where I can only access it via ssh. I have a script that I need to have run all the time. I run like so: python script.py & It runs fine. When I log off ssh I...
3
by: olaufr | last post by:
Hi, I need to call a python script, with command line arguments (it is an autonomous script with a __main__), from within another python script. Can I use exec() or execfile() for this? How to...
7
by: hlubenow | last post by:
Hi, recently there was a thread about hiding the python-script from the user. The OP could use http://freshmeat.net/projects/pyobfuscate/ H.
1
by: michael.buonomo | last post by:
We have been using the Google recommended python script for about a year. We recently realized that the script was not crawling our sites url's, but just our folders which reside on the server. The...
2
by: Jorgen Bodde | last post by:
Hi all, This is slightly OT but it drives me nuts. Whenever I create a shortcut in the start menu (in Windows) of a python script, it will only execute it when the path where the script resides...
14
by: asdf | last post by:
I have a python script whose output i want to dynamically display on a webpage which will be hosted using Apache. How do I do that? thanks
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.