Hi @h.schlichter!
Working with the API can be tricky at times. I pulled the example code around the wall results. Do you understand the variables available now with the wall results? As a hint in the future. Most of the naming convention in the UI is the same in the API.
Here is some example code.
1 from CFD import Setup
2 from CFD import Results
3 from CFD import DSE
4
5 def WallResults():
6 # Get current scenario & activate results
7 study = Setup.DesignStudy.Create()
8 scenario = study.getActiveScenario()
9 curr_results = scenario.results()
10 if curr_results is None:
11 DSE.UI.ShowMessage( "There are no results !" )
12 return
13 curr_results.activate()
14
15 # Create a WallResults object
16 wr = Results.WallResults(scenario)
17
18 # Set the id of surface of interest & ask it to calculate
19 wr.select(15)
20 wr.select(9)
21 wr.calculate()
22
23 # Get the results
24 area = wr.area(15)
25 pressure = wr.pressure(15)
26 temp = wr.temperature(15)
27 fx, fy, fz = 0.0, 0.0, 0.0 # force is a little complicated because it is 3 values
28 err, fx, fy, fz = wr.force(fx, fy, fz)
29
30 print("Area = ", area)
31 print("Press = ", pressure)
32 print("Temp = ", temp)
33 print("FX = ", fx)
34 print("FY = ", fy)
35 print("FZ = ", fz)
36
37 DSE.UI.ShowMessage( "Area = " + str(area) )
38 DSE.UI.ShowMessage( "Press = " + str(pressure) )
39 DSE.UI.ShowMessage( "Temp = " + str(temp) )
40 DSE.UI.ShowMessage( "FX = " + str(fx) )
41 DSE.UI.ShowMessage( "FY = " + str(fy) )
42 DSE.UI.ShowMessage( "FZ = " + str(fz) )
43
44
45 # Or you can write all wall results to a file
46 wr.writeToFile("C:/wr.csv")
47 print("Wall results are witten to c:/wr.csv")
48 DSE.UI.ShowMessage( "Wall results are witten to c:/wr.csv" )
49
50 WallResults()
You also made a comment about how to find everything for a object? I wrote this for myself years ago to do just that. Any questions on this piece of code? You can play around with the code a bit to pull out different types of objects.
import CFD
import sys
import time
import win32com.client as win32
import math
import os
import shlex
from CFD import Setup
from CFD import Results
from CFD import DSE
from CFD import DC
userName = os.environ.get( "USERNAME" )
sys.path.append("C:/Users/" + userName + "/Dropbox/CFdesign/Python Scripts/")
def listProperties():
study = Setup.DesignStudy.Create()
scenario = study.getActiveScenario()
CFD.DSE.UI.ShowMessage(str(scenario.numProperties()))
defList = Setup.PropertyDefinitionList()
varList = Setup.VariantList()
scenario.properties(defList,varList)
CFD.DSE.UI.ShowMessage(" ")
for a in defList:
CFD.DSE.UI.ShowMessage(str(a.name()))
CFD.DSE.UI.ShowMessage(scenario.property("path"))
listProperties()

Royce.Abel
Technical Support Manager