CAD VCL for Delphi - actual code samples?
Moderators: SDS, support, admin
CAD VCL for Delphi - actual code samples?
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
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
Re: CAD VCL for Delphi - actual code samples?
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:
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:
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.
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
Code: Select all
var
Img: TsgCADImage;
DNavigator: TsgDrawingNavigator;
...
DNavigator.Picture.Assign(Img);
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
Chat support on Skype: cadsofttools.support