Export References to file

Andrew_22514
Andrew_22514 Altair Community Member
edited May 2021 in Community Q&A

I'd like to find a way to export the References data in the References Browser (Right click on a collector and select Xref Entities) to a text file for all component collectors in my model. I'm using HyperMesh 2017.2 and NASTRAN.

I would prefer a way to script it with with Tcl or a Solver/Summary Template. My model has a lot of component collectors. My goal is to use this for documenting individual collector changes when we do model revisions/improvements. 

Is there a way to access that functionality through the Tcl scripting API? I check the command.tcl file and it looks like it doesn't use a dedicated command, but rather just creates two marks and differences them. 

Answers

  • Adriano A. Koga
    Adriano A. Koga
    Altair Employee
    edited May 2021

    Hi,

     

    i'm not aware of any aPI to export the list.

    You would need to use the xreference commands, such as the example below:

     

            #get REFERENCES connectors    
            hm_getcrossreferencedentities elems $elo 7 2 0 0 -byid        
            set conn [hm_getmark connectors 2];                
            #get REFERENCE components
            *clearmark connectors 2
            
            if {[llength $conn]>0} {  
                hm_getreferencedentities connectors $conn 7 2 0 0 -byid
                set comps_list [hm_getmark comps 2];
                *clearmark comps 2
                set thick_list [hm_getvalue comps user_ids=$comps_list dataname=thickness];
            } else {
                set thick_list ""
            }

  • Andrew_22514
    Andrew_22514 Altair Community Member
    edited May 2021

    Hi,

     

    i'm not aware of any aPI to export the list.

    You would need to use the xreference commands, such as the example below:

     

            #get REFERENCES connectors    
            hm_getcrossreferencedentities elems $elo 7 2 0 0 -byid        
            set conn [hm_getmark connectors 2];                
            #get REFERENCE components
            *clearmark connectors 2
            
            if {[llength $conn]>0} {  
                hm_getreferencedentities connectors $conn 7 2 0 0 -byid
                set comps_list [hm_getmark comps 2];
                *clearmark comps 2
                set thick_list [hm_getvalue comps user_ids=$comps_list dataname=thickness];
            } else {
                set thick_list ""
            }

    Thanks for the reply, sorry for late response I totally forgot about this. I had a feeling there wasn't a built in functionality for this. I'll use your script segment and look around the scripting API and see what I can come up with. Just having an idea of which command to start looking at helps quite a bit. Thanks!