|
getDimstyleData() does not work for some Dimensions
[code]Acad::ErrorStatus getDimstyleDataFromDimension(
AcDbDimension *pDim,
AcDbDimStyleTableRecord*& pDimStyle)
{
Acad::ErrorStatus es;
if (!pDim) return Acad::eNullEntityPointer;
// Check if there are any XData's
resbuf *xdata = pDim->xData(_T("ACAD"));
if (xdata != NULL) {
// Use getDimstyleData()
if (Acad::eOk != (es = pDim->getDimstyleData(pDimStyle))) {
return es;
}
} else {
// Get information from original dimension style.
// Because there are no dimstyle overrides you can
// work with a 'normal' copy of the original style.
AcDbObjectId dimstyleId = pDim->dimensionStyle();
AcDbDimStyleTableRecord *pDimStyleTableRec;
if (Acad::eOk != (es =
acdbOpenObject(pDimStyleTableRec,
dimstyleId, AcDb::kForRead)))
return es;
pDimStyle->copyFrom(pDimStyleTableRec);
pDimStyleTableRec->close();
}
return Acad::eOk;
}[/code] |
|