Create a list of displayed loadcollectors

Andy@LamteqSolutions
Andy@LamteqSolutions Altair Community Member
edited October 2020 in Community Q&A

Hi all,

 

I am trying to produce a script which lists displayed entities. Specifically, I am looking to write a script which displays all loadsteps, then creates a list of all loadcollectors, hides then reshows them and deletes all non-displayed loadcollectors.

 

it seems a bit long winded but my model contains loadadd loadcollectors and when I come to delete unused loadcollectors it doesn't identify any... despite there being a good number which are in no way used.

 

Cheers in advance

 

Andy

 

 

 

Answers

  • tinh
    tinh Altair Community Member
    edited June 2019

    I don't understand your case. Pls describe more

  • Andy@LamteqSolutions
    Andy@LamteqSolutions Altair Community Member
    edited June 2019

     

    Hi Tinh and hope you are well.

     

    It's more of a clean up thing. I have list of loadsteps and with them loadcollectors. The issue is that when I delete the loadsteps which I do not need, the loadcollectors remain even though they are not referred by anything. Ideally I would need a delete unused loadcollectors but alas that button doesn't work. 

     

    The loadcollectors carry a massive chunk of info (namely pressure load on numerous elements) so I would for the sake of reducing file size like to get rid of anything which isn't used. 

     

    The way I do it manually is 

    1. Hide all loadcollectors

    2. Display all loadsteps

    3. Double click all loadcollectors which are displayed as this then displays all loadadd loadcollectors. 

    4. Delete anything which is not displayed.

     

    Hope this makes sense.

     

    Cheers

    Andy

  • tinh
    tinh Altair Community Member
    edited June 2019

    Yes, 

    No.3 is not clear how to do (i double click but its loadadd does not.

     

    Anyway try and reply me results:

     

    #hide all loadcols:

    *createmark loadcols 1 all

    *displaycollectorsbymark loadcols 1 off 1 1

     

    #show all loadsteps

    foreach LS [hm_entitylist loadsteps name] {*displaycollectorwithfilter loadsteps on $LS 1 1}

     

    #delete undisplayed loadcols:

    *createmark loadcols 1 displayed

    *createmark loadcols 1 reverse

    *deletemark loadcols 1

     

     

  • Andy@LamteqSolutions
    Andy@LamteqSolutions Altair Community Member
    edited June 2019

     

    Awesome, I will give it a go and let you know.

     

    Many thanks again Ting

  • Andy@LamteqSolutions
    Andy@LamteqSolutions Altair Community Member
    edited June 2019

    I do apologise, I mistyped, Many thanks Tinh!

  • Andy@LamteqSolutions
    Andy@LamteqSolutions Altair Community Member
    edited June 2019

    *createmark loadcols 1 all

    *displaycollectorsbymark loadcols 1 off 1 1

     

    Tinh,

     

    My loadsteps refer to loadcollectors which have LOADADD card image. These then refer to 3 additional loadcollectors. 

     

    When I hide all loadcollectors then display loadsteps, the LOADADD loadcollectors are displayed but the loadcollectors referred to by the LOADADD cards are not... Which is annoying.

     

    Your code did something a bit strange. It displayed as expected but it deleted all but one loadcollector regardless of being displayed. It's an odd one. I don't see anything wrong with your code so am a bit puzzled as to why it would do this.

     

    Don't worry too much, its more about cleaning up the model and removing things which are not referred to so my models run fine. I just hate warning notes on the optistruct lol.

     

    Cheers

    Andy