CADDATA

  Structures >

CADDATA

Previous pageReturn to chapter overviewNext page

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:

CAD_UNKNOWN

CAD_TABLE

CAD_BLOCK

CAD_LTYPE

CAD_LAYER

CAD_VERTEX

CAD_LINE

CAD_SOLID

CAD_CIRCLE

CAD_ARC

CAD_POLYLINE

CAD_LWPOLYLINE

CAD_SPLINE

CAD_INSERT

CAD_DIMENSION

CAD_TEXT

CAD_MTEXT

CAD_ATTDEF

CAD_ELLIPSE

CAD_POINT

CAD_3DFACE

CAD_HATCH

CAD_IMAGE_ENT

CAD_ATTRIB

CAD_FLAT_POLY

CAD_BEGIN_POLYLINE

CAD_END_POLYLINE

CAD_BEGIN_INSERT

CAD_END_INSERT

CAD_BEGIN_VIEWPORT

CAD_END_VIEWPORT

CAD_ACIS_BEGIN

CAD_ACIS

CAD_ACIS_END

= 0;

= 1;

= 2;

= 3;

= 4;

= 5;

= 6;

= 7; (SOLID or TRACE entity)

= 8;

= 9;

= 10; (POLYLINE or LEADER entity)

= 11;

= 12;

= 13;

= 14;

= 15;

= 16;

= 17;

= 18;

= 19;

= 20;

= 21;

= 22; (IMAGE or OLE2FRAME entity)

= 23;

= 99;

= 100;

= 101;

= 102;

= 103;

= 104;

= 105;

= 106;

= 107;

= 108;

Count

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:

Value

Meaning

PS_SOLID

Pen is solid.

PS_DASH

Pen is dashed.

PS_DOT

Pen is dotted.

PS_DASHDOT

Pen has alternating dashes and dots.

PS_DASHDOTDOT

Pen has dashes and double dots.

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.

DashDots

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)).

DashDotsCount

Specifies size of the DashDots array.

Color

Specifies the color value for the entity.

Ticks

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.

Rotation

Specifies the rotation angle in degrees for TEXT or INSERT.

Layer

Points to the null-terminated string specifying layer name for the entity.

Text

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).

Handle

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).

Point

Specifies the reference point for the entity.

In case of calling the CADProhibitCurvesAsPoly function with nCheckNumber = 0, Point specifies the center point.

Point1

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.

Point2

Specifies the third point for SOLID, TRACE and 3DFACE.

In case of calling the CADProhibitCurvesAsPoly function with nCheckNumber = 0, Point2 specifies the start parameter.

Point3

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.

FHeight

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.

HAlign

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

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.

Point2 is Point3 for a full ellipse.

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.

Point1, duplicates Point.

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