Page 1 of 1

Create GCode of merged dxf

Posted: 03 Jan 2018, 06:49
by 303248153
Hey, I'm trying to use CAD.NET to create gcode from merged dxf, however there only 3 lines in the output.
F0
S 0
G0 Z0
The method I used to merge dxf is AddScaledDXF, which adds dxf as a xref, and the method I used to generate gcode is CADtoGCode.CreateCode.
I think the reason is CADtoGCode doesn't support xref, so there 2 solution:

- embed all xrefs into one dxf
- make CADtoGCode support xref

I don't know how to do either of them, please help me.

Re: Create GCode of merged dxf

Posted: 15 Jan 2018, 17:09
by support
Hello,

We can try to provide XREFs support for CADtoGCode.CreateCode method, it will require changes in the source code of the library. Please send your merged DXF files to support@cadsofttools.com for examination.


Mikhail

Re: Create GCode of merged dxf

Posted: 06 May 2020, 22:09
by glmoore
Hello,


I am having the same issue.

Code: Select all

var
  Form1: TForm1;
  DXFimage: TsgCADdxfImage;
  CADimage: TsgCADimage;
  CADtoGCODE: TsgCADtoGCODE;

implementation

{$R *.dfm}

procedure TForm1.btn_select_dxfClick(Sender: TObject);
var
  DXF_FileStream: TMemoryStream;
  I: Integer;
  vT:   TsgDXFText;
  S: String;

begin
  {// Select DXF File  ###DRMJ###}
  if(OpenDialog1.Execute = TRUE) then
  begin
    {// LOAD DXF FILE:    ###DRMJ###}
    lbl_dxf_filename.Caption := OpenDialog1.FileName;
    DXFimage := TsgCADdxfImage.Create;
    DXFimage.LoadFromFile(OpenDialog1.FileName);

    DXF_Data.Lines.LoadFromFile(OpenDialog1.FileName);

  end;
end;

procedure Tform1.btn_convert_to_gcodeClick(Sender: TObject);
var
  GCode_FileStream: TMemoryStream;

begin
  //start here
  CADtoGCode := TsgCADtoGCode.Create(DXFimage);

  CADtoGCode.MakeGCode;

  GCode_FileStream := TMemoryStream.Create;

  CADtoGCode.SaveToStream(GCode_FileStream);
  GCode_FileStream.Position := 0;

  gcode_data.Lines.LoadFromStream(GCode_FileStream);

end;