Entity Lists with DXF Codes in ObjectARX

As previously mentioned, lists with DXF group codes represent AutoCAD entities. The acutBuildList() function constructs such lists. To construct an entity, call both acutBuildList() and acdbEntMake().

Note: Entity definitions begin with a zero (0) group that describes the entity type. Because lists passed to acutBuildList() are terminated with 0 (or RTNONE), this creates a conflict. The special result type code RTDXF0 resolves the conflict. Construct the zero group in DXF lists passed to acutBuildList() with RTDXF0. If you attempt to substitute a literal zero for RTDXF0, acutBuildList() truncates the list.

The following sample code fragment creates a DXF list that describes a circle and then passes the new entity to acdbEntMake(). The circle is centered at (4,4), has a radius of 1, and is colored red:

struct resbuf *newent; 
ads_point center = {4.0, 4.0, 0.0}; 
newent = acutBuildList(
    RTDXF0, "CIRCLE", 
    62, 1, // 1 == red  
    10, center, 
    40, 1.0, // Radius  
    0 ); 
if (acdbEntMake(newent) != RTNORM) { 
    acdbFail("Error making circle entity\n"); 
    return BAD; 
}