<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.opendesign.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.opendesign.com/index.php?action=history&amp;feed=atom&amp;title=Help%3AContents</id>
		<title>Help:Contents - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.opendesign.com/index.php?action=history&amp;feed=atom&amp;title=Help%3AContents"/>
		<link rel="alternate" type="text/html" href="https://wiki.opendesign.com/index.php?title=Help:Contents&amp;action=history"/>
		<updated>2026-06-10T21:05:49Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://wiki.opendesign.com/index.php?title=Help:Contents&amp;diff=3358&amp;oldid=prev</id>
		<title>Shriram@thedesignsense.com: How to retrieve the material name in BricsCAD using Teigha</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendesign.com/index.php?title=Help:Contents&amp;diff=3358&amp;oldid=prev"/>
				<updated>2015-09-28T11:20:55Z</updated>
		
		<summary type="html">&lt;p&gt;How to retrieve the material name in BricsCAD using Teigha&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Hello Team,&lt;br /&gt;
&lt;br /&gt;
I got problem retrieving the material name for solid model in BricsCAD after rendering the material to the solid body.&lt;br /&gt;
If i attach same material to the whole solid (by drag and drop) i m able to get the material name,&lt;br /&gt;
if i attach the different materials different faces to m not able to retrieve the material names.&lt;br /&gt;
&lt;br /&gt;
please find the code which i using to retrieve the material names.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  OdDb3dSolidPtr pBody = OdDb3dSolid::cast(objId.openObject());&lt;br /&gt;
 &lt;br /&gt;
       OdBrBrep brepObj;&lt;br /&gt;
       pBody-&amp;gt;brep(brepObj);&lt;br /&gt;
		&lt;br /&gt;
      OdDbObjectId objMat = pBody-&amp;gt;materialId();&lt;br /&gt;
&lt;br /&gt;
      OdString str = pBody-&amp;gt;material(); // Here ma able to get the material attached whole solid body.&lt;br /&gt;
		&lt;br /&gt;
      OdBrBrepFaceTraverser FaceTr; &lt;br /&gt;
      int iFace  = 0;&lt;br /&gt;
      for (FaceTr.setBrep(brepObj);!FaceTr.done();FaceTr.next()) &lt;br /&gt;
      {&lt;br /&gt;
            OdBrFaceLoopTraverser faLoTrav;&lt;br /&gt;
            OdBrFace face = FaceTr.getFace();&lt;br /&gt;
				&lt;br /&gt;
				&lt;br /&gt;
		bool bStatus = false;&lt;br /&gt;
		OdUInt64 nMaterialId = 0;&lt;br /&gt;
		OdString strMaterialName = &amp;quot;&amp;quot;;&lt;br /&gt;
				&lt;br /&gt;
		if(face.getMaterialID(nMaterialId)) // True,able to fetch the material id.&lt;br /&gt;
		{&lt;br /&gt;
		    bStatus = true;&lt;br /&gt;
		}&lt;br /&gt;
				&lt;br /&gt;
	     	if(face.getMaterialString(strMaterialName)) // This function returns false. supposed to give me the value (Name of the material).&lt;br /&gt;
		{&lt;br /&gt;
			bStatus = true;&lt;br /&gt;
		}&lt;br /&gt;
      }&lt;/div&gt;</summary>
		<author><name>Shriram@thedesignsense.com</name></author>	</entry>

	</feed>