Change Inflation Mesh via PyMechanical
I am trying to control the inflation layer on a mesh via a python script and got two problems. I try to address everything via NameSelection, since I have already defined them in advance and my current code looks like this:
Rotor_Inflation = mesh.AddInflation()
Rotor_Inflation.ScopingMethod = GeometryDefineByType.Component
Rotor_Inflation.NamedSelection = ExtAPI.DataModel.GetObjectsByName("Rotor_Face")
Rotor_Inflation.InflationOption = 1
Rotor_Inflation.FirstLayerHeight = Quantity(0.4, "mm")
Rotor_Inflation.MaximumLayers = 15
Rotor_Inflation.NamedSelection = ExtAPI.DataModel.GetObjectsByName("Rotor_Aussenkante")
Rotor_Inflation.Name = r"""Rotor_Inflation"""
Now I have the first issue that in the second line
"Rotor_Inflation.ScopingMethod = GeometryDefineByType.Component" I get the following output:
Typenkonflikt. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))".
I would like to know if "Component" is wrong here or what else I should use?
My second question is, how do I change the "Boundary Scoping Method" as right now I'm using two times the same code (Line 3 and 7) and this is not working as well?
Hope someone can help me out.