<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CFD python API - cutPlane attributes in CFD Forum</title>
    <link>https://forums.autodesk.com/t5/cfd-forum/cfd-python-api-cutplane-attributes/m-p/13090360#M178</link>
    <description>&lt;P&gt;Okay so I finally got answers from Autodesk's dev team and apparently the CutPlaneAttributes class has not been implemented in the API, so there is nothing to get, set or work with. The plane extraction is thus impossible and this API is kinda useless if you hope to automate data extraction.&lt;/P&gt;&lt;P&gt;Good to know huh?&lt;/P&gt;</description>
    <pubDate>Thu, 17 Oct 2024 08:26:08 GMT</pubDate>
    <dc:creator>matthieu.griveletAH26V</dc:creator>
    <dc:date>2024-10-17T08:26:08Z</dc:date>
    <item>
      <title>CFD python API - cutPlane attributes</title>
      <link>https://forums.autodesk.com/t5/cfd-forum/cfd-python-api-cutplane-attributes/m-p/13071147#M177</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;I'm trying to automate cutplane extractions to workaround the lack of volume statistical results in CFD.&lt;/P&gt;&lt;P&gt;The issue is the default planes are shaded and have thus empty tables...&lt;/P&gt;&lt;P&gt;The html doc on the pyhton API lacks the attributes names and types, so I don't know how to setAttributes to shaded mesh.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my bit of code, with the line 19 comment being where I want to set the attribute, it's .txt instead of .py because we can't uplaod .py....&lt;/P&gt;&lt;P&gt;My code certainly can be optimised, but I'm just a regular engineer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Matthieu&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Plain text script here :&lt;/P&gt;&lt;P&gt;# An example to create a cutplane and then access its parameters&lt;/P&gt;&lt;P&gt;from CFD import Setup&lt;BR /&gt;from CFD import Results&lt;BR /&gt;from CFD import DSE&lt;/P&gt;&lt;P&gt;def CreateCutPlane(zed):&lt;/P&gt;&lt;P&gt;# Initialize all thats needed to create a cutplane&lt;BR /&gt;params = Results.CutPlaneParameters()&lt;BR /&gt;location = Setup.Vector(0, 0, zed)&lt;BR /&gt;normal = Setup.Vector(0, 0, 1)&lt;BR /&gt;params.scalarResType = Results.STATIC_TEMP&lt;/P&gt;&lt;P&gt;# Create cutplane with the above arguments&lt;BR /&gt;cp = Results.CutPlane.Create(results, "Cutplane"+str(zed), location, normal, params)&lt;BR /&gt;DSE.UI.ShowMessage("Cutplane " + str(zed) + " created!")&lt;/P&gt;&lt;P&gt;#I'd like to set a shaded mash for results export cp.setAttributes(SHADED_MESH)&lt;/P&gt;&lt;P&gt;cp.setGridSpacing(112)&lt;BR /&gt;return cp&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# This is how you get the handle to the Design Study (theres only one in a SimCFD session)&lt;BR /&gt;study = Setup.DesignStudy.Create()&lt;/P&gt;&lt;P&gt;# To do anything with results, we must first activate results. Below is how you do it&lt;BR /&gt;scenario = study.getActiveScenario() # get active scenario of the study&lt;BR /&gt;results = scenario.results() # get results from scenario&lt;BR /&gt;if results is None:&lt;BR /&gt;DSE.UI.ShowMessage( "There are no results !" )&lt;/P&gt;&lt;P&gt;results.activate() # activate the current results&lt;/P&gt;&lt;P&gt;# Call the above function&lt;/P&gt;&lt;P&gt;for x in range (20) :&lt;BR /&gt;height = 50*(x+1)&lt;BR /&gt;cutplane = CreateCutPlane(height)&lt;/P&gt;&lt;P&gt;name = str(height) +"plane.csv"&lt;BR /&gt;DSE.UI.ShowMessage(name)&lt;/P&gt;&lt;P&gt;cutplane.saveTable(name)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 09:27:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/cfd-forum/cfd-python-api-cutplane-attributes/m-p/13071147#M177</guid>
      <dc:creator>matthieu.griveletAH26V</dc:creator>
      <dc:date>2024-10-08T09:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: CFD python API - cutPlane attributes</title>
      <link>https://forums.autodesk.com/t5/cfd-forum/cfd-python-api-cutplane-attributes/m-p/13090360#M178</link>
      <description>&lt;P&gt;Okay so I finally got answers from Autodesk's dev team and apparently the CutPlaneAttributes class has not been implemented in the API, so there is nothing to get, set or work with. The plane extraction is thus impossible and this API is kinda useless if you hope to automate data extraction.&lt;/P&gt;&lt;P&gt;Good to know huh?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 08:26:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/cfd-forum/cfd-python-api-cutplane-attributes/m-p/13090360#M178</guid>
      <dc:creator>matthieu.griveletAH26V</dc:creator>
      <dc:date>2024-10-17T08:26:08Z</dc:date>
    </item>
  </channel>
</rss>

