Page 1 of 1

DXF Export (VCL): Text Labels not in DXF

Posted: 15 Sep 2009, 02:04
by erzsebet
Hello,

I am demoing CADSoftTools DXF Export for VCL with a Delphi 7 application that uses MapObjects LT 2.0. I use the MapObjects method, ExportMap2 to write the visible extent of a map to an enhanced metafile. I then pass this metafile to the DXF Export method, ExportToDXF with the XP_USE01MM flag. When I open the DXF which is created, none of the text labels on the map are appearing in the image. When I open the DXF in a text editor, a confirms that the map labels were not written to the file. Do you know of anything that could be causing the text to be missing?

The code:

Code: Select all

function ExportToDXF(Hanlde: THandle; FileName: PChar; Flags: DWORD): Integer; stdcall; external 'C:\DXFExp.dll' name 'ExportToDXF';

procedure TMapPage.SaveClick(Sender: TObject);
var
   DFXFile: string;
   Path: string;
   AMetaFile : TMetafile;
begin
  if not Assigned(Map) then exit; // Map is an ESRI  TMapLT object

  if TMenuItem(Sender).Tag = 0 then begin
    with TSaveDialog.Create(Self) do try
      InitialDir := ShellDir('Personal');
      DefaultExt := 'dfx';
      Filter := 'DXF Files (*.dxf) | *.dxf';
      Execute;
      DFXFile := Filename;
    finally Free end;
  end;
  if (Copy(DFXFile, Length(DFXFile)-3,4) = '.dxf') then begin
  try
    try
      Map.ExportMap2(moExportEMF, DFXFile, 1, True);
      AMetaFile := TMetafile.Create;
      AMetaFile.Enhanced := True;
      AMetaFile.LoadFromFile(DFXFile);
      if (AMetaFile.HandleAllocated) then
        ExportToDXF(AMetaFile.Handle, PChar(DFXFile), XP_USE01MM)
   finally
    AMetaFile.Free;
   end;
  except
    on E : Exception do
      ShowMessage('Error : ' + E.Message);
    end;
  end;
Thanks,

erzsebet

Re: DXF Export (VCL): Text Labels not in DXF

Posted: 15 Sep 2009, 15:54
by support
Hello.

Can you send us typical metffile with problem occured on support?

Anton

Re: DXF Export (VCL): Text Labels not in DXF

Posted: 15 Sep 2009, 19:05
by erzsebet
Anton, hi -

I just sent the file.

Thanks!

erzsebet

Re: DXF Export (VCL): Text Labels not in DXF

Posted: 16 Sep 2009, 17:16
by support
Hello!

Thank you for the files.
Your metafile does not contain text (TEMR.iType = EMR_SETWINDOWEXTEX). They are the raster images and can not export to DXF as text.

Best regards,
Anton