Jump to content
leoc0426

TCL command of auto contact pair finding?

Recommended Posts

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!

 

1.PNG

2.PNG

3.PNG

4.PNG

raw.hm

Share this post


Link to post
Share on other sites

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

 

Merula and leoc0426 like this

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

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 ;)

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

 

leoc0426 likes this

Share this post


Link to post
Share on other sites

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

 

 

5.thumb.PNG.7bdba50cb32cb15c7db4cd2b37eea7d9.PNG

Share this post


Link to post
Share on other sites

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

 

 

Share this post


Link to post
Share on other sites
44 minutes ago, tinh said:

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...