Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Writing Marcos 2

Status
Not open for further replies.

staryash

Bioengineer
Jun 15, 2006
8
I have marco recording as attached, and I would like to improve the style, so that I can write the macros without running one and editing them.

Regards

 
Replies continue below

Recommended for you

Please let me know which part is gonna be dynamic?
 
I do not understand your question, it is not a dynamic simulation.
I do not know how to break the macro into separate lines without causing any problems.
 
Staryash,

You can run a macro using execfile('marcofile.py') as well as "File>Run script" menu. I though you wanna make the script more changeable (dynamic). In the case, you could use x=getInput('x=','default value for x').

Regards,
 
HI Msha

I created this macro by recording the procedure in ABAQUS, and when I want to use it I have to edit the filenames.
And, all the commands are in one straight line.

I want to know, where the appropriate breaks are, or a suitable (free) editor of the macro. So for example..


123 4567 890 1234567890 ...

can be written as

123 4567

890

1234567890...

as appropriate for ABAQUS.

I can run the script, by using macro manager.

Regards
 
I use notepad++ as my py editor, and it has all the entries on separate lines already. I forget which, either notepad or wordpad, but one of them has a problem reading carriage returns and line breaks for me, replacing them with little rectangles. Try Notepad++. It rocks.
 
Staryash,

Abaqus 6.7 and later has a Python editor and debugger as well. you can find it in "File>ABAQUS PDE" menu.
Notepad++ is a free editor.
I myself use PyScripter. It is free and very powerful for professional scripting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor