Entities (graphic objects) Home

Entities are visible graphical objects (lines, circles, raster images, and so on) that make up a drawing. Graphical objects have typical properties such as Identifier, Layer, Linetype, Color, etc. They also have specific properties, depending on their object type, such as, Center, Radius, and Area.

LiteCAD supports the following types of entities:

Type LC_PROP_ENT_TYPE value
Point LC_ENT_POINT
Construction Line LC_ENT_XLINE
Line LC_ENT_LINE
Polyline LC_ENT_POLYLINE
Rectangle LC_ENT_RECT
Circle LC_ENT_CIRCLE
Arc LC_ENT_ARC
Ellipse LC_ENT_ELLIPSE
Shape LC_ENT_SHAPE
Text LC_ENT_TEXT
Arc Text LC_ENT_ARCTEXT
Multiline Text LC_ENT_MTEXT
Windows Text LC_ENT_TEXTWIN
Block Reference LC_ENT_BLOCKREF
Block Attribute LC_ENT_ATTRIB
Raster image reference LC_ENT_IMAGEREF
ECW / Jpeg2000 Image LC_ENT_ECW
Hatch LC_ENT_HATCH
Dimension Linear LC_ENT_DIMLIN
Dimension Aligned LC_ENT_DIMALI
Dimension Ordinate LC_ENT_DIMORD
Dimension Radial LC_ENT_DIMRAD
Dimension Diametric LC_ENT_DIMDIA
Dimension Angular LC_ENT_DIMANG
Leader LC_ENT_LEADER
Viewport LC_ENT_VIEWPORT
Barcode LC_ENT_BARCODE
Camera view LC_ENT_CAMERA
3D Face LC_ENT_FACE
Clipping rectangle LC_ENT_CLIPRECT

Entities are contained in blocks, therefore, in order to add graphics into a drawing, you have to add it into specified block.

Each entity has the following properties:

Property Type Access Meaning
LC_PROP_ENT_TYPE int R Type of graphic object (see above)
LC_PROP_ENT_ID int
string
R Unique Identifier
Hexadecimal string (up to 16 characters)
LC_PROP_ENT_KEY int RW User value
LC_PROP_ENT_BLOCK handle
string
R Handle to owner Block
Name of owner Block
LC_PROP_ENT_DRW handle R Handle to owner Drawing
LC_PROP_ENT_LAYER handle
string
RW Handle to Layer
Name of Layer
LC_PROP_ENT_LINETYPE handle
string
RW Handle to Linetype
Name of Linetype
LC_PROP_ENT_LTSCALE float RW Linetype scale
LC_PROP_ENT_LWIDTH int RW Linewidth
LC_PROP_ENT_PRIORITY int
string
RW Priority value, used for sorting (lcBlockSortEnts)
Integer or string (hexadecimal, up to 16 characters)

Outline Color
LC_PROP_ENT_COLOR string
int
RW
RW
Color name
RGB value (COLORREF)
LC_PROP_ENT_COLORI int
bool
RW
R
Color Index (1..255)
TRUE if the color is index
LC_PROP_ENT_COLORT int
bool
RW
R
True Color (COLORREF)
TRUE if the color is RGB
LC_PROP_ENT_COLORBYLAYER bool RW Color "ByLayer"
LC_PROP_ENT_COLORBYBLOCK bool RW Color "ByBlock"

Entity filling (for closed entities)
LC_PROP_ENT_FILLING handle
string
RW
RW
Handle to filling type
Name of filling type
LC_PROP_ENT_FILLED bool R "Entity has filling" flag
LC_PROP_ENT_SOLIDFILL bool RW "Entity has solid filling" flag
LC_PROP_ENT_FCOLOR string
int
RW
RW
Filling Color name
RGB value (COLORREF)
LC_PROP_ENT_FCOLORI int
bool
RW
R
Filling color Index (1..255)
TRUE if the color is index
LC_PROP_ENT_FCOLORT int
bool
RW
R
Filling True Color (COLORREF)
TRUE if the color is RGB
LC_PROP_ENT_FCOLORBYLAYER bool RW Filling Color "ByLayer"
LC_PROP_ENT_FCOLORBYBLOCK bool RW Filling Color "ByBlock"
LC_PROP_ENT_FALPHA int RW Alpha value (1..255), for semi-transparent filling

Flags
LC_PROP_ENT_LOCKED bool R "ReadOnly" flag (depends on a layer)
LC_PROP_ENT_VISIBLE bool R "Visible" flag (depends on a layer)
LC_PROP_ENT_HIDDEN bool RW "Hidden" flag
LC_PROP_ENT_DELETED bool RW "Deleted" flag
LC_PROP_ENT_IMMORTAL bool RW "Can not be deleted" flag
LC_PROP_ENT_SELECTED bool R "Selected" flag

Geometric extents
LC_PROP_ENT_XMIN float R X min
LC_PROP_ENT_YMIN float R Y min
LC_PROP_ENT_XMAX float R X max
LC_PROP_ENT_YMAX float R Y max
LC_PROP_ENT_XCEN float R Center X
LC_PROP_ENT_YCEN float R Center Y
LC_PROP_ENT_DX float R Width
LC_PROP_ENT_DY float R Height
LC_PROP_ENT_Z float RW Z-coordinate

Extra data (see also lcEntXData)
LC_PROP_ENT_XDATAID int R Identifier
LC_PROP_ENT_XDATAFLAGS int RW Flags
LC_PROP_ENT_XDATASIZE int R Size of a memory buffer (bytes)
LC_PROP_ENT_XDATA handle RW Pointer to a memory buffer
LC_PROP_ENT_XSTR string RW Text variable (uses XDATA buffer)

Each entity has more properties, specific to the entity's type.

Graphic objects functions

Function Meaning
lcEntErase Erases / Unerases object
lcEntMove Moves object
lcEntScale Scales object
lcEntRotate Rotates object
lcEntMirror Mirrors object
lcEntExplode Explodes object
lcEntSplit Splits entity on several equal parts
lcEntOffset Offsets object
lcEntToTop
lcEntToBottom
lcEntToAbove
lcEntToUnder
Changes object's draw order
lcEntGetGrip Retrieves coordinates of object's control point
lcEntPutGrip Sets new coordinates for object's control point
lcEntUpdate Updates entity
lcEntCopyBase Copies base properties from other entity
lcIntersection Searches intersection points of 2 graphic objects
lcInterGetPoint Retrieves coordinates of intersection points
lcEntXData Allocates extra data buffer

   Retrieve simple polylines of graphic object
lcExpEntity Explode entity to inner buffer
lcExpGetPline Get a polyline from inner buffer
lcExpGetVertex Get coordinates of polyline vertex

See also

  Retrieve objects