Base Class Functionality
cDXE_Base - allocation tracking, type checking, global error codes, validation
virtual eDXE_ClassType GetClassType() check derived class type
static long GetClassCount() find out how many DXE classes are allocated
static cDXE_Error GetGlobalError() check last error code set by DXE
cDXE_Grip - cDXE_Base functionality plus local error codes, drawing this object is attached to
cDXE_Drawing *GetDrawing() const get associated drawing
Class Heirarchy
cDXE_Base base class for all DXE classes
miscellaneous subobjects
cDXE_Grip
cDXE_Class object class information (R13)
cDXE_Classes all classes (R13)
cDXE_Display display (vectorize) drawing
cDXE_Drawing generic handle to drawing
cDXE_DWG
cDXE_DXF
cDXE_DXFAscii
cDXE_DXFBinary
cDXE_Entity
cDXE_3DFace 3D face
cDXE_3DSolid ACIS 3D solid (R13)
cDXE_Arc arc
cDXE_BaseText generic handle to text entity
cDXE_Attrib attribute
cDXE_Attdef attribute definition
cDXE_Text text
cDXE_Block block (only in block section)
cDXE_Body ACIS body (R13)
cDXE_Circle circle
cDXE_Dimension dimension
cDXE_Ellipse ellipse (R13)
cDXE_EndBlock end block (only in block section)
cDXE_Hatch hatch (R14)
cDXE_Image image (bitmap) (R14)
cDXE_Insert insert (block instance)
cDXE_Leader leader (R13)
cDXE_Lwpolyline light weight polyline (R14)
cDXE_Mline multiline (R13)
cDXE_Mtext multiline text (R13)
cDXE_Ole2Frame OLE2 frame (R14)
cDXE_OleFrame OLE frame (R13)
cDXE_Point point
cDXE_Polyline polyline (followed by vertices and seqend)
cDXE_Ray ray (R13)
cDXE_Region ACIS region (R13)
cDXE_Seqend seqence end (after polyline or insert)
cDXE_Shape shape
cDXE_Tolerance tolerance (R13)
cDXE_TraceOrSolid trace or 2D solid
cDXE_Vertex vertex (after polyline)
cDXE_Viewport paperspace viewport
cDXE_Xline xline (infiinite line) (R13)
cDXE_Zombie zombie or proxy entity (R13)
cDXE_Header drawing specific settings
cDXE_Object generic object (R13)
cDXE_Dictionary collection of objects (cDXE_Entry objects)
cDXE_Groups entity groupings
cDXE_Images image (bitmap) definitions
cDXE_MlineStyles multiline styles
cDXE_SortentsDictionary collection of entity sorting lists
cDXE_Variables general variables
cDXE_Entry entry in a dictionary
cDXE_Group a group of entities
cDXE_ImageDef an image (bitmap) definition
cDXE_MlineStyle multiline style
cDXE_SortentsTable entity sorting list
cDXE_Variable a variable
cDXE_ImageDefReactor image definition reactor
cDXE_ImageVars image settings
cDXE_Unknown catch all unknown objects
cDXE_Objects all objects
cDXE_Reactor reactor - list of object handles
cDXE_Section
cDXE_BlockSection block section
cDXE_EntitySection entity section
cDXE_Table generic handle to table
cDXE_ApplicationIDTable application id's (for xdata)
cDXE_BlockTable blocks
cDXE_DimensionStyleTable dimension styles
cDXE_LayerTable layers
cDXE_LinetypeTable linetypes
cDXE_TextStyleTable text styles
cDXE_UCSTable user coordinate systems
cDXE_ViewTable named views
cDXE_VportTable tiled viewports
Include Files
#include "dxeclass.hpp" cDXE_Classes and cDXE_Class
#include "dxedisp.hpp" cDXE_Display
#include "dxedwg.hpp" cDXE_Drawing
#include "dxeent.hpp" cDXE_Entity
#include "dxeheadr.hpp" cDXE_Header
#include "dxeobjs.hpp" cDXE_Object and cDXE_Objects
#include "dxereact.hpp" cDXE_Reactor
#include "dxesect.hpp" cDXE_Section
#include "dxetable.hpp" cDXE_Table
#include "dxe.hpp" all public DXE classes
Naming Conventions
cDXE_ClassName exported DXE class
eDXE_EnumName exported enumerated type
eDEN_Item item in eDXE_EnumName
dType defined type
pType pointer to a defined type
pcType pointer to a const defined type
Basic DXE Types
pDXE_String character string
pcDXE_String const character string
pDXE_FileName file name
pcDXE_FileName const file name
pDXE_Handle object handle
pcDXE_Handle const object handle
dDXE_Vector 3D vector - array of 3 doubles
pDXE_Vector pointer to vector
pcDXE_Vector pointer to const vector
dDXE_Vector2D 2D vector - array of 2 doubles
pDXE_Vector2D pointer to 2D vector
pcDXE_Vector2D pointer to const 2D vector
dDXE_Matrix 3x3 matrix
Retrieving vectors...
pcDXE_Vector GetVector() const get const vector for reference
quicker than copying but can't be changed
bool GetVector(pDXE_Vector) const get a copy of the vector
Retrieving strings...
pcDXE_String GetString() const get const string for reference
quicker than copying but can't be changed
int GetString(pDXE_String) const get a copy of the string - returns string length
pass NULL if you only want the length
Converting Old DXE Programs
The old C-style API should still work and behave the same as before. GRIP
objects have turned into cDXE_Grip-derived C++ classes allowing existing programs
to work as-is. This also allows programs to access the new functionality of the
classes by typecasting a GRIP to the appropriate class. "dxe.h" even adjusts for
whether it's included in a C or C++ file, permitting mixing of C and some C++ files
in the same project.
The conversion from DXE_ or DXED_ function to C++ is generally fairly obvious. Whatever
grip was passed as the first parameter is probably a class that has a member function
corresponding to the old API name. The old dxecopy.c example has been converted to
dxecopy.cpp. This is a fairly complete example which demonstrates reading and writing
as well as getting and setting all properties from all the classes.
/* C API */
GRIP drawing = DXE_OpenDrawing("drawing.dwg");
GRIP section = DXE_OpenEntitySection(drawing);
GRIP entity = DXE_GetNextEntity(section);
int type = DXE_GetEntityType(entity);
// same code in C++
cDXE_Drawing *drawing = cDXE_Drawing::Open("drawing.dwg");
cDXE_Section *section = drawing->OpenEntitySection();
cDXE_Entity *entity = section->GetNextEntity();
eDXE_EntityType type = entity->GetEntityType();
Most of the new calls should be easy to figure out based on the old function name. Some
that may be less obvious are listed here.
dwg = DXE_OpenDrawing(file); dwg = cDXE_Drawing::Open(file);
ent = DXE_NewEntity(drawing,type); ent = cDXE_Entity::NewEntity(drawing,type);
block = DXE_OpenBlock(drawing,num); block = cDXE_Drawing::OpenBlockForRead(n);
DXE_EndBlock(section,block); section->EndWrite(block);
section = DXE_OpenEntitySection(drawing); section = drawing->OpenEntitySection();
drawing = DXE_CreateDWGDrawing(file,ver); drawing = cDXE_Drawing::CreateDWG(file,ver);
DXE_ReleaseGrip(grip); delete grip;
DXE_CloseDrawing(grip); delete grip;
DXE_CloseDisplay(grip); delete grip;
DXE_GetTableNumber cDXE_Table::FindName
DXE_GetLineTypeDesc cDXE_LinetypeTable::GetDescription
DXE_GetEntitySpace(entity); entity->IsInPaperspace();
DXE_SetEntitySpace(entity,flag); entity->SetInPaperspace(flag);
XDATA_APPEND eDXM_Append
XDATA_INSERT eDXM_Insert
XDATA_REPLACE eDXM_Replace