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
Line LC_ENT_LINE
Polyline LC_ENT_POLYLINE
Rectangle LC_ENT_RECT
Multiline LC_ENT_MLINE
Construction Line LC_ENT_XLINE
Circle LC_ENT_CIRCLE
Arc LC_ENT_ARC
Ellipse LC_ENT_ELLIPSE
Text LC_ENT_TEXT
Arc Text LC_ENT_ARCTEXT
Multiline Text LC_ENT_MTEXT
Windows Text LC_ENT_TEXTWIN
Point LC_ENT_POINT
Block Reference LC_ENT_BLOCKREF
Attribute definition LC_ENT_ATTDEF
Raster image reference LC_ENT_IMAGEREF
ECW / Jpeg2000 Image LC_ENT_ECW
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
Shape LC_ENT_SHAPE
Barcode LC_ENT_BARCODE
Hatch LC_ENT_HATCH
Triangulated Irregular Network LC_ENT_TIN
3D Face LC_ENT_FACE
Viewport LC_ENT_VIEWPORT

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)
LC_PROP_ENT_FROMCB bool R TRUE if entity was added from Clipboard. To clear this flag in all entities use command LC_CMD_RESET

      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_SOLIDFILL bool RW "Entity has solid filling" flag
LC_PROP_ENT_FILLED bool RW same as LC_PROP_ENT_SOLIDFILL
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
LC_PROP_ENT_LINFILL handle
string
RW
RW
Handle to linear filling style
Name of linear filling style
LC_PROP_ENT_LINFILLNL int R Number of generated filling lines
LC_PROP_ENT_WIPEOUT bool RW Filled with background color

      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
LC_PROP_ENT_GRIPMODE int RW Behavior concerning grips

      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_LEN float R Length (line, pline, arc, circle, ellipse, rect)
LC_PROP_ENT_Z float RW Z-coordinate
LC_PROP_ENT_THICKNESS float RW Thickness along Z axis

      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 bool
string
R
RW
XDATA contains text string
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
lcEntBreak Divides entity on 2 parts at specified point
lcEntBreak2 Divides entity on multiple parts
lcEntOffset Offsets entity
lcEntExtend Extend geometry to specified edge
lcEntReverse Reverses direction of entity
lcEntAlign Moves entity according alignment type
lcEntGetPoint Gets a point on entity by distance from beginning
lcEntGetDist Gets a point on entity which is nearest to specified point
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
lcEntType Type

   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