Hi,
I am trying to do a case study to see how mech enhancement can modify the results. I am writing a python script to generate designs and scenarios, but I have trouble in finding which is the property of the Scenario for layer gradation when it is not automatic.
I have found the Number of layers, layer factor, and also automaticLayerAdaptation which is a string On Off but if I have a layer gradatio of 1.2 what is the property which should I set?
Thanks for help
Solved! Go to Solution.
Solved by Royce_adsk. Go to Solution.
I don't believe that settings was available yet in the API.
You could use this flag: mesh_enhance_gradation
To set flags with the API refer to the code below:
def SetFlags(flagsList = None): # "" # flagsList = {flagName:Value,flagName2:Value} # "" if flagsList == None: CFD.DSE.UI.ShowMessage("Error: Needs Flags when using SetFlags") else: tempDir = tempfile.gettempdir() fileName = tempDir +"\\qtScript.script" try: f = open(fileName, "w") try: f.write("study = new DesignStudy;\n") f.write("scenario = study.activeScenario();\n") for flag in flagsList: f.write("scenario.addFlag(\"" + flag + "\"," + str(flagsList[flag]) + ", 0);\n") except: CFD.DSE.UI.ShowMessage("Error: Writing to: " + fileName) finally: f.close() except IOError: CFD.DSE.UI.ShowMessage("Error: Creating file: " + fileName) pass DSE.UI.ExecuteQtScript(fileName)
Thanks,
But I have observed that the flag mesh_enhance_gradation has the same value as enhancementStretching property of Scenario could be the same?
Some quick questions about the mesh_enhance falgs:
mesh_enhance_thick I think it should be Layer Factor from Enhancement but the flag has values of 100 and in the layer factor I have values of 0.45 till 1.2
When these flags are applyed on the study, because I have manually modified the mesh_enhance_gradation and if I open the Boundary Mesh Engancement dialog box nothing is changed.
I presume that a value of 1 in mesh_enhance_gradation should account for the Auto value of Layer Gradation in the dialog box.
Thanks for help.
That flag doesn't change the UI, it just overrides the setting in the UI at the mesher executable level.