Jump to content
masuarez1122

how to select solid to edit it

Recommended Posts

I'm new to TCL scripting, and I'm looking for a way to select a solid by its location.  I looked into *createmark with the "by box"/"by cylinder" option, but they don't work for solids. 

 

"This is currently supported for nodes, elements, connectors, components (FE and connectors only), loads, equations, loadcols, systems, systcols, vectors, vectorcols, blocks, groups, sets and contactsurfs" - from Altair 14.0 documentation

 

I would also use the same method to find surfaces to edit solids. 

 

Can somebody help with this? 

 

Share this post


Link to post
Share on other sites

I found another post that asked basically the same question (

 using hm_measureshortestdistance2 works, I just need to figure out how to call the entity_id that it returns.

 

for example, I created a mark of all my solids *createmark solids 2 1-1000

 

then I measured the distance between a node at (0 76 81) and all my solids with hm_measureshortestdistance2 0 76 81 solids 2 0 0

 

I get the following:

0 0 0 0 44 0 76 81

 

my solid id is 44, but how do I extract it?

 

Thank you

 

Share this post


Link to post
Share on other sites

Hi

 

You can get the solid id in the variable 'id' as following:

set id [lindex [hm_measureshortestdistance2 0 76 81 solids 2 0 0] 4]

or

lassign [hm_measureshortestdistance2 0 76 81 solids 2 0 0] d dx dy dz id

Hope it helps.

tinh likes this

Share this post


Link to post
Share on other sites
12 hours ago, akitoguc said:

Hi

 

You can get the solid id in the variable 'id' as following:


set id [lindex [hm_measureshortestdistance2 0 76 81 solids 2 0 0] 4]

or


lassign [hm_measureshortestdistance2 0 76 81 solids 2 0 0] d dx dy dz id

Hope it helps.

 

Thank you, akitoguc, that is cleaner code than what i had.  I had two extra lines to achieve the same thing.  

 

I appreciate your time and help.  

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...