I’m fairly new to python and I’ve run into an interesting problem; I’ve got an input text file which has many points from multiple systems. Each system must have a different mesh and a different material. The following is an excerpt from the file:
nodes nodal group
x1 y1 z1
353.7 228 -123.8 MN
353.4 231.5 -132.4 MN
348.6 132.6 -149.2 PAuN
377.9 147.4 -149.5 PG&N
375.7 146 -152.9 PG&N
376.8 174.8 -155.4 PG&N
376.75 194 -165.8 IJNu
(note: the same nodal groups can appear at different points in the list, they are in no particular order)
I can read the data in and create the point-cloud just fine, what I am struggling to do is create an array with the name from the nodal group column, and whenever that name comes up, that point can then be appended to the appropriate array.
how do I extract the name from that column, so I can create a variable named MN, PAuN, PG&N, etc…
At the moment I have pre-defined variables with the names described, but in the future, the list will expand to include new nodal groups and I would much rather have the arrays created when the script is run, instead of pre-defining them.
Sorry for making you read a small novel,
Any help will be much appreciated.