Message 1 of 9
AcDbDimension - how to create or edit?

Not applicable
02-17-2003
06:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hi everybody,
i try to edit a dimension style with the code
below.
below.
it doesn't work. i can't open the
object.
object.
what's wrong?
and how to create a dimstyle from new? and set all
the values?
the values?
thanks for help 🙂
chris
size=2>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AcDbDimStyleTable
*pStyleTable;
if(acdbHostApplicationServices()->workingDatabase()->getDimStyleTable(pStyleTable,
AcDb::kForRead) != Acad::eOk)
return;
*pStyleTable;
if(acdbHostApplicationServices()->workingDatabase()->getDimStyleTable(pStyleTable,
AcDb::kForRead) != Acad::eOk)
return;
if(pStyleTable->has("Standard") ==
true)
{
//pStyleTable->upgradeOpen();
AcDbObjectId
newId;
pStyleTable->getAt("Standard", newId);
pStyleTable->close();
AcDbDimension
*pDim;
AcDbEntity *pO;
if(acdbOpenObject(pO, newId,
AcDb::kForRead) == Acad::eOk)
{
// Changes arrowhead
from closed filled to ArchTick
pDim =
AcDbDimension::cast(pO);
pDim->setDimblk("M");
pDim->recomputeDimBlock();
pDim->close();
}
}
true)
{
//pStyleTable->upgradeOpen();
AcDbObjectId
newId;
pStyleTable->getAt("Standard", newId);
pStyleTable->close();
AcDbDimension
*pDim;
AcDbEntity *pO;
if(acdbOpenObject(pO, newId,
AcDb::kForRead) == Acad::eOk)
{
// Changes arrowhead
from closed filled to ArchTick
pDim =
AcDbDimension::cast(pO);
pDim->setDimblk("M");
pDim->recomputeDimBlock();
pDim->close();
}
}