Drawing database Home

The LiteCAD drawing object is the internal database representing a drawing. The database contains graphical objects (entities) and non-graphical (named objects). You must create at least one instance of a drawing object in your application. You can load a file into a drawing object or create a drawing programmatically. To view and interactively edit a drawing, an application must link it with a LiteCAD design window.
When you are finished working with a drawing object you must delete its handle to free system memory allocated to it.

These are the functions used to manage LiteCAD drawing object:

Function Meaning
lcCreateDrawing Creates empty drawing object and returns its handle
lcDeleteDrawing Deletes the drawing object
lcDrwNew Clears a drawing into initial state
lcDrwLoad Loads a drawing's data from a file
lcDrwLoadMem Loads a drawing's data from a memory buffer
lcDrwInsert Inserts other drawing into current drawing
lcDrwCopy Copies a drawing
lcDrwSave Saves a drawing's data into a file
lcDrwSaveMem Saves a drawing's data into a memory buffer

Named objects
lcDrwAddLayer Adds a new layer into a drawing
lcDrwAddLinetype Adds a new linetype into a drawing
lcDrwAddLinetypeF Adds a new linetype into a drawing
lcDrwAddTextStyle Adds a new text style into a drawing
lcDrwAddDimStyle Adds a new dimension style into a drawing
lcDrwAddPntStyle Adds a new point style into a drawing
lcDrwAddImage
lcDrwAddImage2
lcDrwAddImage3
Adds a new image into a drawing
lcDrwAddBlock Adds a new block into a drawing
lcDrwAddBlockFromDrw Adds a block into a drawing from other drawing
lcDrwAddBlockFromFile Adds a block into a drawing from other drawing's file
lcDrwAddBlockFile Adds entire drawing from a file as one block
lcDrwAddBlockPaper Adds "Paper space" type block
lcDrwAddBlockCopy Adds a new block into a drawing as a clone of exist block
lcDrwDeleteObject Deletes an object from a drawing
lcDrwCountObjects Counts a number of named objects, by type
lcDrwSortObjects Sort named objects by LC_PROP_TABLE_PRIORITY

Retrieve objects
lcDrwGetFirstObject
lcDrwGetNextObject
Used to sequentially retrieve all named objects
lcDrwGetObjectByName Retrieves an object by its name
lcDrwGetObjectByID
lcDrwGetObjectByIDH
Retrieves named object by its identifier
lcDrwGetEntByID
lcDrwGetEntByIDH
Retrieves a graphic objects by its identifier
lcDrwGetEntByKey Retrieves a graphic object by its key value

Other
lcDrwPurge Clears a drawing database from "deleted" objects
lcDrwClearXData Clears a drawing's extra data
lcDrwExplode Explodes all entities to simpler type
lcDrwSetLimits Defines max limits (used for view)
lcDrwUndoRecord Saves operations in Undo buffer
lcDrwUndo Performs Undo or Redo operation
lcDrwUpdateBlkRefs Updates all references of specified block
lcDrwUpdateWinFonts Prepares a text style to be applicable for using for win text objects.
lcGetDrwXData Retrieve drawing's XDATA from a file without loading it.

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

Drawing object has the following properties:

Property Type Access Meaning
LC_PROP_DRW_UID string R Unique Identifier of a drawing
LC_PROP_DRW_FILENAME string RW Drawing's filename
LC_PROP_DRW_DESCR
LC_PROP_DRW_COMMENT
string RW Drawing's description
LC_PROP_DRW_READONLY bool RW "ReadOnly" flag
LC_PROP_DRW_DIRTY bool RW "Drawing was modified" flag
LC_PROP_DRW_IDMAX int
string
R Maximal value of object identifier
Hexadecimal string (up to 16 characters)
LC_PROP_DRW_SYNCZOOM bool RW "Synchronize Layouts Zoom" flag
LC_PROP_DRW_HASALPHABLEND bool R TRUE if any entity uses alpha blend (semi-transparent filling)
LC_PROP_DRW_BLKREFGRIPS int RW Grips mode for Block reference entity. 0-display all grips, 1-only position, 2-position and rotation grips.
LC_PROP_DRW_EXTOFFLAYER bool RW Enable invisible layers for extents calculation

   Background, foreground and cursor colors
LC_PROP_DRW_COLORBACKM int RW Model Space window background color (COLORREF)
LC_PROP_DRW_COLORBACKP int RW Paper Space window background color (COLORREF)
LC_PROP_DRW_COLORFOREM int RW Model Space foreground color (COLORREF)
LC_PROP_DRW_COLORFOREP int RW Paper Space foreground color (COLORREF)
LC_PROP_DRW_COLORCURSORM int RW Model Space cursor color (COLORREF)
LC_PROP_DRW_COLORCURSORP int RW Paper Space cursor color (COLORREF)
LC_PROP_DRW_COLORPAPER int RW Paper Space sheet color (COLORREF)

   Active outline color
