×
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

Workbench macro

Workbench macro

Workbench macro

(OP)
Does anyone know of a good reference for writing a macro for Workbench?  I have not found anything useful in the help or with google.  

My specific problem is that I want a script to open Workbench, update the geometry from a CAD file, run the simulation, and export a couple of values and pictures.  

Any help would be greatly appreciated.  Thank you.
Rob Stupplebeen

RE: Workbench macro

I don't know how to do it with WB, but my advice is: use Ansys Classical with APDL for automated high end simulations!

Regards
Alex

RE: Workbench macro

It sounds like you want to write some sort of MS-DOS batch script.  Workbench isn't exactly the best or easiest tool do do what you're looking to do with from my experience.  Regular Ansys as Alex suggested would be a better tool.  Certainly there is a way I just don't know how to pass information to WB from DOS.  Certainly what you're looking to do is doable though.  The only part is the pictures.  You will need the user interface open to do this so there's no way to run this completely behind the scenes.

RE: Workbench macro

(OP)
Thanks mihaiupb and stringmaker.  I am new to Ansys but not FEA and am trying to use Workbench instead of Classic.  I do not want to start a flame war so I will leave it as Classic does not seem very user friendly.  

I do not mind if the GUI is open for the pictures.  I am going to be running on a dedicated machine.  That could also be a post operation going through all of the results files.  If anybody has tried to use Workbench this way any help would be greatly appreciated.

Assuming that there is little experience using Workbench this way how difficult would it be to get Classic to perform this?  I can get SolidWorks to automatically export a parasolid file.  If classic imports this file assuming no fundamental geometry changes (square to a rectangle is ok, but square to a triangle is not ok) will surface 1 always be the same surface number in Classic?

Thank you very much for all the help.

Robert Stupplebeen  

RE: Workbench macro

Hi,
1- geometry: in Classic, the geometry is completely "dumb". Should you modify any dimension or worse any part of the topology, you would have to start all over
2- in Classic, you can write all your BC attribution in a script file and then read it in after model change, but that's assuming that there is no change in the faces' IDs (well, you could even program an APDL to get rid of this "limitation", but it gets involved...)
3- on the other side, Workbench will take care of the previous point by itself, but unless you run Unigraphics you will always have to do "update geometry" in order for your model to update accordingly to the CAD model (with UG NX4, the parameters of the CAD model are imported, so that you can control the model directly from within Workbench; I don't think this is also valid with the Solidworks plugin); another thing: in order for this to work, you have to check the "reader saves the model after update" or however this is called
4- once a solution has run with Workbench, a ".rst" file is written, so the post-processing is not a problem: either you add a Commands snippet in the Solution item of the WB "tree", with the APDL commands to "batch-generate" the plots you need, either you skip any post-pro in the batch-run phase and you then open the ".rst" file(s) afterwards
5- the interactions between WB and the operating system (including the ability to be launched as a runtime from another application) are all in the Workbench's Development Kit, a thing that I've never explored so I can't be more specific. I only know that what you ask IS feasible. Ask your reseller this specific question, I believe he will help you positively
6- all I've written here refers to v.11
7- performing all this with Classic will have an advantage (batch-running is much easier) but also drawbacks (the problem of the model update, the problem of understanding how to use Classic); also consider that, with Classic, it's the first approach which is very difficult, but then it's not so hard to use unless you want to perform very complicated analyses (but I don't believe it's your case otherwise you wouldn't use Workbench).

Regards

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