🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

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

User: "Sasha1296"
Altair Community Member
Updated by Sasha1296

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? 

 

 

 

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "Mel"
    Altair Employee
    Updated by Mel

    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()

    User: "Sasha1296"
    Altair Community Member
    OP
    Updated by Sasha1296

    Thank you so much It worked!