ObjectARX, AutoCAD. Среда программирования библиотеки C++


              

SubErase, subOpen, subClose, and subCancel - часть 5


}

struct resbuf inbuf;

AcDbObjectId objId;

int idCount;

filer->readItem(&inbuf);

if (inbuf.restype == AcDb::kDxfInt32) {

idCount = inbuf.resval.rint;

} else {

filer->pushBackItem();

filer->setError(Acad::eInvalidDxfCode,

"\nError: expected group code %d",

AcDb::kDxfInt32);

return filer->filerStatus();

}

for (int i = 0; i < idCount; i++) {

es = filer->readItem(&inbuf);

if (es != Acad::eOk) {

filer->setError(Acad::eMissingDxfField,

"\nError: expected more group code %d’s",

AcDb::kDxfHardPointerId);

return filer->filerStatus();

}

if (inbuf.restype == AcDb::kDxfHardPointerId) {

acdbGetObjectId(objId, inbuf.resval.rlname);

mEllipseIds.append(objId);

} else {

filer->pushBackItem();

filer->setError(Acad::eInvalidDxfCode,

"\nError: expected group code %d",

AcDb::kDxfHardPointerId);

return filer->filerStatus();

}

}

return filer->filerStatus();

}

Acad::ErrorStatus

AsdkEllipse::dxfOutFields(AcDbDxfFiler* filer) const

{

assertReadEnabled();

AcDbEllipse::dxfOutFields(filer);

filer->writeItem(AcDb::kDxfSubclass, "AsdkEllipse");

filer->writeInt32(AcDb::kDxfInt32,

mEllipseIds.length());

for (int i = 0; i < mEllipseIds.length(); i++) {

filer->writeObjectId(AcDb::kDxfHardPointerId,

mEllipseIds[i]);

}

return filer->filerStatus();

}

void

AsdkEllipse::list() const

{

assertReadEnabled();

AcDbEllipse::list();

acutPrintf("\nClass:\t%s", isA()->name());

for (int i = 0; i < mEllipseIds.length(); i++) {

acutPrintf("\nReferenceId[%d]:\t%ld", i,

(mEllipseIds[i]).asOldId());

}

}

// Called whenever an object of this class is dragged,

// moved, stretched, rotated, etc. so be careful what

// this function is made to do.

//

AcRxObject*

AsdkEllipse::clone() const

{

assertReadEnabled();

return new AsdkEllipse(*this);

}

Acad::ErrorStatus

AsdkEllipse::wblockClone(

AcRxObject* pOwnerObject,

AcDbObject*& pClonedObject,




Содержание  Назад  Вперед