How to add spline?

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

Moderators: SDS, support, admin

Post Reply
hustwjz
Posts: 9
Joined: 30 Mar 2006, 05:48
Location: China

How to add spline?

Post by hustwjz » 28 Aug 2006, 13:13

I hope to add spline and draw it on screen.
I have refered to help file of VCLExport, but I can not find a function such as AddSpline.
How can I achieve it?Please give me an example.
Thanks in advance


Thought that I found a powerfull CAD tool, keep on testing.....

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

Post by support » 28 Aug 2006, 14:58

Hello!

Currently we work on direct export. It will allow adding of the SPLINE entity. We plan to release it approximately to the beginning of November, 2006.

DXFExportVCL v.5.2.5 (release of June, 2006) supports adding of the PolyBezier. Please use the following code:

Code: Select all

<b>procedure</b> TfmDXFExporter.Forum_310_Button5Click(Sender: TObject);
<b>var</b>
  vDXF: TsgDXFExport;
  Data: TdxfExportData;
  Pt: PexpPoint;
  I: Integer;

  <b>procedure</b> FreeDataPoints;
  <b>var</b>
    J, K: Integer;
  <b>begin
    for</b> K := 0 <b>to</b> Data.Points.Count - 1 <b>do
    begin
      for</b> J := 0 <b>to</b> TList(Data.Points[K]).Count - 1 <b>do</b>
        Dispose(PexpPoint(TList(Data.Points[K]).Items[J]));
      TList(Data.Points[K]).Free;
    <b>end</b>;
    Data.Points.Free;
  <b>end</b>;

<b>begin
  if not</b> SaveDialog1.Execute <b>then</b>
    Exit;
  vDXF := TsgDXFExport.Create;
  <b>try</b>
    FillChar(Data, SizeOf(Data), 0);
    Data.Color := DXF_PURPLE;
    Data.Count := High(arrBezier)-Low(arrBezier)+1;
    Data.Points := TList.Create;
    Data.Points.Add(TList.Create);
    <b>for</b> I := 0 <b>to</b> Data.Count - 1 <b>do
    begin</b>
      New(Pt);
      Pt^.X := arrBezier[I].X;
      Pt^.Y := -arrBezier[I].Y;
      Pt^.Z := 0;
      TList(Data.Points[0]).Add(Pt);
    <b>end</b>;
    vDXF.AddPolyBezier(Data, 0);

    FreeDataPoints;
    vDXF.SaveToFile(SaveDialog1.FileName);
  <b>finally</b>
    vDXF.Free;
  <b>end</b>;
<b>end</b>;
Sergey.


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

hustwjz
Posts: 9
Joined: 30 Mar 2006, 05:48
Location: China

Post by hustwjz » 31 Aug 2006, 12:07

Thank you for your quick response

Thought that I found a powerfull CAD tool, keep on testing.....

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

Post by support » 17 Aug 2007, 11:10

Hello!

We have made a new product CAD Export VCL. It supports absolutely identical export to DXF file format.
Please contact to our executive manager Evgeny Chuzhakin for the question of getting trial version of the library. His e-mail is info@cadsofttools.com.

Sergey.

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

Post Reply