TCL command to check for displacement Query for Node By Set

Emil George
Emil George Altair Community Member
edited October 2020 in Community Q&A

Hi,

I am trying to write a TCL script for postprocessing.

I am stuck in between, where in I am looking to get the displacement of a node.

In stead of getting the maximum displacement node, I need to get the displacement of a particular node for which a set is defined.

 

<?xml version="1.0" encoding="UTF-8"?>image.thumb.png.bdb1c903cde3fa977fe81bae8d0f13a3.png

 

can anyone help me on this.

Thanks in advance

Emil

 

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited April 2018

    Hi Emil,

     

    One typical approach is to draw contour of the data type you want to get (e.g. Displacement) and query values with poIQueryCtrl and poIQueryIterator classes. You can find the following sample code in the user reference guide:

     hwi GetSessionHandle mySessionName mySessionName GetProjectHandle myProjectName set pageIndex [myProjectName GetActivePage] myProjectName GetPageHandle myPageName $pageIndex set windowIndex [myPageName GetActiveWindow]  myPageName GetWindowHandle myWindowName $windowIndex myWindowName GetClientHandle myPostName set modelIndex [myPostName GetActiveModel] myPostName GetModelHandle myModelName $modelIndex myModelName GetSelectionSetHandle mySetName [myModelName AddSelectionSet element] myModelName GetQueryCtrlHandle myQueryName myQueryName SetSelectionSet [mySetName GetID] myQueryName SetQuery 'node.id result.value'

    If you already have a set of target nodes, set its ID to the query ctrl handle.

     

    Another is to access result values directly with hwIDataFile class. Please find the sample code in the reference guide as well.

     

    Regards,

  • Emil George
    Emil George Altair Community Member
    edited April 2018

    hi ,

    Thanks for the reply. can you explain more on the above commands.

    In my case I have already drawn the Y-displacement contour. Now I need to get the displacemnet vale for node which are saved in SET . I tried the below commands . but its not working 

     

    image.png.7448e0d82d6db26e5d1ce4191414f2d9.png

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited April 2018

    You have to initialize the iterator before getting data. Typically, the code becomes:

     qc$j GetIteratorHandle iter$j for {iter$j First} {[iter$j Valid]} {iter$j Next} {     iter$j GetDataList }

    If you have only one node to query about value, the following code will also work:

     qc$j GetIteratorHandle iter$j iter$j First set datalist [iter$j GetDataList]

    Please give it a try.