The CADDATA structure contains information on all CAD entity properties.
Syntax
typedef struct _CADDATA
{
WORD Tag;
WORD Count;
WORD TickCount;
BYTE Flags;
BYTE Style;
int Dimension;
LPFPOINT DashDots;
int DashDotsCount;
int Color;
LPVOID Ticks;
sgFloat Thickness;
sgFloat Rotation;
char *Layer;
char *Text;
char *FontName;
HANDLE Handle;
int Undefined1;
sgFloat Undefined2;
sgFloat Undefined3;
LPCADEXTENDEDDATA CADExtendedData;
FPOINT Point;
FPOINT Point1;
FPOINT Point2;
FPOINT Point3;
union {
struct {
sgFloat Radius;
sgFloat StartAngle;
sgFloat EndAngle;
sgFloat Ratio;
BYTE EntityType;
} Arc;
struct {
HANDLE Block;
FPOINT Scale;
} Blocks;
struct {
sgFloat FHeight;
sgFloat FScale;
sgFloat RWidth;
sgFloat RHeight;
BYTE HAlign;
BYTE VAlign;
} Text;
LPFPOINT Points;
} DATA;
} CADDATA, *LPCADDATA;
Fields
Tag |
Specifies type of the CAD entity:
|
||||||||||||
Specifies the number of child entities (for BLOCK, POLYLINE etc). •For simple entities such as LINE it is always 0. •For the POLYLINE entity Count specifies the number of points. •For the HATCH entity Count is the number of boundaries. |
|||||||||||||
TickCount |
Specifies the number of line type elements for this entity (dash, dot and spaces). If the entity is drawn by solid lines, this member is 0. |
||||||||||||
Flags |
Specifies the flags byte for different entities, such as LAYER, BLOCK, POLYLINE etc. It has an individual meaning for each entity type. |
||||||||||||
Style |
Specifies the pen style for drawing the entity:
It is an approximation of the entity line type. You can get more accurate information using TickCount and Ticks. |
||||||||||||
Dimension |
Index of the dimension group this entity belongs to. If Dimension is 0, the entity is not in the dimension group. |
||||||||||||
Points to the array of the FPOINT structures that contains line type elements of the entity (for the entities that are based on polyline(s)). |
|||||||||||||
Specifies size of the DashDots array. |
|||||||||||||
Specifies the color value for the entity. |
|||||||||||||
Points to the array of floating-point values, one value for each line type element (dash, dot or space). For solid lines, TickCount is 0 and Ticks has no value. In case of CAD_IMAGE_ENT, Ticks specifies a pointer to the BMP picture data. Handle specifies an integer value of the BMP picture data size. |
|||||||||||||
Thickness |
Specifies the line width for the entity. |
||||||||||||
Specifies the rotation angle in degrees for TEXT or INSERT. |
|||||||||||||
Layer |
Points to the null-terminated string specifying layer name for the entity. |
||||||||||||
Points to the null-terminated string specifying text value for text entities (TEXT, MTEXT or ATTDEF). |
|||||||||||||
FontName |
Points to the null-terminated string specifying font name for text entities (TEXT, MTEXT or ATTDEF). |
||||||||||||
In case of CAD_IMAGE_ENT, Handle specifies Integer value of the BMP picture data size. Ticks specifies a pointer to the BMP picture data. |
|||||||||||||
Undefined1 |
Reserved for future versions. |
||||||||||||
Undefined2 |
Reserved for future versions. |
||||||||||||
Undefined3 |
Reserved for future versions. |
||||||||||||
CADExtendedData |
An extended structure that contains additional information on the entity (get more info). |
||||||||||||
Specifies the reference point for the entity. •In case of calling the CADProhibitCurvesAsPoly function with nCheckNumber = 0, Point specifies the center point. |
|||||||||||||
Specifies the second reference point for such entities as LINE, TEXT or ELLIPSE. •In case of calling the CADProhibitCurvesAsPoly function with nCheckNumber = 0, Point1 specifies endpoint of the major axis, relative to the center. |
|||||||||||||
Specifies the third point for SOLID, TRACE and 3DFACE. •In case of calling the CADProhibitCurvesAsPoly function with nCheckNumber = 0, Point2 specifies the start parameter. |
|||||||||||||
Specifies the fourth point for SOLID, TRACE and 3DFACE. •In case of calling the CADProhibitCurvesAsPoly function with nCheckNumber = 0, Point3 specifies end parameter. |
|||||||||||||
Radius |
Specifies the radius value for CIRCLE and ARC or ratio of a minor axis to the major axis for ELLIPSE. |
||||||||||||
StartAngle, EndAngle |
Specify the angle values in degrees for ARC and ELLIPSE. |
||||||||||||
Ratio |
Specifies ratio of a minor axis to the major axis. |
||||||||||||
EntityType |
Specifies type of the CAD_ELLIPSE data. •If EntityType is equal to 0, then the CAD_ELLIPSE entity is defined by Point, Point1 (TopLeft, BottomRight), Point2 and Point3 (startpoint and endpoint of polyline). •If EntityType is equal to 1, then CAD_ELLIPSE entity is defined by Ratio (specifies a ratio of minor axis to the major axis), Point (specifies the center point), Point1 (specifies the endpoint of the major axis, relative to the center), Point2 and Point3 (startpoint and endpoint of polyline). |
||||||||||||
Block |
Specifies the block handle for INSERT. |
||||||||||||
Scale |
Specifies X-, Y- and Z-scale values for INSERT. |
||||||||||||
Specifies the character height for text entities (TEXT, MTEXT or ATTDEF). |
|||||||||||||
FScale |
Specifies the relative X scale factor (ratio of the character width to the character height) for text entities. |
||||||||||||
RWidth |
Specifies the reference rectangle width for MTEXT. |
||||||||||||
RHeight |
Specifies the reference rectangle height for MTEXT. |
||||||||||||
Specifies the horizontal alignment for text entities: 0 = Left; 1= Center; 2 = Right |
|||||||||||||
VAlign |
Specifies the vertical alignment for text entities: 0 = Baseline; 1 = Bottom; 2 = Middle; 3 = Top |
||||||||||||
Points to the array of the FPOINT structures which contains points for POLYLINE, LWPOLYLINE and SPLINE. The number of points is specified by Count. |
Fields required to draw particular entities:
Entity |
Field |
Line |
Point, the starting point. Point1, the end point. |
3DFace |
Point, the first point of the 3DFace boundary. Point1, the second point of the 3DFace boundary. Point2, the third point of the 3DFace boundary, Point3, the fourth point of the 3DFace boundary. |
Arc |
Point, Point1, a bounding rectangle. Point2, the starting point. Point3, the end point. |
Hatch |
Count, the number of boundaries. Points, a pointer to a point array of the boundary. Color, the hatch color. DashDots, the pointer to a point array of hatch pattern lines. DashDotsCount, the number of vertices of the array of hatch pattern lines. |
Image Entity |
Point1, the upper-left corner. Point2, the bottom right corner. Handle, a pointer to the TPicture object in memory. Ticks^, the size of the TPicture object. |
Point |
Point, the point position. |
Polyline |
Count, the number of polyline vertices. Points, the pointer to a point array. |
Solid |
Point, the first point of the solid boundary. Point1, the second point of the solid boundary. Point2, the third point of the solid boundary. Point3, the fourth point of the solid boundary. |
Spline |
Count, the number of control points. Points, the pointer to point the array with control points. |
Text |
Point or Point1, the location (starting point) for text output. HAlign, text horizontal alignment. FHeight, the text height. Rotation, text rotation. Text, a text string. |
See Also
CADEXTENDEDDATA | FPOINT | FRECT | sgFloat
© 2003-2024 CADSoftTools
Go to CAD DLL