bool isModuleLoaded(const char* str) { AcDbVoidPtrArray* pApps = reinterpret_cast<AcDbVoidPtrArray*>(acrxLoadedApps()); if (pApps==NULL) return false; bool bFound = false; for (int i=0;i<pApps->length();i++) { if (stricmp(reinterpret_cast<const char*>(pApps->at(i)),str)==0) { bFound = true; break; } } for (;pApps->length()>0;) { delete reinterpret_cast<char*>(pApps->at(0)); pApps->removeAt(0); } delete pApps; return bFound; }
AcDbObjectId CArxHelper::CreateBlock(const AcDbVoidPtrArray& arrEnt, const CString& strName) { AcDbObjectId blockId = AcDbObjectId::kNull; AcDbBlockTableRecord* pBlockTableRecord = new AcDbBlockTableRecord(); pBlockTableRecord->setName(strName); pBlockTableRecord->setOrigin(AcGePoint3d::kOrigin); for (int i = 0; i < arrEnt.length(); ++ i) { AcDbEntity* pEntity = (AcDbEntity*)arrEnt.at(i); pBlockTableRecord->appendAcDbEntity(pEntity); pEntity->close(); } AcDbBlockTable* pBlockTable = NULL; acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable, AcDb::kForWrite); pBlockTable->add(blockId,pBlockTableRecord); pBlockTableRecord->close(); pBlockTable->close(); return blockId; }
BOOL ArxDbgUiTdcCmds::OnInitDialog() { ArxDbgUiTdcRxObjectBase::OnInitDialog(); buildCmdGroupMap(); POSITION pos; CString str; AcDbVoidPtrArray* cmds = NULL; HTREEITEM treeItem; AcEdCommand* tmpCmd; bool isFirst = true; for (pos = m_cmdMap.GetStartPosition(); pos != NULL;) { m_cmdMap.GetNextAssoc(pos, str, (void*&)cmds); treeItem = addCmdTreeItem(str, NULL, TVI_ROOT, true); if (treeItem != NULL) { int len = cmds->length(); for (int i=0; i<len; i++) { tmpCmd = static_cast<AcEdCommand*>(cmds->at(i)); addCmdTreeItem(tmpCmd->localName(), tmpCmd, treeItem, true); } if (isFirst) { m_cmdTree.SelectItem(treeItem); // make first one selected isFirst = false; } } } buildColumns(m_dataList); displayCurrent(); return TRUE; }