procedure TForm1.LayerInformationClick(Sender: TObject);
var
vDrawing: TsgCADDXFImage; //a class for DXF format reading
I: Integer;
S: string;
begin
vDrawing := TsgCADDXFImage.Create; //TsgDXFImage is a class for DXF file reading
vDrawing.LoadFromFile('Entities.dxf');
// get all blocks from the drawing
S := 'Layers from file Entities.dxf : ';
for I := 0 to vDrawing.Converter.Sections[csLayers].Count - 1 do
S := S + vDrawing.Converter.Sections[csLayers][I].Name + '; ';
ShowMessage('Layers count: ' + IntToStr(vDrawing.Converter.Sections[csLayers].Count) +
#13 + S);
vDrawing.Free;
end;
Go to CAD VCL Enterprise