command line for running python script in TeXGen

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
Hemanth_T_N
Regular
Posts: 24
Joined: Tue Sep 18, 2018 11:41 am

command line for running python script in TeXGen

Post by Hemanth_T_N »

Greetings Dr. Louise,

Appreciate the work done you and your team regarding the modeling of textile composites and all the provided help.
Is there a way wherein I can run the python script without using GUI of TeXGen. Maybe be through command line in cmd or in batch script. I am trying the automate the work flow right from generation of model in TeXgen (through python script) to generation of abaqus input file to executing the job in abaqus without any manual intervention.

Best Regards,
Hemanth T N
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: command line for running python script in TeXGen

Post by louisepb »

Hi Hemanth,

Yes, you can call the TexGen functions from within a Python script without using the GUI. You just need to import the appropriate module, probably just the core if you're not doing any rendering:

Code: Select all

from TexGen.Core import *
You should then be able to access the TexGen functions (you may need to make sure that your paths are set up so that everything can be accessed).

Hope that helps,
Louise
Hemanth_T_N
Regular
Posts: 24
Joined: Tue Sep 18, 2018 11:41 am

Re: command line for running python script in TeXGen

Post by Hemanth_T_N »

Hi Dr. Louise,

Thanks for the quick reply. Its possible that you have answered my question but I do not get it because of my naivety. So I will explain my problem in detail.

I use a python script to generate FE model of textile composite in TeXGen software. To get the model, I launch the TeXGen software, In GUI, I click on "Python">>"Run Script". The Texgen software generates the FE Mesh. I then proceed to click on "File">>"Export">>"Voxel Mesh">>"ABAQUS voxel file". Specify the number of voxel count along x, y & z. click "ok". choose the folder and click "Save". The abaqus input file, orientation file and eld file are saved at the chosen folder location.

I am in need to how to get the abaqus input file, orientation file and eld file without launching the TexGen software.

Appreciate your guidance on this.

Sincerely,
Hemanth T N
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: command line for running python script in TeXGen

Post by louisepb »

Hi Hemanth,

My answer told you how to run your script independantly rather than throught the TexGen GUI. For the other part of your question you will find the scripting guide useful https://github.com/louisepb/TexGenScriptingGuide It includes sample scripts for exporting voxel meshes using the Python API.

Best wishes,
Louise
Hemanth_T_N
Regular
Posts: 24
Joined: Tue Sep 18, 2018 11:41 am

Re: command line for running python script in TeXGen

Post by Hemanth_T_N »

Hello Dr. Louise,

Thank you so much for the clarification.
Have a good weekend..!

Sincerely,
Hemanth T N
Post Reply