A configuração geral da malha de EF pode ser modificada com o auxílio da interface IFeMeshSettings. Esta interface está localizada em IModel > IModelData > ICalculation. A Figura 01 mostra os elementos que podem ser modificados/apresentados.
Veja aqui um exemplo de um código em que o comprimento-alvo dos elementos de EF é definido para 100 mm. Além disso, ainda é ativada a divisão das barras com o mesmo tamanho de elemento e a divisão mínima é definida para 3 elementos:
Sub mesh_params()
Dim iApp As RFEM5.Application
' get interface for model dataDim iModel As RFEM5.modelSet iModel = GetObject(, "RFEM5.Model")
On Error GoTo e
If Not iModel Is Nothing Then ' get interface for application and lock licence Set iApp = iModel.GetApplication() iApp.LockLicense ' get interface for model dat Dim iModdata As RFEM5.IModelData2 Set iModdata = iModel.GetModelData ' get interface for calculation Dim iCalc As RFEM5.ICalculation2 Set iCalc = iModel.GetCalculation() ' get interface for mesh settings Dim iMeshSet As RFEM5.IFeMeshSettings Set iMeshSet = iCalc.GetFeMeshSettings ' get general mesh settings Dim meshGen As RFEM5.FeMeshGeneralSettings meshGen = iMeshSet.GetGeneral meshGen.ElementLength = 0.1 ' set new general mesh settings iModdata.PrepareModification iMeshSet.SetGeneral meshGen iModdata.FinishModification ' get mesh member settings Dim meshMem As RFEM5.FeMeshMembersSettings meshMem = iMeshSet.GetMembers meshMem.DivideStraightMembers = True meshMem.ElementLength = 0.1 meshMem.MinStraightMemberDivisions = 3 ' set new mesh member settings iModdata.PrepareModification iMeshSet.SetMembers meshMem iModdata.FinishModification iApp.UnlockLicenseEnd If
e: If Err.Number <> 0 Then MsgBox Err.description, , Err.Source End If iApp.UnlockLicense Set iApp = Nothing Set iModel = Nothing
End Sub
A sub-rotina também é completada por uma rotina de interceção de erros (On Error GoTo e) e volta a ser necessário um bloco Prepare-/FinishModification, tal como para a modificação de outros elementos. Aqui, o bloco é criado através da interface IFeMeshSettings.