help on macro(FREE EDGES- T-CONNECTIONS)

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

hi,

i am running the below list of process through macro to create free edges and t connections in a single click for displayed elements,

The limitations of this is every time I need to delete the components named 'ed' and '^edges' beforre running this macro,

Is it possible to make the macro itself check for those collectors and remove them each time macro is executed.

*createmark(elements,1) 'displayed'

*findedges(elements,1,0)

*renamecollector(components,'^edges','ed')

*createmark(elements,1) 'displayed'

*findedges(elements,1,1)

*createmark(components,1) '^edges'

*colormark(components,1,6)

*displaycollectorwithfilter(components,'none','',1,0)

*displaycollectorwithfilter(components,'on','ed',1,0)

*displaycollectorwithfilter(components,'on','^edges',1,0)

hope someone will help,

Tagged:

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited May 2009

    Hi,

    check this

    catch { *createmark comps 1 'ed' '^edges'}

    catch { *deletemark comps 1 }

    *createmark elements 1 all

    if { [ hm_marklength elems 1 ] > 0 } {

    *findedges elements 1 0

    *renamecollector components '^edges' 'ed'

    } else {

    tk_messageBox -message 'No Elememts '

    return

    }

    *createmark elements 1 all

    *findedges elements 1 1

    *createmark components 1 '^edges'

    *colormark components 1 6

    *displaycollectorwithfilter components 'none' '' 1 0

    *displaycollectorwithfilter components 'on' 'ed' 1 0

    *displaycollectorwithfilter components 'on' '^edges' 1 0

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited May 2009

    hi,

    :d/ :d/ :d/ :d/

    thank you for your reply.......

    i have executed it through the command window, it has 2 problems,

    1. First error occurs only for the first time of executing the algroithm

    it says components have not been selected, but continues further

    2. I couldnt make out why this is happening, after the free edges are displayed, we need to click the enter key in the command window to get the T connections displayed.

    looking forward for your reply,

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2009

    I guess below lines should work to delete

    set del_comp_list '^edges ed ';

    eval *createmark components 1 $del_comp_list;

    *deletemark components 1;