export nodes of group in ascii format
-
Hello,
In my model programed with python (TUI), i created a group of node. I would like to save node numbers in array in order to export them (ascii format) to an another software. But i don't find functions (TUI) able to make this operation.
Thank you in advance,
Arnaud-
alzina wrote:
Hello,
In my model programed with python (TUI), i created a group of node. I would like to save node numbers in array in order to export them (ascii format) to an another software. But i don't find functions (TUI) able to make this operation.
Thank you in advance,
Arnaud
Hello Arnaud,
if you want to export all nodes from the mesh with the name "my_mesh":
***********************
mesh=my_mesh.GetMesh()
fil=open('model.nodes','w')
for currentNode in range(mesh.NbNodes()):
nodeCoords=mesh.GetNodeXYZ(currentNode+1)
fil.write(('%d %14e %14e %14e\n') % (currentNode,nodeCoords[0],nodeCoords[1],nodeCoords[2]))
fil.close()
***********************
hope this will solve your problem
Daniel Weida-
Daniel Weida wrote:
alzina wrote:
Hello,
In my model programed with python (TUI), i created a group of node. I would like to save node numbers in array in order to export them (ascii format) to an another software. But i don't find functions (TUI) able to make this operation.
Thank you in advance,
Arnaud
Hello Arnaud,
if you want to export all nodes from the mesh with the name "my_mesh":
***********************
mesh=my_mesh.GetMesh()
fil=open('model.nodes','w')
for currentNode in range(mesh.NbNodes()):
nodeCoords=mesh.GetNodeXYZ(currentNode+1)
fil.write(('%d %14e %14e %14e\n') % (currentNode,nodeCoords[0],nodeCoords[1],nodeCoords[2]))
fil.close()
***********************
hope this will solve your problem
Daniel Weida
Hello,
Since I am new to Python, is it possible to take this snippet of code and use it to export nodes to a file by running a version of the above script in a GUI mode? Has anybody written such a script that I could use?
Thanks
JMB
-
-
Powered by
Ploneboard
