Jump to content

Recommended Posts

Hey guys,


I'm trying to write a script which deletes elements of a model, that have a young's modulus under a certain value ("Grenzwert").

Running the following Code, this is working as it is supposed to for the first 5 iterations. Afterwards the number of elements deleted stays the same all the time. The problem is, that there are still elements with a youngs modulus lower than 100.

Do you know what's the problem here?


Some annotations which may help to understand the code:

lStressValue_1 = list containing the young's modulus of every element

delete_id = element id which should be deleted


# Suchen aller Werte unter Grenzwert
set delete_id ""
set delete_index {}
set Grenzwert 100
set y -1
set Element ""
# y gibt den Index des Felded unter Grenzwert an wird zu einer Liste zusammengefügt
foreach Element $lStressValue_1 {
        incr y
        if {[expr $Element < $Grenzwert]} {
            lappend delete_index "$y"
# Die Element-Ids aus der Liste der lIDs mit den Elementen unter Grundwert herauslesen
foreach Element_C $delete_index {
    append delete_id "[lindex $lID_1 $Element_C] "

*createmark elements 1 {*}$delete_id
*deletemark elements 1


Kind regards,


Share this post

Link to post
Share on other sites

Note that from v13 you can filter entities by "less than value" :


*createmark elems 1 $IID_1

*createmark elems 2 "less than value" collector.material.\$E $Grenzwert 0

*markintersection elems 1 elems 2

*deletemark elems 1




Share this post

Link to post
Share on other sites

Thank you, this already helps me a lot!

But somehow, the  line  *createmark elems 2 "less than value" collector.material.\$E $Grenzwert 0 marks all the elements of the model.

Is the variable $E the youngs modulus and does it have to be declared before using the command?

And what's the meaning of the 0 at the end of the line?


Or in general: What do I have to put in here: collector.material.\$E

The real collector names or can I leave it as it is?

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.

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.

Sign in to follow this  

  • Create New...