How to join two files?
Moderators: SDS, support, admin
-
- Posts: 26
- Joined: 23 Feb 2009, 12:30
How to join two files?
How can I join , for example two cgm files, from one point?
Re: How to join two files?
Hello!
Please try the following code:
Sergey.
Please try the following code:
Code: Select all
uses
..., SGDrawingNavigator, sgConsts, CADImage, DXFConv, CGM;
...
procedure TForm1.btnAddScaledDXFClick(Sender: TObject);
var
vInsImg, vImg: TsgCGMImage;
begin
vImg := TsgCGMImage.Create;
vInsImg := TsgCGMImage.Create;
try
vImg.LoadFromFile('c:\first.cgm');
vInsImg.LoadFromFile('c:\second.cgm');
vImg.AddScaledDXFEx(vInsImg, 'c:\second.cgm',
MakeFPoint(0,0,0),
MakeFPoint(1,1,1),0.0);
vImg.GetExtents;
finally
vImg.Free;
vInsImg.Free;
end;
end;
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
-
- Posts: 26
- Joined: 23 Feb 2009, 12:30
Re: How to join two files?
So thanks but I did it. But my problem is now : Second file doesnt be shown on X:200 Y:200,
my code is here :
Am I wrong?
my code is here :
Code: Select all
var
vGlobalCADFile: TsgDXFImage;
vCADFiles: array [0..1] of TObject;
begin
vGlobalCADFile := TsgDXFImage.Create;
vCADFiles[0] := TsgCGMImage.Create;
TsgDXFImage(vCADFiles[0]).LoadFromFile('D:\dw\52699.cgm');
vGlobalCADFile.AddScaledDXF(
vCADFiles[0],
'52699',
MakeFPoint(0, 0, 0),
MakeFPoint(1, 1, 1),
0.0);
vCADFiles[1] := TsgCGMImage.Create;
TsgDXFImage(vCADFiles[1]).LoadFromFile('D:\dw\54599.cgm');
vGlobalCADFile.AddScaledDXF(
vCADFiles[1],
'54599',
MakeFPoint(200, 200, 0), // *** Same as MakeFPoint(0, 0, 0) ***
//It doesnt be drawn on X:200,Y:200
MakeFPoint(1, 1, 1),
0.0);
vGlobalCADFile.GetExtents;
sgPaintBox.Picture.Graphic := vGlobalCADFile;
end;
Am I wrong?
Re: How to join two files?
Hello!
We tested your code. It worked. We would recommend to use MakeFPoint(2000, 2000, 0) or MakeFPoint(20000, 20000, 0) in the second call of AddScaledDXF. It would make changes visible.
Sergey.
We tested your code. It worked. We would recommend to use MakeFPoint(2000, 2000, 0) or MakeFPoint(20000, 20000, 0) in the second call of AddScaledDXF. It would make changes visible.
Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
-
- Posts: 26
- Joined: 23 Feb 2009, 12:30
Re: How to join two files?


As a result, I want to merge two files from intersection of red lines which user pick. And then one. And then one.
How can I do that?
Last edited by DarkEternal on 14 Apr 2009, 14:11, edited 1 time in total.
Re: How to join two files?
Hello,
It is necessary to use AddScaledDXF method. Please take a look at the examples in previouse posts.
Sergey.
It is necessary to use AddScaledDXF method. Please take a look at the examples in previouse posts.
Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
-
- Posts: 26
- Joined: 23 Feb 2009, 12:30
Re: How to join two files?
How Can I find intersection of red lines points and join?
Re: How to join two files?
CAD Import VCL contains a set of special functions which allow determining intersection point between different objects such as lines, arcs etc.
First of all it is necessary to determine what exactly objects create necessary intersection.
Sergey.
First of all it is necessary to determine what exactly objects create necessary intersection.
Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
-
- Posts: 26
- Joined: 23 Feb 2009, 12:30
Re: How to join two files?
Do you have any example for me?
I want to find just X and Y of point?
I want to find just X and Y of point?
Re: How to join two files?
Could you please send us your file example to support@cadsofttools.com? Please make a reference to this topic in the e-mail.
Sergey.
Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
-
- Posts: 26
- Joined: 23 Feb 2009, 12:30
Re: How to join two files?
I have send files...
Re: How to join two files?
We work on this question. We will answer you soon.
Sergey.
Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: How to join two files?
Here goes a description how to fulfill the describe task:
- open file container
- search for lines to be intersected; in your file examples they are TsgDXFPolylines with Red color;
- search for intersections between lines found in the previous step; we recommend to use IsCrossSegmentsPts which is available in CAD Import VCL v.7 beta;
- open file to be stored in the file container;
- insert file to every found intersection points; function AddScaledDXFEx has to be used. If a number of intersection points are more then one, the following algorithm should be used:
- AddScaledDXFEx returns TsgDXFInsert object, vXRefIns, for instance;
- TsgDXFInsert contains TsgDXFBlock;
- create new TsgDXFInsert object;
- equate vXRefIns.Block to the new TsgDXFInsert.Block;
- set new insert point to TsgDXFInsert.Point (next intersection point);
- add new TsgDXFInsert object to the file contaner.
- get CADImage object from vXRefIns: TsgDXFInsert->TsgDXFBlock->TsgDXFXref->TsgCADImage.
- open next file to be stored in the file container;
- repeat steps from 2 to 5;
- repeat steps 6 and 7 if it is necessary.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
-
- Posts: 26
- Joined: 23 Feb 2009, 12:30
Re: How to join two files?
Is there any more easy way?
Can I put signs on points from autoCad and can I find them with Cad Import Vcl 6.1? First I think that.
Or do you have any easy way suggest?
Can I put signs on points from autoCad and can I find them with Cad Import Vcl 6.1? First I think that.
Or do you have any easy way suggest?
Re: How to join two files?
You sent us CGM files. This is not AutoCAD file format. So we suppose it is impossible to make changes to CGM files with AutoCAD.
Accordingly to AutoCAD files and sings on points. It is possible to find anyone object in a drawing if it exists by CAD Import VCL. Please send us (to support@cadsofttools.com) file example to study it and to prepare detailed answer.
Sergey.
Accordingly to AutoCAD files and sings on points. It is possible to find anyone object in a drawing if it exists by CAD Import VCL. Please send us (to support@cadsofttools.com) file example to study it and to prepare detailed answer.
Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support