Drawings SDK Developer Guide > Working with .dwg Files > Working with Entities > Working with Specific Entitites > Working with Arc-Aligned Text > Overview of Arc-Aligned Text
Overview of Arc-Aligned Text

An arc-aligned text entity represents a text line aligned along an arc. The text line defines a sequence of alphanumeric letters and various symbols as a geometric figure created from linear and circular segments in a restricted area. The OdDbArcAlignedText class is the text object that represents the interface for accessing an arc-aligned text entity and manipulating its properties. The OdDbArcAlignedTextPtr class is the typified smart pointer to an instance of the arc-aligned text entity and is used for storing and passing references to the arc-aligned text object.

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


OdDbArcAlignedTextPtr pArcText = OdDbArcAlignedText::createObject();

The pseudo-constructor initializes the properties of a new instance using default values. After creation, the new arc-aligned text instance must be added in model space, paper space, or a block using the appendOdDbEntity() method. The database associates the object ID with the arc-aligned text instance. In the following 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 idArcText = pBlock->appendOdDbEntity(pArcText);

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

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

After adding the new arc-aligned text instance, it must be connected with an arc entity that was created and added to the database previously. To set the text string for arc-aligned text, use the setTextString() method. In the examples, the pArc variable stores a pointer to the circular arc object. For example:


pArcText->setArcId(pArc->objectId());
pArcText->setTextString("Arc text");

The OdDbArcAlignedText class is derived from the OdDbEntity class, therefore the OdDbArcAlignedText class also inherits the general properties of entities. A pointer to an arc-aligned text object can be converted to an entity object. For example:


OdDbEntityPtr pEntity = pArcText;

To verify an instance, use the isKindOf() and desc() methods. For example:


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

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

See Also

Specific Arc-Aligned Text Properties

Example of Working with Arc-Aligned Text

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