本文整理汇总了C++中AcDbObjectId::setFromOldId方法的典型用法代码示例。如果您正苦于以下问题:C++ AcDbObjectId::setFromOldId方法的具体用法?C++ AcDbObjectId::setFromOldId怎么用?C++ AcDbObjectId::setFromOldId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcDbObjectId
的用法示例。
在下文中一共展示了AcDbObjectId::setFromOldId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例2: if
Acad::ErrorStatus
ArxDbgDbAdeskLogoStyle::dxfInFields(AcDbDxfFiler* filer)
{
Acad::ErrorStatus es;
if (((es = ArxDbgDbDictRecord::dxfInFields(filer)) != Acad::eOk) ||
(filer->atSubclassData(this->desc()->name()) != Adesk::kTrue))
return filer->filerStatus();
resbuf rb;
while ((es == Acad::eOk) && ((es = filer->readResBuf(&rb)) == Acad::eOk)) {
if (rb.restype == kDxfSolidFill) {
bool doSolidFill = (rb.resval.rint == 0) ? false : true;
setSolidFill(doSolidFill);
}
else if (rb.restype == kDxfLabel)
setLabel(rb.resval.rstring); // NOTE: normally have to free string from resbuf... not in this case, DXF Filer does
else if (rb.restype == kDxfTextStyle) {
AcDbObjectId tmpId;
tmpId.setFromOldId(rb.resval.rlong);
setTextStyleId(tmpId);
}
else {
filer->pushBackItem();
es = Acad::eEndOfFile;
}
}
if (es != Acad::eEndOfFile)
return Acad::eInvalidResBuf;
return filer->filerStatus();
}
示例3: UpdateListCtr
void CMyDlg::UpdateListCtr()
{
acDocManager->lockDocument(curDoc());
int nCount = m_ListCtr.GetItemCount();
acutPrintf("%d\n", nCount);
long lId;
CString str;
AcDbObjectId LineId;
AcDbEntity *pEnt = NULL;
AcDbLine *pLine = NULL;
Acad::ErrorStatus es;
if (nCount > 0)
{
for (int i = 0; i < nCount; ++i)
{
str = m_ListCtr.GetItemText(i, 0);
lId = atol(str);
LineId.setFromOldId(lId);
//获得指针
es = acdbOpenAcDbEntity(pEnt, LineId, AcDb::kForWrite);
//检查是否被删除
pLine = AcDbLine::cast(pEnt);
if (es == Acad::eWasErased)
{
m_ListCtr.DeleteItem(i);
--m_lLineCnt;
--i;
--m_Row;
}
//检查颜色
else if (es == Acad::eOk)
{
if (pLine)
{
str = m_ListCtr.GetItemText(i, 1);
Adesk::UInt16 usColor = (Adesk::UInt16)atoi(str);
if (pLine->colorIndex() != usColor)
{
char *buf = (char*)malloc(20);
itoa((int)pLine->colorIndex(), buf, 10);
m_ListCtr.SetItemText(i, 1, buf);
free(buf);
}
pLine->close();
}
}
}
}
UpdateData(FALSE);
acDocManager->unlockDocument(curDoc());
}
示例4: if
Acad::ErrorStatus
ArxDbgDbAdeskLogo::dxfInFields(AcDbDxfFiler* filer)
{
Acad::ErrorStatus es;
if (((es = ArxDbgDbEntity::dxfInFields(filer)) != Acad::eOk) ||
(filer->atSubclassData(this->desc()->name()) != Adesk::kTrue))
return filer->filerStatus();
resbuf rb;
while ((es == Acad::eOk) && ((es = filer->readResBuf(&rb)) == Acad::eOk)) {
if (rb.restype == kDxfLogoStyleId) {
AcDbObjectId id;
id.setFromOldId(rb.resval.mnLongPtr);
setLogoStyleId(id);
}
else if (rb.restype == kDxfArbitraryRefId) {
AcDbObjectId id;
id.setFromOldId(rb.resval.mnLongPtr);
setArbitraryReferenceId(id);
}
else if (rb.restype == kDxfScale) {
AcGeScale3d tmpScale(rb.resval.rpoint[X], rb.resval.rpoint[Y], rb.resval.rpoint[Z]);
setScale(tmpScale);
}
else {
filer->pushBackItem();
es = Acad::eEndOfFile;
}
}
if (es != Acad::eEndOfFile)
return Acad::eInvalidResBuf;
return filer->filerStatus();
}
示例5: OnSelectLine
void CMyDlg::OnSelectLine()
{
// TODO: Add your control notification handler code here
ads_name adsNameSet, adsName;
AcDbObjectId objId;
int ret = 0;
long lSelCnt = 0;
AcDbEntity *pEnt = NULL;
int nCount = m_ListCtr.GetItemCount();
long lId;
CString str;
AcDbObjectId LineId;
acDocManager->lockDocument(curDoc());
ShowWindow(SW_HIDE);
ret = acedSSGet(NULL, NULL, NULL, NULL, adsNameSet);
if (RTNORM == ret)
{
m_ListCtr.SetFocus();
acedSSLength(adsNameSet, &lSelCnt);
for (long i = 0; i < lSelCnt; ++i)
{
acedSSName(adsNameSet, i, adsName);
acdbGetObjectId(objId, adsName);
if (nCount > 0)
{
for (int i = 0; i < nCount; ++i)
{
str = m_ListCtr.GetItemText(i, 0);
lId = atol(str);
LineId.setFromOldId(lId);
if (LineId == objId)
{
m_ListCtr.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED);
}
}
}
}
ShowWindow(SW_SHOW);
}
acedSSFree(adsName);
// acutRelRb(stResBuf);
acDocManager->unlockDocument(curDoc());
}
示例6: OnClickObjectTree
void CDlgReadInfo::OnClickObjectTree(NMHDR* pNMHDR, LRESULT* pResult)
{
// Get mouse position.
CPoint point;
::GetCursorPos(&point);
m_wndTree.ScreenToClient(&point);
// Get hit item.
HTREEITEM newItem = m_wndTree.HitTest(point);
if (newItem == NULL)
{
return;
}
GetDlgItem(IDC_SAVE)->EnableWindow(FALSE);
OnSelectChanged(newItem);
AcDbObjectId ObjId;
ObjId.setFromOldId(atoi(m_strCurObjectId));
FlashEntity(ObjId);
}
示例7: OnDelLine
void CMyDlg::OnDelLine()
{
// TODO: Add your control notification handler code here
int nItem;
long lId;
CString str;
AcDbObjectId LineId;
AcDbEntity *pEnt = NULL;
AcDbLine *pLine = NULL;
Acad::ErrorStatus es;
acDocManager->lockDocument(curDoc());
//在列表中删除选定行
while(m_ListCtr.GetNextItem(-1, (LVNI_ALL | LVNI_SELECTED)) != -1)
{
nItem = m_ListCtr.GetNextItem(-1, (LVNI_ALL | LVNI_SELECTED));
str = m_ListCtr.GetItemText(nItem, 0);
//acutPrintf("%s\n", str);
lId = atol(str);
LineId.setFromOldId(lId);
//获得指针
es = acdbOpenAcDbEntity(pEnt, LineId, AcDb::kForWrite);
//在模型空间删除相应实体
pLine = AcDbLine::cast(pEnt);
if (pLine)
{
pLine->erase();
pLine->close();
m_ListCtr.DeleteItem(nItem);
--m_Row;
}
}
UpdateData(FALSE);
acDocManager->unlockDocument(curDoc());
}