Extract selected element IDs

Hello! In this section we'll talk about the post processing module and the data visualization.
Post Reply
bence@hit.edu.cn
Posts: 54
Joined: Tue Mar 02, 2021 2:34 am

Extract selected element IDs

Post by bence@hit.edu.cn » Fri Dec 10, 2021 9:53 am

Dear STKO team,

For transferring data from STKO to inhouse programs I would need the list of mesh elements. Specifically, STKO is convenient to simply see and select the elements that I need and display their IDs when I create a Chart. However, I can not copy the element IDs when in this window:
Untitled.png
Untitled.png (76.1 KiB) Viewed 661 times
Even just sorting them would be okay, as I could extract the element IDs as ranges instead of extracting them one-by-one. However, this isn't possible either. To make a long story short, is there a way to copy paste/ extract the element IDs that I select in the GUI of the post-processor?

Thanks for the advice in advance!
Bence

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

Re: Extract selected element IDs

Post by STKO Team » Mon Dec 13, 2021 8:36 am

Dear Bence,
You cannot copy paste them from the selection window, however there is a way to understand what is the source (node or element) of the Chart Data.

If you select multiple items, and extract their data using the "Keep multiple results", in the ChartData editor, there is a button "Copy Data to Clipboard". If you click it, STKO will copy all the chart items in the selected chart data on the ClipBoard.
You can then paste it on a text file or in Excel.
The first row will contain a label for each pair of columns. This label has the following format
"<name> - Element <id> - Gauss <id>"

with a simple manipulation of this data, you can get the element ids.

If this is not what you want you may use the PythonAPI to extract data.

bence@hit.edu.cn
Posts: 54
Joined: Tue Mar 02, 2021 2:34 am

Re: Extract selected element IDs

Post by bence@hit.edu.cn » Mon Dec 13, 2021 9:07 am

Not the most convenient, but I can easily parse the element list from that. Thank you for the advice!

P.S.: If I may, I'd suggest adding a copy-paste feature for element/node and gauss lists from the data extraction wizard in the future. I would imagine it would be a useful feature for many academic users.

Regards,
Bence

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

Re: Extract selected element IDs

Post by STKO Team » Mon Dec 13, 2021 11:10 am

P.S.: If I may, I'd suggest adding a copy-paste feature for element/node and gauss lists from the data extraction wizard in the future. I would imagine it would be a useful feature for many academic users.
Sure, we put it in our to-do list

bence@hit.edu.cn
Posts: 54
Joined: Tue Mar 02, 2021 2:34 am

Re: Extract selected element IDs

Post by bence@hit.edu.cn » Tue Dec 14, 2021 2:10 am

Thanks a lot! ;) :geek:

bence@hit.edu.cn
Posts: 54
Joined: Tue Mar 02, 2021 2:34 am

Re: Extract selected element IDs

Post by bence@hit.edu.cn » Tue Dec 14, 2021 9:35 am

For others who want to follow the element ID extraction discussed in this thread, until copying is not implemented in STKO, you can use this simple looper (attached python script) to get rid of excess text and write only the list of element numbers to a csv file.
EleExtract.rar
(735 Bytes) Downloaded 60 times

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

Re: Extract selected element IDs

Post by STKO Team » Wed Dec 15, 2021 9:19 am

Thanks!

Post Reply