Query result values of an element set and write to .TXT-file

Sebastian_Karp
Sebastian_Karp
Altair Employee
edited February 27 in Altair Exchange

Overview

This script will apply a Contour plot and query result values of an element set. These values are written to a .TXT-file.

 

January 18th 2024:
Script version was corrected as element set label was hardcoded in the procedure. This line 88 was deleted and new script version attached.

 

Pre-Requisite

-------------------------------------------------------------------------------------------------------------------------------------------------------------

 

NOTE:

To use the script for own result files, these lines in the .TCL need to be edited:

  • line 165: defines the contour plot (result type, component, layer, applied elements/components)
  • line 166: defines the label of the element set used for query
  • line 170: second to last argument ("element.id ...") defines the query string. These are the columns with info that is output to the final .TXT-file.
    A description how to get such query string from a manual GUI operation can be found in this article:  LINK
  • line 170: last argument defines the path to where the query-.TXT-file will be written (this must be edited for the example as well)

 

 

Usage/Installation Instructions

-------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Steps to execute:

 

1. Download attached .TCL / .H3D / .MVW-files and place in same folder

2. Open the session .MVW-file (NOTE: the HyperWorks version the session was saved in, is 2021)

 

image

 

image

 

 

3. Edit the .TCL-file in line 170 and use a valid string for the path, where the final query-.TXT-file will be written (see very last argument the line)

4. Run script from DropDown  File > Load > Script

 

image

 

image

 

 

5. See the query-.TXT-file that is written, containing the info defined by the query string in script line 170

 

 image

 

 

Post-Requisite

-------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Comments

  • Hans_Eriksen_1
    Hans_Eriksen_1 Altair Community Member
    edited February 27
    The documentation is a bit scarce.
  • Sebastian_Karp
    Sebastian_Karp
    Altair Employee
    edited February 27

    Added details on how to get the query string for script line 170.

    I hope this is sufficient how and explains the usage. Please note, the intent of this article is not to explain every single line of code, but to offer a general description of usage, so that the user can follow up on his own in more detail by editing the TCL code according to his needs.

    Thanks!