How to extract only a region from a DXF/DWG file

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

Moderators: SDS, support, admin

Post Reply
Emil
Posts: 8
Joined: 22 Sep 2005, 11:31
Location: Germany
Contact:

How to extract only a region from a DXF/DWG file

Post by Emil » 22 Sep 2005, 11:58

Hello

I am currently testing CAD Import VCL, it looks very good. I have a special quesion:

We develop a program for displaying environmental data (e.g. groundwater level) as contour maps. Some of our clients want do display DXF/DWG plans (roads, buildings etc.) in combination with the contour maps which are created with our software. But often the contour map covers only a certain (rectangular) region of the CAD plan, which means that only a part of the CAD plan has to be displayed. The boundaries of the contour map are known (in world coordinates), can I tell CAD Import VCL to read only those elements which are inside the rectangle defined by our contour map?

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

Post by support » 22 Sep 2005, 17:03

Hi,

We are close to finish a demo on this question. We'll inform you immediately when it will be available.

Sergey.

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

Emil
Posts: 8
Joined: 22 Sep 2005, 11:31
Location: Germany
Contact:

Post by Emil » 04 Jan 2006, 12:47

Hello,

in the meantime we purchased CAD Import VCL (ribeka Software). I would like to know if the demo is now availabale because the described question is very important to us.

Thanks
Emil

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

Post by support » 06 Jan 2006, 19:09

Hello,

CADImportVCL package (available on: http://www.cadsofttools.com/download/CADImportVCL.zip) contains Demo Viewer (in CADImportVCL\Delphi\Demos\Viewer folder). There is a code in this demo (in unit Unit1.pas):

Code: Select all

 
<b>procedure</b> TForm1.sbDrawingBoxClick(Sender: TObject);
<b>begin</b>
  <b>if</b> Img = <b>nil</b> <b>then</b> Exit;
  sbDrawingBox.Down := sbDrawingBox.Down <b>or</b> False;
  Enable3DOrbit(not sbDrawingBox.Down);
  <b>if</b> sbDrawingBox.Down <b>then</b>
    Img.DrawingBox := MakeFRect((Img.CurrentLayout.Box.Left + Img.CurrentLayout.Box.Right) / 2,
      Img.CurrentLayout.Box.Top, Img.CurrentLayout.Box.Z1, Img.CurrentLayout.Box.Right, 
      Img.CurrentLayout.Box.Bottom, Img.CurrentLayout.Box.Z2)
  <b>else</b>
    Img.ResetDrawingBox;
  sgPaintBox.Width := Img.Width;
  sgPaintBox.Height := Img.Height;
  sgPaintBox.Align := alClient;
  sgPaintBox.Invalidate;
<b>end</b>;
Here DrawingBox is set in the absolute drawing coordinates and at the same time the drawing itself takes sizes (height and width) of the given parallelepiped. The example above shows how to specify a DrawingBox for displaying a half of the drawing. This way any part of the drawing can be displayed in the global (world) CAD-drawing coordinates.
If this explanation is not exactly what you need could you please create a common example of usage or we can do it if you give us a detailed description of what you need.

Sergey.

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

Emil
Posts: 8
Joined: 22 Sep 2005, 11:31
Location: Germany
Contact:

Post by Emil » 06 Jan 2006, 22:56

Hello

thank you for your quick reply.

Post Reply