103x
005567
2024-07-03

导出变形的几何体

如何导出 RFEM 6 模型的变形后的几何体?


回复:

您可以使用网络服务接口和以下 Python 脚本将 RFEM 6 模型的变形后网格导出为 CSV 文件:

  1. code.python#
  2. References

from RFEM.initModel import *
from RFEM import *
from RFEM.Results.meshTables import *
import pandas

  1. Establish connection to currently active model

connectToServer()
connectionGlobals.client.service.get_active_model()
Model(False,)

  1. Query save directory and define name for csv files

path = input("Save directory for csv files:")
path = path.removeprefix("\"")
path = path.removesuffix("\"")

deformedNodesTableName = "deformed_nodes"
memberTableName = "members"
surfaceTableName = "surfaces"

  1. Read out deformed geometry

deformedNodes = pandas.DataFrame(MeshTables.GetAllFENodesDeformed())
deformedNodes = deformedNodes"y", "z"
deformedNodes.to_csv(path + "\\" + deformedNodesTableName + ".csv", index=False)

deformedMembersRaw = MeshTables.GetAllFE1DElements()
if(len(deformedMembersRaw) != 0):

  1. deformedMembers = pandas.DataFrame(deformedMembersRaw)
  2. deformedMembers = deformedMembers"FE_node2_no".astype(int)
  3. deformedMembers.to_csv(path + "\\" + memberTableName + ".csv", index=False)

deformedSurfacesRaw = MeshTables.GetAllFE2DElements()
if(len(deformedSurfacesRaw) != 0):

  1. deformedSurfaces = pandas.DataFrame(deformedSurfacesRaw)
  2. deformedSurfaces = deformedSurfaces"FE_node2_no", "FE_node3_no", "FE_node4_no".astype(int)
  3. deformedSurfaces.to_csv(path + "\\" + surfaceTableName + ".csv", index=False)
  4. /代码#

作者

Gutmann 先生目前负责 Dlubal Software 的客户支持工作。



;