How to use "Custom" Mesh size in Lua with CADFEKO

Sasha1296
Sasha1296 Altair Community Member
edited October 2020 in Community Q&A

Hello 

I've been having a difficulty with meshing cubes, when I  run the command in lua script: 

 

project.Mesher.Settings.MeshSizeOption = cf.Enums.MeshSizeOptionEnum.Fine

 

The mesh that is generated doesn't have enough triangles, I tried to fix this by writing:

 

project.Mesher.Settings.MeshSizeOption = cf.Enums.MeshSizeOptionEnum.Custom
project.Mesher.Settings.TriangleEdgeLength = 0.2

 

but I get an error: 'Empty expression is not allowed for Edge size.
Error 16628: Error in expression at position 0 for expression: Edge size = ' 

 

How can I fix this error and set the triangle edge length to 0.2 using Lua? 

 

 

 

Tagged:

Answers

  • Mel
    Mel Altair Community Member
    edited July 2020

    Have you tried to script record setting a custom mesh size and then using script play back?

    In Feko 2020 if I do this I get:

     

    -- Updating mesh parameters
    MeshSettings = project.Mesher.Settings
    properties = MeshSettings:GetProperties()
    properties.MeshSizeOption = cf.Enums.MeshSizeOptionEnum.Custom
    properties.TriangleEdgeLength = '0.1'
    MeshSettings:SetProperties(properties)

    -- Mesh the model
    project.Mesher:Mesh()

  • Sasha1296
    Sasha1296 Altair Community Member
    edited July 2020

    Thank you so much It worked!