CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ANSYS (https://www.cfd-online.com/Forums/ansys/)
-   -   [Ansys Mechanical] Setting force using JavaScript (https://www.cfd-online.com/Forums/ansys/213453-ansys-mechanical-setting-force-using-javascript.html)

siewca112 December 27, 2018 14:08

[Ansys Mechanical] Setting force using JavaScript
 
Hello everyone,
I'm currently working on macro for Ansys Mechanical for my coupled analysis (static structural-dynamic explicit) using the JavaScript method and I have encountered problem.
Excactly I can creat macro which is setting all my mesh settings, boundry conditions and results without any problem but only for single analysis (static structural). My problem is when I try to run my macro on coupled analysis I completety don't know what function should I use to set different forces for static structural and different for explicit dynamic.
I will show what kind of function I'm using to set force in Z direction with value of 500.

var Env = DS.Tree.FirstActiveBranch.Environment;
DS.Script.SelectItems(""+Env.ID);

DS.Script.doInsertEnvironmentForce("structural")
ListView.ActivateItem("Scoping Method");
ListView.ItemValue = "Named Selection" ;
ListView.ActivateItem("Named Selection");
ListView.ItemValue = "sciana" ;
ListView.ActivateItem("Define By");
ListView.ItemValue = "Components" ;
ListView.ActivateItem("X Component");
ListView.ItemValue = "0"
ListView.SelectedItem.IsChecked="false"
ListView.ActivateItem("Y Component");
ListView.ItemValue = "0"
ListView.SelectedItem.IsChecked="false"
ListView.ActivateItem("Z Component");
ListView.ItemValue = "500"
ListView.SelectedItem.IsChecked="false"

Like you see there is no definition on what kind of simulation this force should be set so Ansys is setting it in the first which is "static structural". And in addition for example I would like to set the froce of the value of 700 on the "explicit dynamic". Is there anybody who could help me with my problem?


All times are GMT -4. The time now is 09:58.