create a note for max stress result in tcl, required for repetitive task

zeta1234
zeta1234 Altair Community Member
edited October 2020 in Community Q&A

Hi all,

> Motive is to attach a note to a element with the maximum stress magnitude with the help of command panel (using Tcl commands)

> So far i have been able to attach a note to a element with the maximum stress magnitude, but i am setting up the element id and stress value manually. 

 client_handle AddNote 1 // it returns a nonzero value client_handle GetNoteHandle note2_handle 2 note2_handle SetAttachment 'node 1 4730' note2_handle SetText '211'

The node id, 4730 and note value of 211 has been entered manually.

> I dont know how to set the max value and corresponding id using the poIMeasure Class. What i am trying is given below:

 client_handle GetMeasureHandle measure_handle 1 // taking static_min_max_result measure measure_handle GetEntityList  >>{1 PART-1-1 1 PART-1-1 41460} {1 PART-1-1 1 PART-1-1 4730} measure_handle GetMaximum 'Mag' // Nothing returened here, otherwise i can save it in variable                                   // and use it further

> If successful there wont be any need of using the note and measure panel again and again for each window (say 8 windows in a page). 

Please suggest how can i rectify this problem.

Thanks in advance :)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />

Answers

  • llyle_20499
    llyle_20499 New Altair Community Member
    edited October 2018

    Hi zeta, 

     

    You will have to get maximum value using poIQueryCtrl Class. Create a selectionsethandle and add 'contour top 1'  then query it. 

     

     myWindowHndl$t GetClientHandle myPostHndl$t set modelIndex [myPostHndl$t GetActiveModel] myPostHndl$t GetModelHandle myModelHndl$t $modelIndex myModelHndl$t GetQueryCtrlHandle myQueryHndl$t myModelHndl$t GetSelectionSetHandle mySelSetHndl$t [myModelHndl$t AddSelectionSet  node] mySelSetHndl$t Add 'contour top 1' myQueryHndl$t SetSelectionSet [mySelSetHndl$t GetID]; myQueryHndl$t SetQuery 'node.id contour.value'; myQueryHndl$t GetIteratorHandle myIter$t; set data_list ''; for {myIter$t First} {[myIter$t Valid]} {myIter$t Next} {     lappend data_list [myIter$t GetDataList]; } puts $data_list

     

  • zeta1234
    zeta1234 Altair Community Member
    edited December 2018

    Hi there Livil,

    while executing the command list (provided by you above), i am getting an error 

    'extra characters after close-brace'

    ..

    So i am unable to execute a loop here.. 

    Can you help me out with this problem.

    Thanks

  • tinh
    tinh Altair Community Member
    edited December 2018

    Hi there Livil,

    while executing the command list (provided by you above), i am getting an error 

    'extra characters after close-brace'

    ..

    So i am unable to execute a loop here.. 

    Can you help me out with this problem.

    Thanks

     

    Don't copy his code and paste

    Sometimes you have to do (type) a bit. Be not lazy

  • zeta1234
    zeta1234 Altair Community Member
    edited January 2019

    Thank you all .. for your inputs..

    I am now able to execute above stated repititive task