I' use a 'problemtype'.mat file as this:
NUMBER: 1 MATERIAL: MatShell
QUESTION: Type#CB#(SHELL,OTHER)
VALUE: SHELL
HELP: field with Identifier pourposes
QUESTION: Thickness
VALUE: 0
HELP: shell thickness
QUESTION: E
VALUE: 0
HELP: Young modulus
END MATERIAL
Whit your 'problemtype'.bas
*loop materials
*if(strcmp(matprop(1),"SHELL")==0)
*format "MAT1%12i%8g"
*matnum()*matprop(3)
*format "MAT1%8g"
*matprop(3)
*endif
*end materials
This is the problem:
All the fields of conditions, materials, etc are stored internally as strings
The format "MAT1%8g" is to print a real number, but matprop(3) is a character string.
You must use matprop(3,real) to force to print as a real number.
Notes:
1) - It is recommended to use the name of a field instead the index number:
matprop(E,real)
instead
matprop(3,real)
If you add or remove fields to the material or condition, the bas file is more easy to update.
2) - It is recommended to use inside the order *format only the format to print the variables, without aditional words:
Example:
*format "%8g"
MAT1*matprop(E,real)
instead
*format "MAT1%8g"
*matprop(E,real)
Regards
Enrique
----- Original Message -----
From: "My VDI Freemail" heim.ruediger at vdi.de
To: "Enrique Escolano" escolano at cimne.upc.es
Sent: Wednesday, June 26, 2002 8:40 AM
Subject: GiD Export Format
Enrique,
Thanks for your response in the mailing list.
With regard to the problem of formatting an output line within GiD, there's a problem with matprop(xx) as the first entity for output.
Please check it from an example such as the following:
*loop materials
*if(strcmp(matprop(1),"SHELL")==0)
*format "MAT1%12i%8g"
*matnum()*matprop(3)
*format"MAT1%8g"
*matprop(3)
*endif
*end materials
While the first line will be exported alright (because the first entity to be exported isn't a matprop entity), the second line comes with an error: the value for the matprop(3) entity will be totally destroyed (e.g. E+127).
Perhaps you can check this.
Thanks.
Ruediger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20020626/0f33e7dc/attachment.htm
[GiDlist] Re: GiD Export Format
Moderator: GiD Team