Jump to content

Recommended Posts

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

 

 

 

Share this post


Link to post
Share on other sites
18 hours ago, tinh said:

 

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

Share this post


Link to post
Share on other sites

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

 

 

Share this post


Link to post
Share on other sites
8 hours ago, tinh said:

*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

 

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