急急急。。。大家帮帮忙图层问题的
<p>我想用迭代器历遍整个图层。。。然后想用名字判断自己想要的那个图层。。。把它提出来。。。</p><p></p><p>我不懂怎么判断。。。源码附上</p><p></p><p></p><p>大家帮帮</p><p></p><p> AcDbLayerTable *pLayerTbl;<br/> acdbHostApplicationServices()->workingDatabase()<br/> ->getSymbolTable(pLayerTbl, AcDb::kForWrite);<br/> AcDbLayerTableIterator *iter;<br/> pLayerTbl->newIterator(iter);</p><p> AcDbLayerTableRecord *ltr;<br/> <br/> char *ltrname;<br/> // char *ltrnam;<br/> <br/> char *a="ASDK_TESTLAYER";<br/> for(iter->start();!iter->done();iter->step())<br/> {</p><p> iter->getRecord(ltr,AcDb::kForRead);<br/> ltr->getName(ltrname);<br/> // ltrnam=ltrname;<br/> if(a =ltrname)<br/> {<br/> acutPrintf("\n我成功了%s ",ltrname);<br/> a=ltrname;<br/> acutPrintf("图层不存在 "); <br/> ltr->close();<br/> free(ltrname);<br/> <br/> }<br/> else<br/> {<br/> acutPrintf("图层不存在 ");<br/> }<br/> <br/> <br/> }<br/> delete iter;<br/> pLayerTbl->close();</p> <p>程序没错,就是这样判断的</p> <p>AcDbLayerTable *pLayerTbl;<br/> acdbHostApplicationServices()->workingDatabase()<br/> ->getSymbolTable(pLayerTbl, AcDb::kForWrite);</p><p> AcDbLayerTableRecord *ltr;<br/> Acad::ErrorStatus es;<br/> ACHAR *ltrname;<br/> if ((es=pLayerTbl->getAt(_T("ASDK_TESTLAYER"),ltr,AcDb::kForRead))==Acad::eOk)<br/> {<br/> ltr->getName(ltrname);<br/> acutPrintf(_T("\n我成功了%s "),ltrname);</p><p> ltr->close();<br/> }<br/> else<br/> acutPrintf(_T("图层不存在 "));</p><p> pLayerTbl->close();</p> <p>谢谢楼上大朋友</p>
页:
[1]