Query a lot of nodes in a different format

Post Reply
Lichiel
Posts: 7
Joined: Fri Sep 09, 2022 3:36 am

Query a lot of nodes in a different format

Post by Lichiel » Thu Nov 24, 2022 5:35 am

Hello STKO
I’m currently running many versions of a model as a parametric study or studying different modeling strategies. The model has about 200 000 nodes, and I would like to get the output in a file with node number and Acceleration in 3 dimensions.
Currently to do that I need to go to extract chart data and select the nodes manually, afterward copy the data to a clipboard and then paste it on an excel or txt file. Usually, I relate this node with its cartesian coordinates and choose different nodes for different purposes in MATLAB.
This works if my number of nodes is relatively small, but the STKO software shuts down after I try to copy to the clipboard a bigger number of nodes.
I thought about a couple of solutions, not sure if it is possible:
• I could maybe read the MPCO data directly with another software and output my desired nodes to an easier-to-
access file format.
• I could maybe write a python code that exports the data under Chart Data to another format without having to copy
it to a clipboard.
• As well, inside Char Data when extracting the data it is not possible to input the desired node manually by simply
introducing their number, I have to select it with the mouse, which is a problem if the model is really big and detailed.
To summarize, I’d like to be able to export a large number of nodes with their accelerations components to another format without the copy-to-clipboard way, because it has limitations. Could you kindly suggest a way to go about it?
As a suggestion including the option to choose nodes based on their cartesian coordinates would be much appreciated, I wrote a simple MATLAB code to do so. Including something like that in the Postprocessor would be great.

STKO Team
Posts: 3066
Joined: Tue Oct 29, 2019 8:45 am

Re: Query a lot of nodes in a different format

Post by STKO Team » Thu Nov 24, 2022 8:46 am

You can do it with the PythonAPI in the STKO post-processor.
But, could you be more specific about what you want to achieve?

Do you need a script that allows you to enter 3 coordinates, look for the nearest node, and extract data for that node?
Or, do you want to extract data for all nodes, exporting also their coordinates?

Please explain in detail what you would like to do, and we will try to help you

Lichiel
Posts: 7
Joined: Fri Sep 09, 2022 3:36 am

Re: Query a lot of nodes in a different format

Post by Lichiel » Fri Nov 25, 2022 2:05 am

Hello
I’d like to extract 3D acceleration data for all nodes. I don’t need coordinates.

Lichiel
Posts: 7
Joined: Fri Sep 09, 2022 3:36 am

Re: Query a lot of nodes in a different format

Post by Lichiel » Fri Nov 25, 2022 2:18 am

A second one where, by entering coordinates for a paralepidid, all nodes that are contained within that volume are exported, with their accelerations and ids.

STKO Team
Posts: 3066
Joined: Tue Oct 29, 2019 8:45 am

Re: Query a lot of nodes in a different format

Post by STKO Team » Wed Nov 30, 2022 1:26 pm

Try this script:
extract_data_node_custom_function.zip
(2.81 KiB) Downloaded 309 times

Lichiel
Posts: 7
Joined: Fri Sep 09, 2022 3:36 am

Re: Query a lot of nodes in a different format

Post by Lichiel » Fri Dec 02, 2022 3:06 am

Thank you very much
That's exactly what I needed :)

STKO Team
Posts: 3066
Joined: Tue Oct 29, 2019 8:45 am

Re: Query a lot of nodes in a different format

Post by STKO Team » Fri Dec 02, 2022 10:56 am

You're welcome

Post Reply