Page 1 of 1

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

Posted: 22 Sep 2005, 11:58
by Emil
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?

Posted: 22 Sep 2005, 17:03
by support
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

Posted: 04 Jan 2006, 12:47
by Emil
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

Posted: 06 Jan 2006, 19:09
by support
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

Posted: 06 Jan 2006, 22:56
by Emil
Hello

thank you for your quick reply.