TCL command of auto contact pair finding?

Altair Forum User
Altair Forum User
Altair Employee
edited November 2020 in Community Q&A

Hi everyone,

I have problem obtaining the TCL command of auto contact pair finding.

My model contains 6 components, I use the Abaqus contact manager to automatically find contact pairs for me.

Manually, I can successfully find contact pairs. Since I want to run this process automatically by TCL script, I do the process manually and check out the code added in the command.cmf file.

Unfortunately, the code are very long, approximately 50000 lines. Also, the code are about nodes' data and surface set, which is not I am looking for.

I am looking for the command that represents the buttons 'auto', 'components: all', 'find', 'create'. I will show these buttons in the figures attached.

By the way, the file: raw.hm is my model. Again, my goal is to get the TCL code for finding contact pairs.

Please help me, thanks!

 

<?xml version="1.0" encoding="UTF-8"?>1.PNG

<?xml version="1.0" encoding="UTF-8"?>2.PNG

<?xml version="1.0" encoding="UTF-8"?>3.PNG

<?xml version="1.0" encoding="UTF-8"?>4.PNG

Unable to find an attachment - read this blog

Answers

  • tinh
    tinh Altair Community Member
    edited May 2017

    Hi, 

    looking for relevant code in scripts folder and find what you need:

    #open contact manager

     source [file join [hm_info -appinfo SPECIFIEDPATH hm_scripts_dir] abaqus Contact_wizard CW.tcl]

    #open autocontact

     ::autocontact::CWautocontact::AutoContactGui

    #invoke selecting components>all

     *createmark comps 1 all set ::autocontact::CWautocontact1::newElems [hm_getmark comps 1] ::AbaqusCW::HighLight off if {$::autocontact::CWautocontact::flag==1} {      set ::autocontact::CWautocontact::flag 0 } if {[llength $::autocontact::CWautocontact1::newElems]} {      ::autocontact::CWautocontact1::AddCompsToTable }

    # set proximity distance

     set ::autocontact::CWautocontact1::proximity_entry 5.0

    # invoke 'Find' button

     ::autocontact::CWautocontact::UpdateInterface

     

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited May 2017

    Thanks a lot! It's really a great help to me.

    I have one more question. How can I know which TCL file contains those command code.

    There are a bunch of TCL files in scripts folder. Is there a way to find the command of  a button?

    At the moment, I just manually search through every file that I think the command should be. It's kind of time consuming.

     

  • tinh
    tinh Altair Community Member
    edited May 2017

    There are some ways to find command bound to a tk button.

    but you may make hm hanging. So go to scripts folder and parse tcl files is better way

    I will not reveal them, it is safer for you ;)/emoticons/default_wink.png' srcset='/emoticons/wink@2x.png 2x' title=';)' width='20' />

    once you become knowledgeable about tcl, you'll find it easily

     

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited May 2017

    I have another question. How to invoke the  ''create ' button.

    I found the command of 'create' button inside the autocontact_tab.tcl file.

    The command is '::autocontact::CreateEntities $T', but it doesn't work.

    the command window give me an error message  reads as follows: can't read 'T': no such variable

     

     

    <?xml version="1.0" encoding="UTF-8"?>5.thumb.PNG.7bdba50cb32cb15c7db4cd2b37eea7d9.PNG

  • tinh
    tinh Altair Community Member
    edited May 2017

    Hi,

    T is data tree, it's a tk widget.

    try command:

    ::autocontact::CreateEntities .autocontactGui.outer_frame.results_tree

  • Vikas Kumar_22189
    Vikas Kumar_22189 Altair Community Member
    edited December 2018

    Dear @tinh

     

    How to get this ABAQUS CONTACT MANAGER table whole data and play around this.

    like getting the details where it is tied or not.

     

    image.png.d7de4083086a8debfa5a0cff95470ad8.png

     

    Other thing is i need full tabular data.

    Best Regards,

    Vikas Kumar

     

     

  • tinh
    tinh Altair Community Member
    edited December 2018

    hi

    set ::AbaqusCW::CWcontactpair2::tiedCbox

     

    array get ::AbaqusCW::CWcontactpair1::table_arraySurf

  • Vikas Kumar_22189
    Vikas Kumar_22189 Altair Community Member
    edited December 2018

    hi

    set ::AbaqusCW::CWcontactpair2::tiedCbox

     

    array get ::AbaqusCW::CWcontactpair1::table_arraySurf

     

     

    I need this table all values 

     

     

     

    image.png.363f78df16ec65db23d46bdbb49fc7a8.png

     

     

    which is not coming by using    array get ::AbaqusCW::CWcontactpair1::table_arraySurf

    My code is 

     

    source [file join [hm_info -appinfo SPECIFIEDPATH hm_scripts_dir] abaqus Contact_wizard CW.tcl]
    #open autocontact
    array set tableData [array get ::AbaqusCW::CWcontactpair1::table_arraySurf]

    #creating own array
    foreach index [array names tableData] {
             puts 'index: $index '
             puts 'arr: tableData($index): val: $tableData($index) '

             # Printing Data
    }                       
    puts 'END'

     

     

     

     

    Thanks,

    Vikas Kumar

  • tinh
    tinh Altair Community Member
    edited December 2018

    Hi

    It is

    array get ::AbaqusCW::cwNonSurArray

  • timonq
    timonq Altair Community Member
    edited March 2020

    Hello, 

    Could someone  send similar code for Auto Contact for Optistruct profile? I mean this:

    image.png.5c37d6dd0e4bfad451f6443bf193fbff.png