In the bas file, the material number is not the same as defined in the .mat file, the materials are automatically
renumbered to avoid holes, from 1 to the number of really used materials.
If you desire to identify the material, you can use *Matprop(0) (inside a material loop) to obtain the material name.
*loop elems
*ElemsNum *ElemsMat *ElemsConec
*end elems
*loop materials
Number=*MatNum Name=*Matprop(0)
*end materials
You can also solve creating a field, named for example Number, for the materials, and storing the same value as the order in the mat file.
(this auxiliary field can be hidden.)
…
NUMBER: 5 MATERIAL: Steel_Top_Flange
QUESTION: NUMBER
VALUE: 5
STATE:HIDDEN
QUESTION: Elastic_modulus
VALUE: 20500
END MATERIAL
…
Your previous solution only work if only is assigned only one material to the model, inside each loop over materials are written all elements
instead:
*loop materials
*set var MaterialNum(int)=Operation(MatProp(Number,int))
*loop elems
*ElemsNum 1 29650 *MaterialNum *ElemsConec
*end elems
*end materials
use:
*loop materials
*loop elems
*if(MatNum==ElemsMat)
*ElemsNum 1 29650 *MatProp(Number,int) *ElemsConec
*end elems
*endif
*end materials
Regars
Enrique Escolano
----- Original Message -----
From: “Mark Smith” mark.smith at linx.co.uk
To: “Gidlist (E-mail)” gidlist at gatxan.cimne.upc.es
Sent: Wednesday, July 24, 2002 5:34 PM
Subject: RE: [GiDlist] bas file problem
Hi GiD team
Although I found a work around I love to know how I could (if possible) in
a .bas file
do the equivalent of files : import/export: write mesh
In this mesh file the number of the material written is the number of the
material in the .mat file ?
Regards
Mark
-----Original Message-----
From: Mark Smith
Sent: 23 July 2002 15:39
To: ‘gidlist at gatxan.cimne.upc.es’
Subject: RE: [GiDlist] bas file problem
Found a solution, my mistake was misusing *ElemsMat
Solved the problem by changing my material file and the following in my bas
file
*loop materials
*set var MaterialNum(int)=Operation(MatProp(Number,int))
*loop elems
*ElemsNum 1 29650 *MaterialNum *ElemsConec
*end elems
*end materials
Regards
mark
-----Original Message-----
From: Mark Smith [mailto:mark.smith at linx.co.uk]
Sent: 23 July 2002 12:44
To: Gidlist (E-mail)
Subject: [GiDlist] bas file problem
win98 GiD6.3.0b
Dear GiD team,
I am having a problem writing out a mesh data file in my required format.
the following few lines from my .bas file are giving me problems:
*loop elems
*ElemsNum 1 29650 *ElemsMat *ElemsConec
*end elems
no mater what material I asign to my volume before meshing (linear tets),
the output file always shows the value 1 as the elements material.
If I do a write mesh then the output file shows the correct material number?
Whats going on?
Regards
Mark
--------------------------------------------------------------------------
Linx Printing Technologies plc
+44 (0)1480302100
_http://www.linx.co.uk/_
This e-mail may contain privileged/confidential information and may be
read, copied and used only by the intended recipient. If you have received
it in error, please contact the sender by return e-mail or by
telephoning +44 (0)1480 302100.
Please then delete the e-mail and do not disclose its contents to any
person.
Any information in this message that does not relate to the official
business of Linx shall be understood as neither given nor endorsed by Linx.
We reserve the right to monitor all e-mail communications through our
internal and external networks.
--------------------------------------------------------------------------
\
GiDlist mailing list
GiDlist at gid.cimne.upc.es
_http://gid.cimne.upc.es/mailman/listinfo/gidlist_
-------------- next part --------------
An HTML attachment was scrubbed…
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20020724/f22cad8b/attachment.htm