Drawings SDK Developer Guide > Working with .dwg Files > Working with Entities > Working with Specific Entitites > Working with Helixes > Overview of Helixes
Overview of Helixes

A helix is a parametric entity that specifies a two-dimensional or three-dimensional spiral curve in a drawing. A helix begins at a start point, twists along an axis in the specified direction from the base radius to the top radius at a specified height, and circumscribes a circular spiral figure of a convergent cone, divergent cone, or cylinder shape. Drawings SDK approximates the helix using a spline figure which is transformed in compliance with helix properties.

A helix has two radiuses:

  • The base radius defines the circle at the start of the spiral curve.
  • The top radius defines the circle at the end of the spiral curve.

The base circle and top circle are placed on parallel planes that are perpendicular to the axis that passes through the circle centers. The center of the base circle defines the position of the helix. If the base radius equals the top radius, the helix is cylindrical. If the base radius is greater than the top radius, the helix is conical and converges. If the base radius is less than the top radius, the helix is conical and diverges. When the helix is a cone shape, the angle between the axis and the line passing along the cone defines the turn slope. The twist around the axis one full circle (360Я2PI) is the turn of a helix. The total height is the distance along the axis between parallel planes. If the total height equals zero, the helix is planar. The distance between turns defines the turn height. The ratio of the total height to the turn height defines the number of turns which may be a fraction.

The OdDbHelix class is a helix object that represents the interface for accessing a helix entity and manipulating its properties. The OdDbHelixPtr class is the typified smart pointer to an instance of the helix object and is used for storing and passing references to this object.

To create an instance of the helix object, use the createObject() method of the OdDbHelix class which is the static pseudo-constructor. For example:


OdDbHelixPtr pHelix = OdDbHelix::createObject();

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

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

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

The OdDbHelix class is derived from the OdDbSpline class and inherits the properties of the spline entity which 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 OdDbHelix class also inherits the general properties of entities. A pointer to a helix object can be converted to an entity object or a curve object. For example:


OdDbEntityPtr pEntity = pHelix;
OdDbCurvePtr pCurve = pHelix;

The OdDbHelix class uses the OdDbSpline class to approximate the spiral curve through a spline curve. When a property of a helix object changes, it recalculates whole points of the spline curve to adapt it to the helix shape.

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


// Accurate comparing
if(pEntity->isA() == OdDbHelix::desc())
  OdConsoleString(L"\nEntity is the spiral curve");

// Check on belonging
if(pEntity->isKindOf(OdDbHelix::desc()))
  OdConsoleString(L"\nEntity is derived from the helix object");

See Also

Specific Helix Properties

Computed Helix Properties

Example of Working with the Helix Object

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