Page 1 of 1

Export material name in .mat file into .dat file

Posted: Fri Nov 20, 2015 6:18 am
by Hemmi
Let me know how to export the material name defined in .mat materials file into .dat file.

For example, if the material is given in .mat file like
  • NUMBER: 2 MATERIAL: Concrete
    QUESTION: E
    VALUE: 3.0e5
    QUESTION: NU
    VALUE: 0.2
    END MATERIAL
I want to export the string "Concrete" into my .dat file.
Let me know the command used in the .bas file.

HEMMI, Shigeru
http://petamagnetic.appspot.com

Re: Export material name in .mat file into .dat file

Posted: Fri Nov 20, 2015 1:14 pm
by escolano
*MatProp(0) return the material name at .bas level

It is explained in the "GiD Customization Manual":
*MatProp. This is the same as the previous command except that it must be within a loop over the materials (see *loop). It returns the property whose field number or name is defined by its argument. It is recommended to use names instead of field numbers.
If the argument is 0, it returns the material's name.
e.g.

Code: Select all

*loop materials
  name=*matprop(0) E=*matprop(E) NU=*matprop(NU)
*end materials

Re: Export material name in .mat file into .dat file

Posted: Fri Nov 20, 2015 3:13 pm
by Hemmi
Dear Escolano,

Thank you very much; it helped me.

Best regards,