|
[code]在下文中一共展示了AcDbObjectIdArray::length方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的C++代碼示例。
示例1: _extract_vertices_from_lines
▲ 點讚 7 ▼
void frgExtractTopologicalEntsFromLinesAlgm::_extract_vertices_from_lines(std::vector<Vertex2dsOnSegment2d> &seg_pnts_pairs,
const AcDbObjectIdArray &ids)
{
AcDbEntity *entity = NULL;
acedSetStatusBarProgressMeter(_T("正在提取每根線段上的節點..."), 0, ids.length());
for (int i = 0; i < ids.length(); i++)
{
acdbOpenAcDbEntity(entity, ids[i], AcDb::kForRead);
if (entity == NULL)
continue;
if (entity->isA() != AcDbLine::desc())
{
entity->close();
continue;
}
AcDbLine *line = (AcDbLine *)entity;
Vertex2dsOnSegment2d stru;
stru.seg.set(AcGePoint2d(line->startPoint().x, line->startPoint().y),
AcGePoint2d(line->endPoint().x, line->endPoint().y));
entity->close();
_extract_from_seg(stru);
seg_pnts_pairs.push_back(stru);
acedSetStatusBarProgressMeterPos(i);
}
acedRestoreStatusBar();
}
開發者ID:GlacierXie,項目名稱:RLKJ,代碼行數:29,代碼來源:frgExtractTopologicalEntsFromLinesAlgm.cpp
示例2: ssgetAddFilter
▲ 點讚 6 ▼
void OnlyOneSelectFilter::ssgetAddFilter (
int ssgetFlags,
AcEdSelectionSetService& service,
const AcDbObjectIdArray& selectionSet,
const AcDbObjectIdArray& subSelectionSet
)
{
//acutPrintf(_T("\n ssgetAddFilter==> select set: %d"), selectionSet.length());
//acutPrintf(_T("\n ssgetAddFilter==> subselect set: %d\n"), subSelectionSet.length());
//AcEdSSGetFilter::ssgetAddFilter (ssgetFlags, service, selectionSet, subSelectionSet) ;
if( selectionSet.length() == 0 )
{
if( subSelectionSet.length() > 1 )
{
int len = subSelectionSet.length();
for( int i = 0; i < len - 1; i++ )
{
Acad::ErrorStatus es = service.remove( i );
}
}
}
else
{
int len = subSelectionSet.length();
for( int i = 0; i < len; i++ )
{
Acad::ErrorStatus es = service.remove( i );
}
}
}
開發者ID:kanbang,項目名稱:myexercise,代碼行數:31,代碼來源:OnlyOneSelectFilter.cpp
示例3: getAllSymbolRecordsIds
▲ 點讚 4 ▼
int getAllSymbolRecordsIds(AcRxClass* pTableClass, AcDbObjectIdArray & idaAll)
{
CLogger::Print(_T("*Call: getAllSymbolRecordsIds()"));
Acad::ErrorStatus es;
idaAll.setLogicalLength(0);
AcDbDatabase* pDb = acdbHostApplicationServices()->workingDatabase();
AcDbSymbolTable* pSymbolTable = NULL;
if (AcRx::kEqual == pTableClass->comparedTo(AcDbBlockTable::desc())) {
CLogger::Print(_T("> This is BlockTable!"));
es = pDb->getBlockTable(pSymbolTable, AcDb::kForRead);
}
else if (AcRx::kEqual == pTableClass->comparedTo(AcDbLayerTable::desc())) {
CLogger::Print(_T("> This is LayerTable!"));
es = pDb->getLayerTable(pSymbolTable, AcDb::kForRead);
}
else if (AcRx::kEqual == pTableClass->comparedTo(AcDbLinetypeTable::desc())) {
CLogger::Print(_T("> This is LinetypeTable!"));
es = pDb->getLinetypeTable(pSymbolTable, AcDb::kForRead);
}
else if (AcRx::kEqual == pTableClass->comparedTo(AcDbTextStyleTable::desc())) {
CLogger::Print(_T("> This is TextStyleTable!"));
es = pDb->getTextStyleTable(pSymbolTable, AcDb::kForRead);
}
else {
CLogger::Print(_T("*Exit: getAllSymbolRecordsIds() - This kind of SymbolTable is not supported!"));
return -1;
}
if (Acad::eOk != es) {
CLogger::Print(_T("*Exit: getAllSymbolRecordsIds() - Fail to get SymbolTable!"));
return -1;
}
//------------
// Get the SymbolTable's iterator.
AcDbSymbolTableIterator* pSymbolTableIter = NULL;
es = pSymbolTable->newIterator(pSymbolTableIter);
pSymbolTable->close();
if (Acad::eOk != es) {
CLogger::Print(_T("*Exit: getAllSymbolRecordsIds() - Fail to get the SymbolTable's iterator!"));
return -1;
}
//------------
// Steps through the SymbolTable's records.
// Then get the SymbolTableRecord's ObjectID.
for (; !pSymbolTableIter->done(); pSymbolTableIter->step()) {
AcDbObjectId idObj = AcDbObjectId::kNull;
if (Acad::eOk == pSymbolTableIter->getRecordId(idObj))
idaAll.append(idObj);
}
delete pSymbolTableIter;
CLogger::Print(_T("*Exit: getAllSymbolRecordsIds() - Count: %02d"), idaAll.length());
return idaAll.length();
}
開發者ID:vuonganh1993,項目名稱:arxlss,代碼行數:58,代碼來源:LSS08.cpp
示例4: UpdateAllWindStationData
▲ 點讚 1 ▼
void DrawCmd::UpdateAllWindStationData()
{
// 查找所有的測風站
// 將所在宿主上的麵積、風速、風量數據讀取到測風站中
AcDbObjectIdArray objIds;
DrawHelper::FindMineGEs( _T( "WindStation" ), objIds );
if( objIds.isEmpty() ) return;
AcTransaction* pTrans = actrTransactionManager->startTransaction();
if( pTrans == 0 ) return;
AcDbObjectIdArray geObjIds;
int len = objIds.length();
bool ret = true;
for( int i = 0; i < len; i++ )
{
AcDbObject* pObj;
if( Acad::eOk != pTrans->getObject( pObj, objIds[i], AcDb::kForRead ) )
{
ret = false;
break;
}
TagGE* pTag = TagGE::cast( pObj );
if( pTag == 0 )
{
ret = false;
break;
}
geObjIds.append( pTag->getRelatedGE() );
}
actrTransactionManager->endTransaction();
if( !ret )
{
geObjIds.removeAll();
}
else
{
//assert(objIds.length() == geObjIds.length());
int len = objIds.length();
for( int i = 0; i < len; i++ )
{
ReadWriteData( geObjIds[i], _T( "斷麵麵積" ), objIds[i], _T( "測試斷麵麵積" ) );
ReadWriteData( geObjIds[i], _T( "風速" ), objIds[i], _T( "測試風速" ) );
ReadWriteData( geObjIds[i], _T( "風量" ), objIds[i], _T( "測試風量" ) );
}
}
}
開發者ID:kanbang,項目名稱:myexercise,代碼行數:51,代碼來源:AutoTool.cpp
示例5: _extract_from_seg
▲ 點讚 1 ▼
void frgExtractTopologicalEntsFromLinesAlgm::_extract_from_seg(Vertex2dsOnSegment2d &stru)
{
// - 獲取相關的線段(相交、重合)
AcDbObjectIdArray ids;
_search_related_segs(ids, stru.seg);
// - 分為兩類進行處理:相交和重疊
// -- 增加起點和終點
rlVertex2d *v = NULL;
stru.vertex2ds.insert(std::make_pair(0.0, v));
stru.vertex2ds.insert(std::make_pair(1.0, v));
// -- 處理每一個線段
AcDbEntity *entity = NULL;
for (int i = 0; i < ids.length(); i++)
{
acdbOpenAcDbEntity(entity, ids[i], AcDb::kForRead);
if (entity == NULL)
continue;
if (entity->isA() != AcDbLine::desc())
{
entity->close();
continue;
}
AcDbLine *_line = (AcDbLine *)entity;
AcGeLineSeg2d _seg(AcGePoint2d(_line->startPoint().x, _line->startPoint().y),
AcGePoint2d(_line->endPoint().x, _line->endPoint().y));
_line->close();
_extract_vertices(stru, _seg);
}
}[/code] |
|