高手指点,如何得到当前图形中所有的块名.
<P>高手指点,如何得到当前图形中所有的块名.</P><P>看AcdbBlockTable没有得到当前块名的函数.</P> <P>对 当前的块表进行 Iterator 就可以得到了...</P>
<P>void T2()<BR>{<BR> AcDbBlockTable *pBlockTable;<BR> acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable,AcDb::kForRead);<BR> AcDbBlockTableIterator *pIter;<BR> pBlockTable->newIterator(pIter);<BR> AcDbBlockTableRecord *blk;<BR> const char *name;<BR> for(pIter->start();!pIter->done();pIter->step())<BR> {<BR> pIter->getRecord(blk,AcDb::kForRead);<BR> blk->getName(name);<BR> acutPrintf("\n%s",name);<BR> blk->close();<BR> }<BR> delete pIter;<BR> pBlockTable->close();<BR>}</P> <P>struct resbuf *rn;</P>
<P>do {</P>
<P> rb=ads_tblnxet("block",0);</P>
<P> if (rb==NULL) break;</P>
<P> assoc _dxf_str(rb,1,block_name);</P>
<P> ads_printf("\n%s",block_name);</P>
<P>}</P> 谢谢,已经实现,主要是getName这个函数.
页:
[1]