Skip to content

How to run macro in PyMAPDL (like *use command in MAPDL)? #1877

Answered by mikerife
vnamdeo asked this question in Q&A
Discussion options

You must be logged in to vote

PyMAPDL has a version of the *USE APDL command but the * character is dropped. So this will work if the macro is in the MAPDL working directory:

mapdl.use("gmclife.mac,1,0")

Or the *USE command can be issued non-interactively via the PyMAPDL 'run' command:

with mapdl.non_interactive:
    mapdl.run("*use,gcmlife.mac,1,0")
mapdl.last_response

Or the macro just issued as if it were a command:

with mapdl.non_interactive:
    mapdl.run("gcmlife.mac,1,0")
mapdl.last_response

Note that the mac extension is needed in either method. Mike

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

vnamdeo
Mar 2, 2023
Collaborator Author

You must be logged in to vote
1 reply
@germa89
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by germa89
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants