Help:Contents
Hello Team,
I got problem retrieving the material name for solid model in BricsCAD after rendering the material to the solid body. If i attach same material to the whole solid (by drag and drop) i m able to get the material name, if i attach the different materials different faces to m not able to retrieve the material names.
please find the code which i using to retrieve the material names.
OdDb3dSolidPtr pBody = OdDb3dSolid::cast(objId.openObject()); OdBrBrep brepObj; pBody->brep(brepObj);
OdDbObjectId objMat = pBody->materialId();
OdString str = pBody->material(); // Here ma able to get the material attached whole solid body.
OdBrBrepFaceTraverser FaceTr; int iFace = 0; for (FaceTr.setBrep(brepObj);!FaceTr.done();FaceTr.next()) { OdBrFaceLoopTraverser faLoTrav; OdBrFace face = FaceTr.getFace();
bool bStatus = false;
OdUInt64 nMaterialId = 0;
OdString strMaterialName = "";
if(face.getMaterialID(nMaterialId)) // True,able to fetch the material id. { bStatus = true; }
if(face.getMaterialString(strMaterialName)) // This function returns false. supposed to give me the value (Name of the material). { bStatus = true; }
}