Name of the material from the MaterialFile, read from the part physical properties.
Material(is3dpart)=?GetObject("iface.calcnameservice").start(0).Format("<CLASSPROP( cns,CNSPHYPROP,CNSMAT ) > ").value()
Check if "*CATMATERIAL_FILE"("MaterialFile") exists. If it does not exists, exit from ApplyMaterial without message.
Get the value for mass: Search "cns"->"CNSPHYPROP"->"CNSMASSEXACT". If not found search in "cns"->"CNSGEOMBASE"->"CNS_MASSEXACT001"
If mass is zero or is not defined, the value for density is read from ps3, else compute the density of the Material: density = mass / volume.
Search the name of Material from - "cns"->"CNSPHYPROP"->"CNSMAT" or from Mident of the Part ("A_MAT") or from *CATMATERIAL_STD_NAME flag (in the specified CATMaterial File)
If the Material has been found in CATMATERIAL_FILE, set for it the computed density.
-> The Material is displayed in the tree.
On this also compare the following keys:
CATMaterial File: Name of CATMaterial File, which is used for created parts. If the metafile contains material information, the material name is searched for in the specified CATMaterial file and, if found, it is assigned.
[CreationOptions] MaterialFile(is3dpart)=MaterialFile.CATMaterial
[CreationOptions] MaterialFile(is3dpart)=?Aplication.ResolveEnv("K:\\DS\\B18\\win_b64\\startup\\materials
\\Catalog.CATMaterial")
Applies the material on either the part, the body, both, or none.