TsgDXFHatch & Delphi 5

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

Moderators: SDS, support, admin

Post Reply
Fabien
Posts: 6
Joined: 20 Oct 2005, 11:44
Location: France

TsgDXFHatch & Delphi 5

Post by Fabien » 20 Oct 2005, 11:51

Hello !

My company has recently bought the last version of your software CADImportVCL for Delphi 5.

I would like to know if it is possible to reproduce a Hatch entity into a Delphi 5 Canvas, and of course how can we do it ?

Thanks for your reply !

Best regard,

Fabien.

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

Post by support » 20 Oct 2005, 16:31

Hello,

There are examples of drawing of entities in DXFImage.pas (http://www.cadsofttools.com/download/CADImportVCL.zip)
According to HATCH it is necessary to use DXFImage.DrawHatch (where Sender - is TsgDXFHatch)
But in this case entities are drawn in canvas Rect taking into account dimension of the whole drawing (similarly TGraphic).


Could you please explain in detail your needs for we could give you maximum of help.
Whether you need separate entity (TsgDXFHatch) to separate Canvas into the specified Rect?

Sergey.

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

Fabien
Posts: 6
Joined: 20 Oct 2005, 11:44
Location: France

Post by Fabien » 20 Oct 2005, 18:11

Thanks for your support, sergey !

What I want to do is to identify the exact area where is aplied the hatch. This hatch would be then identify as a brush property of any shape i want to draw in a delphi canvas, like polylines, circles, etc.

Is it possible ?

Even if the hatch style is not the same as the DXF one, I want to draw something in the right area.

Thanks !

Fabien.

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

Post by support » 21 Oct 2005, 19:54

Dear Fabien,

Following code shows how to get access to HATCH's boundaries:

Code: Select all

<b>procedure</b> YourProc(AHatch: TsgDXFHatch);
<b>var</b>
    vList: TList;
    vFP: TFPoint;
    I, J: Integer;
<b>begin</b>
    ////...
    <b>for</b> I := 0 <b>to</b> AHatch.Polylines.Count - 1 <b>do
    begin</b>
      vList := AHatch.Polylines[I];// I - index of hatch boundary
      <b>for</b> J := 0 <b>to</b> vList.Count - 1 <b>do      
      begin</b>
        vFP.X := PsgHElem(vList[J]).X;// J index of PsgHElem in current I-boundary
        vFP.Y := PsgHElem(vList[J]).Y;
        // Adding to list of TPoint for draw to Canvas
        ////...
      <b>end</b>;
    <b>end</b>;
    ////...
<b>end</b>;
Sergey.

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

Fabien
Posts: 6
Joined: 20 Oct 2005, 11:44
Location: France

Post by Fabien » 24 Oct 2005, 13:48

This code works perfectly, sergey !
This is what I want to do, thank you Sergey !

Thanks for your support !

Fabien
Posts: 6
Joined: 20 Oct 2005, 11:44
Location: France

Post by Fabien » 15 Jun 2006, 13:38

Hello !

The support gave me this code last year :

Code: Select all

<b>procedure</b> YourProc(AHatch: TsgDXFHatch);
<b>var</b>
    vList: TList;
    vFP: TFPoint;
    I, J: Integer;
<b>begin</b>
    ////...
    <b>for</b> I := 0 <b>to</b> AHatch.Polylines.Count - 1 <b>do
    begin</b>
      vList := AHatch.Polylines[I];// I - index of hatch boundary
      <b>for</b> J := 0 <b>to</b> vList.Count - 1 <b>do      
      begin</b>
        vFP.X := PsgHElem(vList[J]).X;// J index of PsgHElem in current I-boundary
        vFP.Y := PsgHElem(vList[J]).Y;
        // Adding to list of TPoint for draw to Canvas
        ////...
      <b>end</b>;
    <b>end</b>;
    ////...
<b>end</b>;
My question was :

<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">What I want to do is to identify the exact area where is aplied the hatch. This hatch would be then identify as a brush property of any shape i want to draw in a delphi canvas, like polylines, circles, etc.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">

My problem now, with the V. 5.2.5 that I downloaded previously, is :
<b>this code no longer works.</b>

Can someone from the support give me some help to update this code ?

Thanks for your help.

Best regards,
Fabien.

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

Post by support » 15 Jun 2006, 17:10

Hello Fabien!

We have made a lots of changes in CADImportVCL v.5.2.5 (available on: http://www.cadsofttools.com/download/cadimportvcl.zip). A lot of bugs have been fixed and a lots of improvements have been implemented. Some of these changes have been made in HATCH entity. TsgDXFHatch was replaced by TsgCADHatch etc.

Please try the following construction:

Code: Select all

<b>for</b> I := 0 <b>to</b> I < TsgCADHatch.Boundaries.Count - 1 <b>do
begin</b>
  vList := TsgCADHatch.Boundaries[I]
  <b>for</b> J := 0 <b>to</b> J < vList.Count - 1 <b>do
  begin</b>
      TFPoint := PFPoint(vList[J])^;
  <b>end</b>;
<b>end</b>;
Sergey.

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

Fabien
Posts: 6
Joined: 20 Oct 2005, 11:44
Location: France

Post by Fabien » 15 Jun 2006, 18:16

Thanks Sergey, that works perfectly [;)]

Got another (last ?) question [:D]

Somewhere in my code, i have this property :

Code: Select all

TsgDXFHatch(Entite).Pen.Width
But, there is no TsgCADHatch(Entite).Pen.Width.
What is the actual property for the Pen Width of the hatch ?

Thanks for your help [^]

Fabien.

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

Post by support » 16 Jun 2006, 12:40

Hello Fabien!

Thank you for your note! This is our defect. Currently there is no way to set the pen width for HATCH. We'll fix this bug and inform you.

Sergey.

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

Fabien
Posts: 6
Joined: 20 Oct 2005, 11:44
Location: France

Post by Fabien » 27 Jun 2006, 15:54

Thanks Sergey !

Then, i'll check this topic until you inform me in there.

Regards,

Fabien.

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

Post by support » 16 Aug 2007, 17:36

Hello, Fabien!

Property TsgCADHatch.LineWeight solves this problem. Is is available in CAD Import VCL since version 6.

Please contact to our executive manager Evgeny Chuzhakin for the question of getting updates. His e-mail is info@cadsofttools.com.

Sergey.

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

Post Reply