本文整理汇总了C++中AcDbObjectId::isNull方法的典型用法代码示例。如果您正苦于以下问题:C++ AcDbObjectId::isNull方法的具体用法?C++ AcDbObjectId::isNull怎么用?C++ AcDbObjectId::isNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcDbObjectId
的用法示例。
在下文中一共展示了AcDbObjectId::isNull方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawWindLibrary
void DrawCmd::DrawWindLibrary( void )
{
AcDbObjectId objId = ArxUtilHelper::SelectObject( _T( "请选择一条巷道:" ) );
if( objId.isNull() ) return;
if( !ArxUtilHelper::IsEqualType( _T( "LinkedGE" ), objId ) ) return;
AcGePoint3d pt,insertPt;
double angle;
if( !ArxUtilHelper::PromptPt( _T( "\n请指定风库的插入点坐标:" ), pt ) ) return;
if( !GetClosePtAndAngle( objId, pt, angle ) ) return;
AcGeVector3d v = AcGeVector3d(AcGeVector3d::kXAxis);
v.rotateBy(angle - PI/2,AcGeVector3d::kZAxis);
v.normalize();
insertPt = pt + v * 60;
WindLibrary* pWindLib = new WindLibrary( insertPt, angle );
if( pWindLib == 0 ) return;
pWindLib->setRelatedGE( objId ); // 关联巷道
// 初始化并提交到数据库
if( !ArxUtilHelper::PostToModelSpace( pWindLib ) ) delete pWindLib;
}
示例2: 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();
}
示例3: DrawChimney
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;
}
示例4: CheackTubeLenth
static bool CheackTubeLenth(AcDbObjectId& objId)
{
objId = ArxUtilHelper::SelectObject( _T( "请选择一条瓦斯管路:" ) );
if( objId.isNull() ) return false;
if( !ArxUtilHelper::IsEqualType( _T( "GasTube" ), objId ) ) return false;
AcTransaction *pTrans = actrTransactionManager->startTransaction();
if ( 0 == pTrans ) return false;
AcDbObject *pObj;
if (Acad::eOk != pTrans->getObject(pObj,objId,AcDb::kForRead)) return false;
GasTube *pGasTube = GasTube::cast(pObj);
if ( 0 == pGasTube)
{
actrTransactionManager->abortTransaction();
return false;
}
AcGePoint3d spt,ept;
pGasTube->getSEPoint(spt,ept);
//double angle = pGasTube->getAngle();
actrTransactionManager->endTransaction();
AcGeVector3d v = ept - spt;
double tubeLenth = v.length();
return true;
}
示例5: DrawMText
void DrawMText( AcGiWorldDraw* mode, const AcGePoint3d& pt, double angle, const CString& str, double height, AcDbMText::AttachmentPoint ap, const CString& style )
{
//acutPrintf(_T("\n绘制前--文字颜色:%d"), mode->subEntityTraits().color());
AcDbMText mt;
// //AcDbObjectId style; // 文字样式
AcDbObjectId fontId = GetTextStyle(style);
if(!fontId.isNull())
{
acutPrintf(_T("\n设置样式为罗马字体"));
mt.setTextStyle(fontId);
}
mt.setLocation( pt );
mt.setTextHeight( height );
mt.setAttachment( ap );
mt.setRotation( angle );
mt.setContents( str );
// 经过测试发现,AcDbMText调用worldDraw的同时会修改mode的一些属性
mt.setColorIndex( mode->subEntityTraits().color() );
mt.worldDraw( mode );
//acutPrintf(_T("\n绘制后--文字颜色:%d"), mode->subEntityTraits().color());
}
示例6: SetEdgeType
// 设置独立用风分支
// 独立用风地点:采掘工作面、采区变电所
static bool SetEdgeType( const AcDbObjectId& objId, EdgeData* pEdgeData )
{
bool ret = true;
if( objId.isNull() )
{
pEdgeData->et = ET_VIRTUAL;
}
else if( ArxUtilHelper::IsEqualType( _T( "WorkSurface" ), objId ) )
{
pEdgeData->et = ET_USEAIR; // 工作面
}
else if( ArxUtilHelper::IsEqualType( _T( "StorageGE" ), objId ) )
{
if( !ArxUtilHelper::IsEqualType( _T( "MachineRoom" ), objId ) )
{
pEdgeData->et = ET_USEAIR; // 火药库或充电室
}
else if( IsPowerSubstation( objId ) )
{
pEdgeData->et = ET_USEAIR; // 机电硐室--变电所(用风地点)
}
}
else if( ArxUtilHelper::IsEqualType( _T( "TTunnel" ), objId ) )
{
pEdgeData->et = ET_USEAIR; // 掘进工作面
}
/*else if(IsNeedAir(objId))
{
pEdgeData->et = ET_USEAIR;
}*/
return ret;
}
示例7: OnBnClickedAirSelBtn
void WindStationDockBarChildDlg::OnBnClickedAirSelBtn()
{
// 拾取按钮
//BeginEditorCommand();
AcDbObjectId objId = ArxUtilHelper::SelectObject( _T( "请选择一条巷道: " ) );
//CompleteEditorCommand();
if( !objId.isNull() )
{
//MessageBox(_T("拾取成功"));
int pos = m_objIds.find( objId );
if( pos != -1 )
{
//滚动条自动滚动该行,并选中
m_list.EnsureVisible( pos, FALSE );
m_list.SetItemState( pos, LVIS_SELECTED, LVIS_SELECTED );
// 取消选中
//m_list.SetItemState(pos, NULL, NULL);
}
}
else
{
MessageBox( _T( "拾取失败" ) );
}
}
示例8: DrawJoint
void DrawCmd::DrawJoint()
{
AcDbObjectId objId = ArxUtilHelper::SelectObject( _T( "请选择一条巷道、或掘进工作面:" ) );
if( objId.isNull() ) return;
if( !ArxUtilHelper::IsEqualType( _T( "LinkedGE" ), objId ) ) return;
AcTransaction* pTrans = actrTransactionManager->startTransaction();
if( pTrans == 0 ) return;
AcDbObject* pObj;
if( Acad::eOk != pTrans->getObject( pObj, objId, AcDb::kForWrite ) )
{
actrTransactionManager->abortTransaction();
return;
}
LinkedGE* pEdge = LinkedGE::cast( pObj );
if( pEdge == 0 )
{
actrTransactionManager->abortTransaction();
return;
}
actrTransactionManager->endTransaction();
AcGePoint3d spt,ept;
pEdge->getSEPoint(spt,ept);
AcGePoint3d pt;
if( !PromptInsertPt( objId, pt ) ) return;
double angle;
if( !GetClosePtAndAngle( objId, pt, angle ) ) return;
SplitByPoint(objId,spt,ept,pt);
CreatJoint( objId, pt, angle );
}
示例9: DrawLocalFan
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;
}
示例10: while
Acad::ErrorStatus
ArxDbgPersistentObjReactor::dxfInFields(AcDbDxfFiler* filer)
{
Acad::ErrorStatus es;
if (((es = AcDbObject::dxfInFields(filer)) != Acad::eOk) ||
(filer->atSubclassData(this->desc()->name()) != Adesk::kTrue))
return filer->filerStatus();
resbuf rb;
m_attachedToObjs.setLogicalLength(0);
while ((es == Acad::eOk) && ((es = filer->readResBuf(&rb)) == Acad::eOk)) {
if (rb.restype == AcDb::kDxfSoftPointerId) {
AcDbObjectId tmpId;
tmpId.setFromOldId(rb.resval.rlong);
if (tmpId.isNull() == false)
m_attachedToObjs.append(tmpId);
}
else {
filer->pushBackItem();
es = Acad::eEndOfFile;
}
}
if (es != Acad::eEndOfFile)
return Acad::eInvalidResBuf;
return filer->filerStatus();
}
示例11: DrawLocalFan
void DrawCmd::DrawLocalFan()
{
AcDbObjectId objId = ArxUtilHelper::SelectObject( _T( "请选择一条巷道:" ) );
if( objId.isNull() ) return;
if( !ArxUtilHelper::IsEqualType( _T( "LinkedGE" ), objId ) ) return;
//if( !ArxUtilHelper::IsEqualType( _T( "Chimney" ), objId ) ) return;
AcDbObjectIdArray objIds;
DrawHelper::GetTagGEById2( objId, _T( "LocalFan" ), objIds );
//if( !objIds.isEmpty() )
//{
// AfxMessageBox( _T( "该掘进工作面已设置了局部通风机!" ) );
// return;
//}
AcGePoint3d pt,insertPt;
double angle;
//if( !GetClosePtAndAngle( objId, pt, angle ) ) return;
if( !ArxUtilHelper::PromptPt( _T( "\n请指定局扇的插入点坐标:" ), pt ) ) return;
insertPt = pt;
if( !GetClosePtAndAngle( objId, pt, angle ) ) return;
Fan* pFan = new LocalFan( insertPt, angle );
if( pFan == 0 ) return;
pFan->setRelatedGE( objId ); // 关联巷道
// 初始化并提交到数据库
if( !ArxUtilHelper::PostToModelSpace( pFan ) ) delete pFan;
}
示例12: DisplayPropertyByFunName
bool PropertyDataDlgHelper::DisplayPropertyByFunName( const AcDbObjectId& objId, const CString funName )
{
if( objId.isNull() ) return false;
AcDbObjectId dObjId;
if( !DataHelper::GetDataObject( objId, dObjId ) ) return false;
CString type;
if( !DataHelper::GetTypeName( objId, type ) ) return false;
AcStringArray fields;
FuncFieldHelper::GetFields(funName,type,fields);
//for (int i = 0; i < fields.length(); i++)
//{
// acutPrintf(_T("\n功能:%s\t字段:%s"),funName,fields[i]);
//}
//FieldHelper::GetAllFields( type, fields );
if( fields.isEmpty() )
{
CString msg;
//msg.Format(_T("类型:%s的字段个数为0,没有数据可以显示..."), type);
msg.Format( _T( "没有数据可以显示..." ) );
AfxMessageBox( msg );
return false;
}
InputPropertyDataDlg( dObjId, fields,funName );
return true;
}
示例13: explodeBlock
void BlockDraw::explodeBlock( AcGeVoidPointerArray& ents )
{
// 填充属性数据
AcStringArray names;
regPropertyDataNames( names );
if( names.isEmpty() )
{
acutPrintf( _T( "\n没有注册要提取的字段..." ) );
return;
}
if( names.length() != m_attValues.length() )
{
acutPrintf( _T( "\n注册的属性数据与读取的数据个数不相等!" ) );
return;
}
AcDbObjectId blkId = GetBlockDefinitionByName( m_blockName );
if( blkId.isNull() )
{
acutPrintf( _T( "\n未知的块定义:%s" ), m_blockName );
return;
}
// 计算变换矩阵
AcGeMatrix3d blkXform = GetBlockTransformMatrix( blkId, m_insertPt, m_angle, m_scale );
// 分解块定义
BlockToEntity( blkId, blkXform, names, m_attValues, ents );
}
示例14: DisplayPropertyDataDlg
bool PropertyDataDlgHelper::DisplayPropertyDataDlg( const AcDbObjectId& objId )
{
if( objId.isNull() ) return false;
AcDbObjectId dObjId;
if( !DataHelper::GetDataObject( objId, dObjId ) ) return false;
CString type;
if( !DataHelper::GetTypeName( objId, type ) ) return false;
AcStringArray fields;
FieldHelper::GetAllFields( type, fields );
//acutPrintf(_T("\n类型:%s"),type);
if( fields.isEmpty() )
{
CString msg;
//msg.Format(_T("类型:%s的字段个数为0,没有数据可以显示..."), type);
msg.Format( _T( "没有数据可以显示..." ) );
AfxMessageBox( msg );
return false;
}
else
{
DisplayPartialPropertyDataDlg( dObjId, fields );
return true;
}
}
示例15: setInTunnel
void TTunnel::setInTunnel( const AcDbObjectId& objId )
{
assertWriteEnabled();
if( objId.isNull() ) return;
if( m_inTunnel == objId ) return;
m_inTunnel = objId;
}