Popup Window

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

Hello Everyone,

 

I am new to scripts on HM and learning from examples and tutorials. I want to make macro to check element quality of displayed elements i.e. Min/Max angle, Mi/Max length, duplicates etc in single shot. I am able to create macro to check and highlight nodes on issues elements. However I would like this macro to popuo window and share statement about quality. 

As of now I am using 

 

hm_usermessage 'number of element sides failing for max lentgth= $n '     
 

This is overwriting previous message and I am able to see only last check details on HM page.

Is there any option which will create text box and write all criaterial by appending previous check and give show as check summary.

 

Thanks in advance.

Vikas Singh

Answers

  • tinh
    tinh Altair Community Member
    edited November 2019

    Let's say, you have check results stored in variable CheckResults

    You can put it to a text file by using

    set fpt [open summary.txt a]

    puts $fpt $CheckResults

    close $fpt

     

    After finish checking, call notepad.exe to open the file by:

    exec notepad.exe summary.txt

  • VikasSingh
    VikasSingh Altair Community Member
    edited November 2019

    Thanks Tinh,
    Let me check it once. I have another query on same line. I am checking for free 1d in my check macro. However if displayed part done have any free 1D it gives error and macro stops there. Is there any option to set criteria where if run part of macro to check free 1D only if there is 1D elements present in the displayed model.

    I am using below command

     

    hm_markclear elements 1
    hm_markclear elements 2


    *evaltclscript 'pamcrash2G/pamcrash2G_proc.tcl' 0
    *setactivepage 17
    *evaltclstring '::Pamcrash2G::mask_plinks' 0

    *createmark elements 1 'displayed'
    *createmarklast elements 1;
    *elementtestfree1d elements 1 2

     

    I want this function to execute only if there is 1D element present in the display mode. 

  • tinh
    tinh Altair Community Member
    edited November 2019

    Simply, If it has error then use catch command