Close

Relief for ODA Team in Ukraine

Learn more
ODA Drawings SDK
Overview of Circular Arcs

An arc is a parametric entity that specifies the circular segment in world space. The OdDbArc class is the circular arc object that represents the interface for accessing an arc entity and manipulating its properties. The OdDbArcPtr class is the typified smart pointer to an instance of the arc entity and is used for storing and passing references to the circular arc object.

To create an instance of the circular arc object, use the createObject() method of the OdDbArc class that is the static pseudo-constructor. For example:


OdDbArcPtr pArc = OdDbArc::createObject();

The pseudo-constructor initializes the properties of a new instance using default values. After creating, the new arc instance must be added in the model space, paper space, or a block using the appendOdDbEntity() method. The database associates the object ID with the circular arc instance. In examples, the pDb variable stores a pointer to the database object. For example:


// Add in the block
OdDbBlockTablePtr pBlocks = pDb->getBlockTableId().safeOpenObject(OdDb::kForRead);
OdDbBlockTableRecordPtr pBlock = pBlocks->getAt(L"BLOCK", OdDb::kForWrite)
OdDbObjectId idArc = pBlock->appendOdDbEntity(pArc);

// Add in the model space
OdDbBlockTableRecordPtr pModel = pDb->getModelSpaceId().safeOpenObject(OdDb::kForWrite);
pModel->appendOdDbEntity(pArc);

// Add in the paper space
OdDbBlockTableRecordPtr pPaper = pDb->getPaperSpaceId().safeOpenObject(OdDb::kForWrite);
pPaper->appendOdDbEntity(pArc);

The OdDbArc class is derived from the OdDbCurve class and inherits the common properties of parametric curves. The OdDbCurve class is derived from the OdDbEntity class, therefore the OdDbArc class also inherits the general properties of entities. A pointer to a circular arc object can be converted to an entity object or a curve object. For example:


OdDbEntityPtr pEntity = pArc;
OdDbCurvePtr pCurve = pArc;

The circular arc object has the AcDbArc class name. To verify an instance, use the isKindOf() and desc() methods. For example:


// Accurate comparing
if(pEntity->isA() == OdDbArc::desc())
  odPrintConsoleString(L"\nEntity is the circular arc");

// Check on belonging
if(pEntity->isKindOf(OdDbArc::desc()))
  odPrintConsoleString(L"\nEntity is derived from the circular arc object");

See Also

Specific Circular Arc Properties

Computed Circular Arc Properties

Example of Working with the Circular Arc

Copyright © 2002 – 2022. Open Design Alliance. All rights reserved.