setting starting coordinate & dimensions (export)

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: SDS, support, admin

Post Reply
digitiger
Posts: 19
Joined: 29 May 2006, 10:01

setting starting coordinate & dimensions (export)

Post by digitiger » 09 Jun 2006, 12:24

Dear all

I am trying to export some drawing (drawn on the form's canvas) to a dxf. Currently I first export it to and emf file, then load it into dxfexporter and then save it to dxf file. I find this much simpler in comparison to drawing each and every entity individually as given in the included example.

Is there any other way also to export the drawing on Form's canvas to DXF?


Also unfortuantely, I have not been able to figure out as how to specify the co-ordinates (for example I need my the lowerLeft point of drawing to be shown as 1000,1000). Secondly the distance between any two points also get reduced to about 84.46%. For example if a line drawn on form canvas starting at poing 1000,1000 and going to 2000,1000, when exported to DXF becomes a line starting from 77,-616 to 923,-616 ( with approximate length of 846 units instead of 1000).

Can some one of you please guide me to more efficient solution.

thanking you in advance

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Post by support » 09 Jun 2006, 16:32

Hello,

<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Is there any other way also to export the drawing on Form's canvas to DXF?<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
The following code draws line on Form's canvas and exports it from Form's canvas to DXF file:

Code: Select all

<b>procedure</b> TForm1.FormPaint(Sender: TObject);
<b>begin</b>
  Canvas.MoveTo(0, 0);
  Canvas.LineTo(100, 100);
<b>end</b>;
...
<b>procedure</b> TForm1.DXFExportTect2521Click(Sender: TObject);
<b>var</b>
  E: TsgDXFExport;
<b>begin
  try</b>
    E := TsgDXFExport.Create;
    PaintTo(E.Canvas.Handle, 0, 0);
    E.EndDraw;
    E.SaveToFile('D:\1.dxf');
  <b>finally</b>
    E.Free;
  <b>end</b>;
<b>end</b>;
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Also unfortuantely, I have not been able to figure out as how to specify the co-ordinates (for example I need my the lowerLeft point of drawing to be shown as 1000,1000). Secondly the distance between any two points also get reduced to about 84.46%. For example if a line drawn on form canvas starting at poing 1000,1000 and going to 2000,1000, when exported to DXF becomes a line starting from 77,-616 to 923,-616 ( with approximate length of 846 units instead of 1000).<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
This problem is already solved. We implemented <b>double</b> precision in current (<b>May 2006</b>) DXF Eport VCL v.5.2.5 (available on: http://www.cadsofttools.com/download/dxfexportvcl.zip).

The example above was taken from the DXF Export Demo (in the ..\dxfexportvcl\Delphi\.. folder).

Sergey.

please post questions to the forum or write to support@cadsofttools.com

digitiger
Posts: 19
Joined: 29 May 2006, 10:01

Post by digitiger » 14 Jun 2006, 08:47

Thanks

Post Reply