103x
005567
2024-07-03

Esporta geometria deformata

Come posso esportare la geometria deformata di un modello RFEM 6?


Risposta:

È possibile esportare la geometria deformata di un modello RFEM 6 esportando la mesh deformata come file CSV utilizzando l'interfaccia Webservice e il seguente script Python:

  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. /codice#

Autore

Il Sig. Gutmann fornisce supporto tecnico ai clienti di Dlubal Software.



;