www.mxdraw.com
内容索引主面
前一个向上下一个
McDbDictionary 类

数据库中的字典类,用户的自定义数据可以存放在字典中,它可以理解一个映射表,字符串是关键字,可以映射到任何一个对象。字典中可以再包含字典

C++
class McDbDictionary : public McDbObject;

McDbDictionary.h

例如:输出字典中的所有数据

    void CTestCommands::PrintDictionary(AcDbDictionary* pDict)
    {
        AcDbDictionaryIterator* pIter = pDict->newIterator();
        if(pIter == NULL)
            return;

        for(;!pIter->done();pIter->next())
        {
            AcDbObject* pObj = NULL;
            if(pIter->getObject(pObj,AcDb::kForRead) == Acad::eOk)
            {
                AcDbDictionary* pTemDict    = AcDbDictionary::cast(pObj);
                AcDbXrecord*    pTemXrecord = AcDbXrecord::cast(pObj);
                if(pTemDict != NULL)
                {
                    PrintDictionary(pTemDict);
                }
                else if(pTemXrecord != NULL)
                {
                    struct resbuf *pRbList;
                    pTemXrecord->rbChain(&pRbList);
                    printResbufChain(pRbList);
                    acutRelRb(pRbList);
                }
                pObj->close();
            }
        }
        delete pIter;
    }
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!