Jump to content
Go to homepage

Write Your Own Export Routine

customexport_featuredimage

When it comes to exchang­ing data between CAESES® and other tools (e.g. for meshing & sim­u­la­tion), CAESES® users typ­i­cally choose from a set of export formats (*.stp, *.iges, *.stl,.…). However, spe­cial­ized in-house tools often require the use of a pro­pri­etary format that is not readily avail­able in CAESES®. For this purpose, we have intro­duced a very intu­itive and easy-to-use mech­a­nism to allow users to write and automate their own export format.

See the picture at the top of this post: Let’s say we want to create such an ASCII file that contains some simple xyz-point data of a curve that exists in your CAESES® project. For each design variant, you want to export this curve in such a format, and the file should be auto­mat­i­cally put into the cor­re­spond­ing design direc­tory of your current variant. 

Define Input and Output

All you have to do is to wrap your export logic into a feature def­i­n­i­tion. Usually, features in CAESES® are handy for wrapping recur­ring geometry sequences, and they are heavily used in the context of para­met­ric surface gen­er­a­tion. However, you can also employ them for file I/O and many other things. In features, you can make use of loops and control state­ments (if, else, break, …) to create even complex export routines, or any other routines.

For our simple example, you first have to specify the input of your export feature, such as file name and the curve you want to export, as well as a given number of discrete points (“N”). The def­i­n­i­tion itself is rather simple and shown in the second picture below: Open the file, write out your content line by line, and finally close the file again. In a loop, the point data of the curve is cal­cu­lated N‑times and written into the file using an expo­nen­tial format (“e”) with a given pre­ci­sion (“5”). 

customexport_arguments
customexport_featuredefinition

Automate with Software Connector

The software con­nec­tor in CAESES® allows you to connect your external tools, i.e. to automate meshing and CFD runs. In the software con­nec­tor widget, you can now create a new item (by clicking the green “+” button on the top left of the input geometry section) and choose Feature Def­i­n­i­tion” as source. CAESES® detects all feature def­i­n­i­tions in your project that contain file I/O commands and lists them in the next step. In our example, we have chosen the def­i­n­i­tion write­File”. All input argu­ments are then auto­mat­i­cally given below. Just insert a file name, the curve and the number of points you want to generate. Done! Now, for each design variant that is created either manually or in an auto­mated design study, the file curve.xyz” is written into the correct com­pu­ta­tion direc­tory of the current variant. You as a user don’t have to care about file man­age­ment, CAESES® takes care of it!

customexport_swc

More articles

Latest from the blog

All articles

Stay up to date

Receive latest news to your inbox.

Subscribe to newsletter