Creating a drawing by lines & points
Moderators: SDS, support, admin
Creating a drawing by lines & points
Hello,
I found CAD Import VCL interesting.
How to create a canvas / picture box and then draw some shapes lines / points on it?
Could you please post example in delphi?
i tried one of your reference code, but i stuck at " Im := TsgCADImage(sgPaintBox.Picture.Graphic);" point.
There is error of "undeclared identifier" for MakeFPoint and AddEntity functions. Do i need to add any library?
I don't want to use any of demo code straight away.
I found CAD Import VCL interesting.
How to create a canvas / picture box and then draw some shapes lines / points on it?
Could you please post example in delphi?
i tried one of your reference code, but i stuck at " Im := TsgCADImage(sgPaintBox.Picture.Graphic);" point.
There is error of "undeclared identifier" for MakeFPoint and AddEntity functions. Do i need to add any library?
I don't want to use any of demo code straight away.
Re: Creating a drawing by lines & points
Hello Khyati.
CAD Import VCL library structure is similar to CAD Import .NET. You need create TsgCADImage object, add entities to it and visualize. CAD Import VCL provides TsgDrawingNavigator class that can be used for displaying TsgCADImage object:
MakeFPoint method declared in sgConsts unit. Please include it in uses clause of your application. AddEntity is the local procedure of demo application and can't be called from your application. Please see AddNewEntities demo for details.
Alexander.
CAD Import VCL library structure is similar to CAD Import .NET. You need create TsgCADImage object, add entities to it and visualize. CAD Import VCL provides TsgDrawingNavigator class that can be used for displaying TsgCADImage object:
Code: Select all
type
TfmMain = class(TForm)
......
private
FsgPaintBox: TsgDrawingNavigator;
.....
var
vImg: TsgCADImage;
begin
FsgPaintBox := TSGDrawingNavigator.Create(Self);
FsgPaintBox.Parent := Self;
FsgPaintBox.Align := alClient;
vImg := TsgCADImage.Create;
try
vImg.Converter.InitializeSections;
vImg.CurrentLayout := vImg.Layouts[0];
FsgPaintBox.Picture.Graphic := vImg;
finally
vImg.Free;
end;
end;
MakeFPoint method declared in sgConsts unit. Please include it in uses clause of your application. AddEntity is the local procedure of demo application and can't be called from your application. Please see AddNewEntities demo for details.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Creating a drawing by lines & points
Thanks! It was useful code.
Are there mouse down / mouse click / mouse double click events included with CADImport VCL?
How to trigger them? (in Delphi 2010?)
Are there mouse down / mouse click / mouse double click events included with CADImport VCL?
How to trigger them? (in Delphi 2010?)
Re: Creating a drawing by lines & points
Hello.
TsgDrawingNavigator class inherits most of its events from TCustomControl (Delphi class). You can modify any such event by redefining event handler. Please see any demo source for example.
Alexander.
TsgDrawingNavigator class inherits most of its events from TCustomControl (Delphi class). You can modify any such event by redefining event handler. Please see any demo source for example.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support