LC_PROP_DRW_COLOR string RW Active color
LC_PROP_DRW_COLORBYLAYER bool RW Color "ByLayer"
LC_PROP_DRW_COLORBYBLOCK bool RW Color "ByBlock"
LC_PROP_DRW_COLORI int
bool
RW
R
Color Index (1..255)
TRUE if the color is index
LC_PROP_DRW_COLORT int
bool
RW
R
True Color (COLORREF)
TRUE if the color is RGB

   Active fill color
LC_PROP_DRW_FCOLOR string RW Active filling color
LC_PROP_DRW_FCOLORBYLAYER bool RW Filling color "ByLayer"
LC_PROP_DRW_FCOLORBYBLOCK bool RW Filling color "ByBlock"
LC_PROP_DRW_FCOLORI int
bool
RW
R
Color Index (1..255)
TRUE if the color is index
LC_PROP_DRW_FCOLORT int
bool
RW
R
True Color (COLORREF)
TRUE if the color is RGB

   Active objects and parameters, used on creating new entities
LC_PROP_DRW_LAYER handle
string
RW Handle to active layer
Name of active layer
LC_PROP_DRW_LINETYPE handle
string
RW Handle to active linetype
Name of active linetype
LC_PROP_DRW_LTSCALE float RW Current linetype scale
LC_PROP_DRW_TEXTSTYLE handle
string
RW Handle to active text style
Name of active text style
LC_PROP_DRW_PNTSTYLE handle
string
RW Handle to active point style
Name of active point style
LC_PROP_DRW_DIMSTYLE handle
string
RW Handle to active dimension style
Name of active dimension style
LC_PROP_DRW_BLOCK handle
string
RW Handle to active block
Name of active block
LC_PROP_DRW_BARCTYPE int RW Active barcode type
LC_PROP_DRW_BARCSOLID bool RW TRUE - barcodes are solid, FALSE - outline and filling are separate
LC_PROP_DRW_LWMODE int RW Linewidth display mode (LC_LW_THIN, LC_LW_REAL, LC_LW_PIXEL)
LC_PROP_DRW_LWIDTH int RW Active linewidth (will be applied to new entities)
LC_PROP_DRW_LWDEFAULT int RW Default linewidth (for linewidth==LC_LWIDTH_DEFAULT)
LC_PROP_DRW_LWSCALE int RW Linewidth screen scale, mm / pixel (used to display linewidth LC_LW_PIXEL mode)
LC_PROP_DRW_LOCKSEL bool RW "Enable selection on locked layers" flag

   Explode options
LC_PROP_DRW_EXPLODEARC bool RW Enable exploding of arcs, circles, ellipses
LC_PROP_DRW_EXPPLINELA bool RW Explode bulge polylines: TRUE-to lines and arcs, FALSE-to lines
LC_PROP_DRW_EXPSIMPLINE bool RW Enable exploding simple polylines (to lines)
LC_PROP_DRW_EXPTEXTSPLINE bool RW If TRUE - explode TrueType text to splines, FALSE - to polylines

   Default named objects
LC_PROP_DRW_BLOCK_MODEL handle R Handle to "Model Space" block
LC_PROP_DRW_LAYER_0 handle R Handle to layer "0"
LC_PROP_DRW_LINETYPE_CONT handle R Handle to linetype "Continuous"
LC_PROP_DRW_LINETYPE_BYLAY handle R Handle to linetype "ByLayer"
LC_PROP_DRW_LINETYPE_BYBLK handle R Handle to linetype "ByBlock"
LC_PROP_DRW_TEXTSTYLE_STD handle R Handle to text style "Standard"
LC_PROP_DRW_PNTSTYLE_STD handle R Handle to point style "Standard"
LC_PROP_DRW_DIMSTYLE_STD handle R Handle to dimension style "Standard"

   Default resolution
LC_PROP_DRW_RESOLARC int RW Default resolution for arc/circle/ellipse/bulge
LC_PROP_DRW_RESOLSPLINE int RW Default resolution for splines
LC_PROP_DRW_RESOLTEXT int RW Default resolution for TTF text

   View limits
LC_PROP_DRW_LIM_MIXPIXSIZE float RW Minimal pixel size (drawing units). Denines Zoom-In limit. By default 0.001
LC_PROP_DRW_LIM_MAXLEF float RW Xmin of limits rectangle (see also lcDrwSetLimits)
LC_PROP_DRW_LIM_MAXBOT float RW Ymin of limits rectangle
LC_PROP_DRW_LIM_MAXRIG float RW Xmax of limits rectangle
LC_PROP_DRW_LIM_MAXTOP float RW Ymax of limits rectangle
LC_PROP_DRW_LIM_MAXON bool RW Enable maximal view limits (for Zoom-Out)

   User specific data
LC_PROP_DRW_INT0
 . . .

LC_PROP_DRW_INT9
int RW User integer variables
LC_PROP_DRW_FLOAT0
 . . .

LC_PROP_DRW_FLOAT9
float RW User float variables
LC_PROP_DRW_STR0
 . . .

LC_PROP_DRW_STR9
string RW User text variables
LC_PROP_DRW_XDATASIZE int RW Size of extra data (bytes)
LC_PROP_DRW_XDATA handle RW Pointer to extra data