Format in template

Beta
Beta New Altair Community Member
edited October 2020 in Community Q&A

Hi,

 

I want to create a macro with template inside to process a large number of entities.

My output format is similar to the picture below.

I know that it is possible to use field() command to write data to ASCII file.

However, I don't know how to write it in the same format in the picture with negative, positive number and exactly 6 number after comma.

Could anyone help me with this, Thanks

<?xml version="1.0" encoding="UTF-8"?>Capture.GIF

Answers

  • Q.Nguyen-Dai
    Q.Nguyen-Dai Altair Community Member
    edited September 2017

    I don't know how to control exactly 6 number after comma within a output template yet.

    But if this's your indispensable requirement, you can write directly in TCL script.

    How about 'large number of entities'? 100k? 1000k? 10000k?

  • tinh
    tinh Altair Community Member
    edited September 2017

    Yes, to control format of data you should use tcl

    example set fx [format %10.6f $x]

     

    for template, you can use *realprecision(6) to control 6digits after dot of reals, and to print them out even if they are zero, using *compressreal(0)

  • Beta
    Beta New Altair Community Member
    edited September 2017

    Thank you, that's really helpful

     

    @tinh