CAD VCL for Delphi - actual code samples?

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

Moderators: SDS, support, admin

Post Reply
spambox
Posts: 1
Joined: 04 May 2014, 11:21

CAD VCL for Delphi - actual code samples?

Post by spambox » 04 May 2014, 11:49

Hello,

at this moment I am trying your CAD VCL for Delphi. Most time I work with CAD VCL Library Help (http://www.cadsofttools.com/help/cadvcl/). I occasionally encounter errors (code mistakes/outdated functions) - mostly caused by ongoing development/updates. This brought me here:

1)
Please, do you have actual code samples? Your examples use for load DXF(CAD) files type TPicture, sometimes TsgCADDXFImage, TsgCADImage or TsgDrawingNavigator. What is correct sample code for load all possible CAD files (with access to all entities, navigations etc.)? Why procedure "InitializeSections" is marked as deprecaded? Is it outdated? Can I load all possible (supported) CAD files into one shared class?

2)
Can your VCL load DXF files in ASCII and binary format? Inside your help library, you type that ONLY ASCII is supported.

3)
I have some DXF files which VCL not show (no error, only blank output) but other CAD applications can open and show it without problem. Do you have list of entities you not supported via VCL? Or have VCL some restrictions for loading CAD files?

4)
Does VCL have inbuilt functions as:
- change all entities in DXF to LINE/CIRCLE/ARC
- intersection point between two entities
- split entities (one LINE/ARC split to two LINEs/ARCs)

Thank you.
Age

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

Re: CAD VCL for Delphi - actual code samples?

Post by support » 06 May 2014, 12:26

Hello,

It's possible to load all supported CAD files into one shared class - TsgCADImage. TsgCADdxfImage, TsgDWGImage, TsgHPGLImage, TsgSVGImage, TsgCGMImage are the descendants of TsgCADImage class, so you can create an instance of TsgCADImage descendant depending on the file extension. For example:

Code: Select all

var
  Img: TsgCADImage;
...

Img := TsgCADdxfImage.Create;   // TsgCADdxfImage class is used for reading DXF files
TsgDrawingNavigator is intended for displaying the loaded drawing, it doesn't provide access to the entities. You can load a file directly to TsgDrawingNavigator using TsgDrawingNavigator.LoadFromFile() method or assign TsgCADImage class instanse to TsgDrawingNavigator:

Code: Select all

var
  Img: TsgCADImage;
  DNavigator: TsgDrawingNavigator;
...

DNavigator.Picture.Assign(Img);
CAD VCL supports both ASCII and binary DXF formats. The supported entities are listed in the Classes Reference > CAD Database structure > Entities section of the help file.

CAD VCL has GetIntersectingPoint function that allows to find the intersection point between two lines and several functions that split LINE/ARC with LINE/ARC/POINT (in sgFunction.pas):

SplitArcPt
SplitArcPt2
SplitArcWithArc
SplitArcWithLine
SplitLinePt
SplitLinePt2
SplitLineWithArc
SplitLineWithLine

These functions are auxiliary, that means they doesn't change the entities, just calculate points/angles/radius of the resulting LINEs/ARCs.


Mikhail.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply