Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Workbench macro

Status
Not open for further replies.

rstupplebeen

Mechanical
May 9, 2007
1,281
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
 
Replies continue below

Recommended for you

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
 
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.
 
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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor