AUTOMATIC SCREEN CAPTURE

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
sooriyan
Regular
Posts: 10
Joined: Tue Mar 24, 2020 1:55 pm

AUTOMATIC SCREEN CAPTURE

Post by sooriyan »

Hi Louis and co,

I have been using TexGen for some time and thank you guys for the great work. I want to automate the geometry modeling without using GUI. I want to know is there a way that I can automatically take a screenshot of the model without opening GUI. I have done those in ABAQUS where we can export the viewport without actually opening the GUI. Is there a similar way in ABAQUS?


Thanks and Regards
Sooriyan
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: AUTOMATIC SCREEN CAPTURE

Post by louisepb »

Hi Sooriyan,

Apologies for the slow reply - I was on annual leave last week.

You should be able to create a render window without opening the GUI as shown in the code below.

Code: Select all

# Get an instance of the CTexGenRenderer to render the textile
Renderer = CTexGenRenderer()

# Render our textile clipped to the domain
Renderer.RenderTextile()

# Start rendering
Renderer.Start()
Best wishes,
Louise
sooriyan
Regular
Posts: 10
Joined: Tue Mar 24, 2020 1:55 pm

Re: AUTOMATIC SCREEN CAPTURE

Post by sooriyan »

Hi Louise,

Sorry for catching up late on this. When i do what you have suggested TexGen is crashing. Is there a way to save the screenshot in png format without opening the GUI.

Code: Select all

# Get an instance of the CTexGenRenderer to render the textile
Renderer = CTexGenRenderer()

# Taking a screenshot
Renderer.TakeScreenShot(r"RVE.png", 1)
Using this is also making TexGen to crash. Is this the right way to capture the screen or is there a better way?
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: AUTOMATIC SCREEN CAPTURE

Post by louisepb »

Hi Sooriyan,

I'm afraid that I don't know why this is crashing TexGen. I would have to investigate but am afraid that I finish work at the end of today until Jan.

In your code snippet it looks like you haven't actually rendered the textile so I'm not sure that the TakeScreenShot function would work.

Is there a particular reason that you don't want to open the GUI? As an interim could you save the model instead in your automated textile generation and then load into the GUI at a later point to view/save images? We run optimisations where we save model information during the optimisation which we can then view at a later date.

Sorry not to be more help,
Louise
sooriyan
Regular
Posts: 10
Joined: Tue Mar 24, 2020 1:55 pm

Re: AUTOMATIC SCREEN CAPTURE

Post by sooriyan »

Hi Louis,

If I render the textile a small window showing the textile pops up and closes and TexGen crashes. Is it something to do with my computer configurations? Are you able to take screenshots on your desktop without opening the GUI?

I am trying to take screenshot without opening the GUI because I need to complete the entire analysis from TexGen to ANSYS in one go, without me not opening the GUI to see if the RVE has come right.

Enjoy your holidays. Reply to me once you are back
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: AUTOMATIC SCREEN CAPTURE

Post by louisepb »

Hi Sooriyan,

The render window opens briefly and then crashes on my system as well. I will need to investigate what's going on here.

In the meantime the most straightforward thing would be to save the model using SaveToXML("MyTextile.tg3") and then view it in the GUI once the analysis is complete (or if the analysis is lengthy you can view it in the GUI as soon as it has been created).

Sorry it's not a complete answer but hope it helps,
Louise
sooriyan
Regular
Posts: 10
Joined: Tue Mar 24, 2020 1:55 pm

Re: AUTOMATIC SCREEN CAPTURE

Post by sooriyan »

Hi Louis,

I hope you and your family are safe. Just wanted to ask if there is any update on this or any work on this was done?

Are you still facing the error or were you able to solve it?
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: AUTOMATIC SCREEN CAPTURE

Post by louisepb »

Hi Sooriyan,

Apologies for the slow reply, I was off work last week. I'm afraid that I haven't had the opportunity to look at this yet. I will try to take a look once things ease up over the summer.
Best wishes,
Louise
Post Reply