|
[Sponsors] |
October 2, 2018, 12:24 |
Ansys Workbench-Meshing scripting
|
#1 | |
New Member
Nathan
Join Date: Oct 2018
Posts: 2
Rep Power: 0 |
Hi everyone,
First, thanks for all of the great answers to previous questions that people have provided in the forum, they have been helpful in navigating the scripting/automation process. I am trying to automate an entire project: 1. Geometry creation in SpaceClaim 2. Sizing and mesh generation in Meshing 3. Fluent setup, simulation, and post-processing I have a working solution for #1 and am figuring out the command list options for #3. I also have a working solution for Meshing (#2), well two of them actually, but am unable to figure out how to call either from a Workbench journal file. The one I'd prefer to use at this point is a working jscript macro for Meshing and I would like to call from a workbench journal. Simple version of Meshing Macro (works if called by running Macro in Meshing): Code:
Main(); function Main() { var Mesh_Mod = DS.Tree.FirstActiveBranch.MeshControlGroup; DS.Script.SelectItems(""+Mesh_Mod.ID); //Insert the face sizing for the object DS.Script.doInsertMeshSize(1) ListView.ActivateItem("Scoping Method"); ListView.ItemValue = "Named Selection" ; ListView.ActivateItem("Named Selection"); ListView.ItemValue = "ObjSurface" ; ListView.ActivateItem("Type"); ListView.ItemValue = "Element Size"; ListView.ActivateItem("Element Size"); ListView.ItemValue = "0.01"; ListView.ActivateItem("Behavior"); ListView.ItemValue = "Hard"; } Code:
meshComponent1 = system1.GetComponent(Name="Mesh") meshComponent1.Refresh() meshing1 = system1.GetContainer(ComponentName="Mesh") meshing1.Edit() meshScript = open('C:\...blahblahpath...\Meshing_ScriptTest.js', 'r') meshing1.SendCommand(Command=meshScript.read()) #this is line 20 meshing1.Exit() meshComponent1.Refresh() Quote:
|
||
October 2, 2018, 13:34 |
|
#2 | |
New Member
Nathan
Join Date: Oct 2018
Posts: 2
Rep Power: 0 |
I figured it out and thought I'd leave it here in case anyone else has the same problem.
Instead of the open and SendCommand lines from above, I used this: Quote:
|
||
March 22, 2023, 09:47 |
|
#3 |
Senior Member
Join Date: Feb 2020
Posts: 114
Rep Power: 6 |
Hi, I would like to ask a question about scdm scripting. I want to filter out all the faces such as in the z = 5 plane, but I do not know how to implement this process.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ansys workbench meshing | sanjaykummar2810 | CFD Freelancers | 6 | August 15, 2018 01:47 |
Ansys workbench scripting | sunilpatil | CFX | 7 | January 31, 2018 07:57 |
[ANSYS Meshing] Migrating from GAMBIT to ANSYS Meshing | David-CFD | ANSYS Meshing & Geometry | 1 | April 1, 2011 06:22 |
Meshing In Ansys Workbench For Fluent (Refinement) | FAU_OceanEng | FLUENT | 0 | May 31, 2010 18:12 |