本文整理汇总了C++中AcDbObjectId::database方法的典型用法代码示例。如果您正苦于以下问题:C++ AcDbObjectId::database方法的具体用法?C++ AcDbObjectId::database怎么用?C++ AcDbObjectId::database使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcDbObjectId
的用法示例。
在下文中一共展示了AcDbObjectId::database方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: catch
STDMETHODIMP [!output CLASS_NAME]::CreateObject (AcDbObjectId ownerId /*=AcDbObjectId::kNull*/, TCHAR *keyName /*=NULL*/) {
try {
Acad::ErrorStatus es ;
AcDbObjectPointer<[!output ARX_CLASS_NAME]> obj ;
if ( (es =obj.create ()) != Acad::eOk )
throw es ;
[!if ACAD_ENTITY_INTERFACE]
obj->setDatabaseDefaults (ownerId.database ()) ;
[!endif]
[!output ARX_CLASS_NAME] *pTmp =NULL ;
obj.release (pTmp) ;
SetObject ((AcDbObject *&)pTmp) ;
} catch ( const Acad::ErrorStatus ) {
return (Error (L"Failed to create [!output ARX_CLASS_NAME]", IID_[!output INTERFACE_NAME], E_FAIL)) ;
}
return (S_OK) ;
}
示例2: CreateObject
STDMETHODIMP CComPolygon::CreateObject(AcDbObjectId ownerId, TCHAR *keyName)
{
try
{
Acad::ErrorStatus es;
AcDbObjectPointer<AsdkPoly> pPoly;
if((es = pPoly.create()) != Acad::eOk)
throw es;
pPoly->setDatabaseDefaults(ownerId.database());
AsdkPoly *pTmp = NULL;
pPoly.release(pTmp);
SetObject((AcDbObject*&)pTmp);
}
catch(const Acad::ErrorStatus)
{
return Error(L"Failed to create polygon",IID_IComPolygon,E_FAIL);
}
return S_OK;
}
示例3: CreateObject
HRESULT CAsdkSquareWrapper::CreateObject(AcDbObjectId ownerId, TCHAR *keyName)
{
try
{
Acad::ErrorStatus es;
AcDbObjectPointer<AsdkSquare> pSq;
if((es = pSq.create()) != Acad::eOk)
throw es;
pSq->setDatabaseDefaults(ownerId.database());
AsdkSquare *pTmp = NULL;
pSq.release(pTmp);
SetObject((AcDbObject*&)pTmp);
}
catch(const Acad::ErrorStatus)
{
return Error(L"Failed to create square",IID_IAsdkSquareWrapper, E_FAIL);
}
return S_OK;
}