Create rectangle without loading file

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

Moderators: SDS, support, admin

Post Reply
MikeD
Posts: 16
Joined: 27 Jan 2015, 17:45

Create rectangle without loading file

Post by MikeD » 10 Feb 2015, 10:54

Hi,

I've come across an issue that I would like to solve.
I can load a .dxf file and then add a solid I created programmatically.

When I only want to load the programmatically created solid (or rectangle or whatever) I can't seem to get it working because the program obviously awaits a LoadedCADImage (like in the sample files).
Now the problem is that FDN.Picture.Graphic is nil because I never used "LoadFromFile('...').
How can I load my own TsgCADImage into the drawing Navigator without preloading a file?

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

Re: Create rectangle without loading file

Post by support » 10 Feb 2015, 17:01

Hello Mike,

It is possible to create a new TsgCADImage instance and load it into TsgDrawingNavigator using the code below:

Code: Select all

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

Img := TsgCADImage.Create;
Img.Converter.InitializeSections;
Img.CurrentLayout := Img.Layouts[0];
DNavigator.Picture.Graphic := Img;
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply