|
[Sponsors] |
June 9, 2020, 08:17 |
edit xml code by ANSYS WB
|
#1 |
New Member
mirkolaw
Join Date: Nov 2019
Posts: 3
Rep Power: 7 |
I would like to ask if you could edit this XML code.
because I cannot enter each DesignPoint on my own. If there is something like this with other CODE, Range[a:b:c] Thanks a lot Code:
# encoding: utf-8 # Release 19.2 SetScriptVersion(Version="19.2.120") template1 = GetTemplate( TemplateName="Steady-State Thermal", Solver="ANSYS") system1 = template1.CreateSystem() geometry1 = system1.GetContainer(ComponentName="Geometry") geometry1.Edit() Save( FilePath="C:/Users/xxx/Desktop/station/stationaere.wbpj", Overwrite=True) geometry1.Exit() modelComponent1 = system1.GetComponent(Name="Model") modelComponent1.Refresh() model1 = system1.GetContainer(ComponentName="Model") model1.Edit() designPoint1 = Parameters.GetDesignPoint(Name="0") parameter1 = Parameters.GetParameter(Name="P4") designPoint1.SetParameterExpression( Parameter=parameter1, Expression="3*P2") designPoint2 = Parameters.CreateDesignPoint() parameter2 = Parameters.GetParameter(Name="P1") designPoint2.SetParameterExpression( Parameter=parameter2, Expression="10 [mm]") parameter3 = Parameters.GetParameter(Name="P3") designPoint2.SetParameterExpression( Parameter=parameter3, Expression="48 [mm]") designPoint3 = Parameters.CreateDesignPoint() designPoint3.SetParameterExpression( Parameter=parameter3, Expression="46 [mm]") designPoint4 = Parameters.CreateDesignPoint() parameter4 = Parameters.GetParameter(Name="P2") designPoint4.SetParameterExpression( Parameter=parameter4, Expression="15 [mm]") |
|
June 11, 2020, 06:06 |
XML is not a programming language
|
#2 |
New Member
mirkolaw
Join Date: Nov 2019
Posts: 3
Rep Power: 7 |
I just found out that XML is not a programming language, but only a text.
[https://www.padtinc.com/blog/ansys-m...-howto-part-1/ ] But with python it is possible to write a Scripting for this. |
|
July 1, 2020, 07:33 |
|
#3 |
Senior Member
Gwenael H.
Join Date: Mar 2011
Location: Switzerland
Posts: 392
Rep Power: 20 |
Hi Mirkolaw,
What you are referencing to is a Workbench Journal file (.wbjn). You can use Python for instance to generate the .wbjn file and change the parameters as you want to fit your needs. Then you can launch workbench in batch mode passing the .wbjn as argument and solve the different design points. Have fun |
|
July 1, 2020, 08:10 |
|
#4 | |
New Member
mirkolaw
Join Date: Nov 2019
Posts: 3
Rep Power: 7 |
Quote:
that's really a very helpful idea. I'll try it |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to run multiple cycle pulsetile flow simulation in Ansys fluent using UDF code? | Md Al Amin Sheikh | Fluent UDF and Scheme Programming | 4 | January 28, 2020 12:55 |
ANSYS not responding when I edit Engineering Data | sacrover | ANSYS | 10 | July 26, 2018 18:23 |
The ansys cfx solver exited with return code -1 | michellemay1993 | CFX | 1 | September 27, 2016 03:44 |
Fotran code in Ansys CFX | Abhishek Chitvar | CFX | 0 | December 20, 2008 12:19 |
Reading ANSYS mesh into my own code | Soheyl | CFX | 1 | June 18, 2007 19:51 |