Code sample Home

Retrieve coordinates of Point entities (placed in active block).
void DemoGetPoints (HANDLE hLcWnd)
{
  HANDLE hBlock, hLayer, hEnt;
  int    EntType;
  double X, Y;
  WCHAR  szLayerName[256], szLayerName2[256];

  // get a block, linked with CAD window
  hBlock = lcPropGetHandle( hLcWnd, LC_PROP_WND_BLOCK );
  // enumerate entities
  hEnt = lcBlockGetFirstEnt( hBlock );
  while( hEnt != 0 ){
    // get entity's type
    EntType = lcPropGetInt( hEnt, LC_PROP_ENT_TYPE );
    if (EntType == LC_ENT_POINT){
      // get point coordinates
      X = lcPropGetFloat( hEnt, LC_PROP_POINT_X );
      Y = lcPropGetFloat( hEnt, LC_PROP_POINT_Y );
      // get point layer (name)
      wcscpy( szLayerName, lcPropGetStr( hEnt, LC_PROP_ENT_LAYER ));
      // get point layer (handle)
      hLayer = lcPropGetHandle( hEnt, LC_PROP_ENT_LAYER );
      // get layer name by handle (szLayerName and szLayerName2 will be the same)
      wcscpy( szLayerName2, lcPropGetStr( hLayer, LC_PROP_LAYER_NAME ));
    }
    // get next entity of the block
    hEnt = lcBlockGetNextEnt( hBlock, hEnt );
  }
}
See Also:

Get an array of coordinates of point entities on specific layer
Load a drawing file and retrieve coordinates of Point entities