本文整理汇总了C++中AcDbObjectIdArray类的典型用法代码示例。如果您正苦于以下问题:C++ AcDbObjectIdArray类的具体用法?C++ AcDbObjectIdArray怎么用?C++ AcDbObjectIdArray使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AcDbObjectIdArray类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
ArxDbgAppEditorReactor::searchOneDictionary(AcDbDictionary* dict, AcDbObjectIdArray& objIds)
{
// get an iterator over this dictionary
AcDbDictionaryIterator* dictIter = dict->newIterator();
ASSERT(dictIter != NULL);
// walk dictionary and just collect all the entries that are of the
// given type
AcDbObject* obj;
for (; !dictIter->done(); dictIter->next()) {
if (acdbOpenAcDbObject(obj, dictIter->objectId(), AcDb::kForRead) == Acad::eOk) {
if (obj->isKindOf(ArxDbgDbDictRecord::desc())) {
objIds.append(obj->objectId());
}
else if (obj->isKindOf(AcDbDictionary::desc())) {
searchOneDictionary(AcDbDictionary::cast(obj), objIds);
}
obj->close();
}
}
delete dictIter;
dict->close();
}
示例2: acutPrintf
void DrawCmd::DrawChimney( void )
{
acutPrintf( _T( "\n绘制风筒测试..." ) );
AcDbObjectId objId = ArxUtilHelper::SelectObject( _T( "请选择一个掘进工作面:" ) );
if( objId.isNull() ) return;
if( !ArxUtilHelper::IsEqualType( _T( "TTunnel" ), objId ) ) return;
AcDbObjectIdArray objIds;
DrawHelper::GetTagGEById2( objId, _T( "Chimney" ), objIds );
if( !objIds.isEmpty() )
{
AfxMessageBox( _T( "该掘进工作面已设置了风筒!" ) );
return;
}
AcGePoint3dArray pts;
PolyLineJig jig;
if( !jig.doJig( pts ) ) return;
int len = pts.length();
acutPrintf( _T( "\n点个数:%d" ), len );
if( len < 2 ) return;
Chimney* pChimney = new Chimney();
pChimney->setRelatedGE( objId ); // 关联的图元必须是掘进工作面
for( int i = 0; i < len; i++ ) pChimney->addControlPoint( pts[i] );
// 初始化并提交到数据库
if( !ArxUtilHelper::PostToModelSpace( pChimney ) ) delete pChimney;
}
示例3: _T
void DrawCmd::DrawLocalFan()
{
AcDbObjectId objId = ArxUtilHelper::SelectObject( _T( "请选择一个掘进工作面:" ) );
if( objId.isNull() ) return;
if( !ArxUtilHelper::IsEqualType( _T( "TTunnel" ), objId ) ) return;
AcDbObjectIdArray objIds;
DrawHelper::GetTagGEById2( objId, _T( "LocalFan" ), objIds );
if( !objIds.isEmpty() )
{
AfxMessageBox( _T( "该掘进工作面已设置了局部通风机!" ) );
return;
}
AcGePoint3d pt;
if( !ArxUtilHelper::PromptPt( _T( "\n请指定局扇的插入点坐标:" ), pt ) ) return;
Fan* pFan = new LocalFan( pt, 0 ); // 目前假设局扇的角度为0(实际绘图中局扇是没有方向的)
if( pFan == 0 ) return;
pFan->setRelatedGE( objId ); // 关联巷道
// 初始化并提交到数据库
if( !ArxUtilHelper::PostToModelSpace( pFan ) ) delete pFan;
}
示例4: MfcArxsyj_mfc
// - MfcArx.syj_mfc command (do not rename)
static void MfcArxsyj_mfc(void)
{
// Add your code for command MfcArx.syj_mfc here
ads_name ss;
resbuf rb;
AcDbObjectIdArray objIds = NULL;
acedSSGet(NULL,NULL,NULL,NULL,ss);
long len;
//取得选择集的长度
acedSSLength(ss,&len);
//遍历选择集中的实体,将其打开并修改其颜色为红色
for (int i =0;i<len;i++)
{
ads_name entres;
AcDbObjectId objId;
//取得选择集中实体的名称ads_name
acedSSName(ss,i,entres);
//取得实体的ObjectId
acdbGetObjectId(objId,entres);
objIds.append(objId);
}
acedSSFree(ss);
CDetailShow ds(objIds,NULL,NULL);
ds.DoModal();
}
示例5: SelectEntities
bool ArxEntityHelper::SelectEntities( const AcDbObjectIdArray& objIds )
{
//acedSSSetFirst(NULL, NULL);
if( objIds.isEmpty() ) return false;
ads_name ss;
//创建一个空的选择集
if(RTNORM != acedSSAdd( NULL, NULL, ss )) return false;
bool ret = true;
for(int i=0;i<objIds.length();i++)
{
ads_name ename;
if( Acad::eOk != acdbGetAdsName( ename, objIds[i] ) )
{
ret = false;;
break;
}
if( RTNORM != acedSSAdd( ename, ss, ss ) ) // 添加到选择集
{
ret = false;;
break;
}
}
if(ret)
{
acedSSSetFirst( ss, NULL ); // 高亮选中
}
acedSSFree( ss ); // 释放选择集
return ret;
}
示例6: _extract_vertices_from_lines
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();
}
示例7: SwitchDraw
void DrawHelper::SwitchDraw( const CString& geType, const CString& drawName )
{
// 设置当前可视化效果
if( !SetCurDraw( geType, drawName ) ) return;
// 更新所有指定类型的图元
AcDbObjectIdArray objIds;
ArxDataTool::GetEntsByType( geType, objIds, false );
if( objIds.isEmpty() ) return; // dwg图形中没有任何MineGE类型图元
// 将所有geType类型图元的绘制效果更新
AcTransaction* pTrans = actrTransactionManager->startTransaction();
if( pTrans == 0 ) return;
int len = objIds.length();
for( int i = 0; i < len; i++ )
{
AcDbObject* pObj;
if( Acad::eOk != pTrans->getObject( pObj, objIds.at( i ), AcDb::kForWrite ) ) continue;
MineGE* pGE = MineGE::cast( pObj );
if( pGE == 0 ) continue;
pGE->updateDraw(); // 更细可视化效果指针
//pGE->recordGraphicsModified(true); // 更新图形
}
actrTransactionManager->endTransaction();
AcRxClass* pClass = AcRxClass::cast( acrxClassDictionary->at( geType ) );
if( pClass != 0 && pClass->isDerivedFrom( LinkedGE::desc() ) )
{
UpdateLinkedGE( objIds );
}
}
示例8: _extract_from_seg
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);
}
}
示例9: ssgetAddFilter
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 );
}
}
}
示例10:
void
ArxDbgUiTdcObjReactorsBase::OnObjAttach()
{
CString newHandle, str;
AcDbObjectId objId;
// see if specified handle is valid
m_ebHandle.GetWindowText(newHandle);
if (ArxDbgUtils::handleStrToObjId(acdbHostApplicationServices()->workingDatabase(),
newHandle, objId, false) != Acad::eOk) {
str.Format(_T("\"%s\" is not a valid handle."), newHandle);
ArxDbgUtils::alertBox(str);
m_ebHandle.SetSel(0, -1); // reset to select all
m_ebHandle.SetFocus();
return;
}
AcDbObjectIdArray newObjIds;
newObjIds.append(objId);
attachObjReactors(newObjIds);
m_ebHandle.SetWindowText(_T("")); // reset edit box to be empty for new handle
displayObjList();
}
示例11: caclStartPoint
AcDbObjectId DoubleLine::draw()
{
//计算始端的2个坐标
AcGePoint3d m_leftStartPt, m_leftEndPt;
AcGePoint3d m_rightStartPt, m_rightEndPt;
caclStartPoint( m_leftStartPt, m_rightStartPt );
//计算末端的2个坐标
caclEndPoint( m_leftEndPt, m_rightEndPt );
//绘制2条直线
AcDbObjectId line1 = ArxDrawHelper::DrawLine( m_leftStartPt, m_leftEndPt );
AcDbObjectId line2 = ArxDrawHelper::DrawLine( m_rightStartPt, m_rightEndPt );
//构造group
AcDbObjectIdArray objIds;
objIds.append( line1 );
objIds.append( line2 );
//构造临时的组名
CString name;
name.Format( _T( "巷道%d" ), count++ );
AcDbObjectId groupId = ArxGroupHelper::CreateGroup( name, objIds );
if( !groupId.isNull() )
{
ArxGroupHelper::ConvertToAnonymousGroup( groupId );
}
return groupId;
}
示例12: GetDataObjectFromExtDict
// 从图元的扩展词典中查找数据对象
static void GetDataObjectFromExtDict( AcDbObjectIdArray& dbObjIds )
{
AcDbObjectIdArray allObjIds;
ArxDataTool::GetEntsByType( _T( "MineGE" ), allObjIds, true );
// 判断是否数据对象DataObject
// 且类型名称==type
if( allObjIds.isEmpty() ) return;
AcTransaction* pTrans = actrTransactionManager->startTransaction();
if( pTrans == 0 ) return;
int len = allObjIds.length();
for( int i = 0; i < len; i++ )
{
AcDbObject* pObj;
if( Acad::eOk != pTrans->getObject( pObj, allObjIds[i], AcDb::kForRead ) ) continue;
MineGE* pGE = MineGE::cast( pObj );
if( pGE == 0 ) continue;
AcDbObjectId dbObjId = pGE->getDataObject();
if( !dbObjId.isNull() )
{
dbObjIds.append( dbObjId );
}
}
actrTransactionManager->endTransaction();
}
示例13: YCROYCRO_CG_AddRegion
static void YCROYCRO_CG_AddRegion()
{
ads_name ss;
int rt = acedSSGet(NULL, NULL, NULL, NULL, ss);
AcDbObjectIdArray objIds;
if (rt == RTNORM)
{
long length;
acedSSLength(ss, &length);
for (int i = 0; i < length; i++)
{
ads_name ent;
acedSSName(ss, i, ent);
AcDbObjectId objId;
acdbGetObjectId(objId, ent);
objIds.append(objId);
}
}
acedSSFree(ss);
AcDbObjectIdArray regionIds;
regionIds = CCreateEnt::CreateRegion(objIds);
int number = regionIds.length();
if (number > 0)
{
acutPrintf(_T("\n已经创建%d个面域!"), number);
}
else
{
acutPrintf(_T("\n创建0个面域!"));
}
}
示例14: getPersistentEntReactor
void
ArxDbgUiTdcPersistentReactors::getAttachedEntities(AcDbObjectIdArray& objIds)
{
AcDbVoidPtrArray dbPtrs;
ArxDbgUtils::getAllDatabases(dbPtrs);
AcDbObjectId prId;
ArxDbgPersistentEntReactor* peReactor;
Acad::ErrorStatus es;
AcDbObjectIdArray tmpIds;
int len = dbPtrs.length();
for (int i=0; i<len; i++) {
prId = getPersistentEntReactor(static_cast<AcDbDatabase*>(dbPtrs[i]), false);
es = acdbOpenObject(peReactor, prId, AcDb::kForRead);
if (es == Acad::eOk) {
tmpIds.setLogicalLength(0); // reusing array for each database
peReactor->getAttachedToObjs(tmpIds);
peReactor->close();
objIds.append(tmpIds);
}
}
}
示例15: ConfigDraw
void DrawHelper::ConfigDraw( const CString& geType, const CString& drawName )
{
MineGEDraw* pDraw = MineGEDrawSystem::GetInstance()->getGEDraw( geType, drawName );
if( pDraw == 0 ) return; // 该绘制效果不存在
pDraw->configExtraParams(); // 配置附加参数
AcDbObjectIdArray objIds;
ArxDataTool::GetEntsByType( geType, objIds, false );
if( objIds.isEmpty() ) return; // dwg图形中没有任何geType类型图元
AcTransaction* pTrans = actrTransactionManager->startTransaction();
if( pTrans == 0 ) return;
int len = objIds.length();
for( int i = 0; i < len; i++ )
{
AcDbObject* pObj;
if( Acad::eOk != pTrans->getObject( pObj, objIds.at( i ), AcDb::kForWrite ) ) continue;
MineGE* pGE = MineGE::cast( pObj );
if( pGE == 0 ) continue;
pGE->configDraw( pDraw->isA()->name() ); // 更新extra param
pGE->recordGraphicsModified( true ); // 更新图形
}
actrTransactionManager->endTransaction();
AcRxClass* pClass = AcRxClass::cast( acrxClassDictionary->at( geType ) );
if( pClass != 0 && pClass->isDerivedFrom( LinkedGE::desc() ) )
{
UpdateLinkedGE( objIds );
}
}