Check if an assembly/set is already available in a model
Altair Forum User
Altair Employee
Hello guys,
I am new here and have less experience in scripting. I hope you can help me. /emoticons/default_smile.png' alt=':)' srcset='/emoticons/smile@2x.png 2x' width='20' height='20'>
My problem is the following one. I would like to check if an assembly and a set are already available in a model. I want do it by the assembly/set name.
For example, I want to to check if the assembly with the name xx is already available. When no, a new assembly is created. When yes, nothing is done.
Which command lines I have to use doing it? Thanks.
0
Answers
-
Try this code:
set assyName 'Toto';
if { [hm_entityinfo exist assems $assyName -byname] == 1 } {
puts 'Assy $assyName exists!'
} else {
puts 'Assy $assyName not found!'
}Just change 'assems' to 'sets' for checking overs Sets.
HTH,
0 -
That helps. Thanks. /emoticons/default_smile.png' alt=':)' srcset='/emoticons/smile@2x.png 2x' width='20' height='20'>
0