Append DXF Files in a CADImage

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
rafaellippert
Posts: 15
Joined: 12 May 2016, 18:00

Append DXF Files in a CADImage

Post by rafaellippert » 26 Jul 2016, 00:10

Hi!
How to append DXF files in a CADImage for later export all in one DXF file?

My need is to compose a DXF containing other DXFs positioned in your body. And later that I save all in one DXF.

Thanks,
Rafaelli

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

Re: Append DXF Files in a CADImage

Post by support » 26 Jul 2016, 16:12

Hello Rafaelli,

DXF files can be appended to a CADImage as external references (XREFs) using a CADImage.AddScaledDXF method:

Code: Select all

public void AddXRef(CADImage mainImage, string xrefPath, DPoint pos, DPoint scale, float rotAngle)
{
    CADImage xRef = CADImage.CreateImageByExtension(xrefPath);
    xRef.LoadFromFile(xrefPath);
    mainImage.AddScaledDXFEx(xRef, xrefPath, pos, scale, rotAngle);
}

...

CADImage cadImage = new CADImage();
cadImage.InitialNewImage();
...

AddXRef(cadImage, "c:\\drawing.dxf", new DPoint(500, 500, 0), new DPoint(1, 1, 1), 0);
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

rafaellippert
Posts: 15
Joined: 12 May 2016, 18:00

Re: Append DXF Files in a CADImage

Post by rafaellippert » 26 Jul 2016, 17:07

Thank you,
however, so the export to DXF cadImagem will be a reference the path to the file attached DXF.
I need to become a single output file DXF, being independent of DXF files included.
How to proceed?

Thanks,

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

Re: Append DXF Files in a CADImage

Post by support » 26 Jul 2016, 18:01

Hello Rafaelli,

Unfortunately, the API doesn't have a method for merging two or more DXF files into a single output file. You may try to copy entities from the external reference CADImage to the main one, but it is not a trivial task.


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

rafaellippert
Posts: 15
Joined: 12 May 2016, 18:00

Re: Append DXF Files in a CADImage

Post by rafaellippert » 26 Jul 2016, 20:13

Hello Mikhail,
Do you have a sample of how to copy the entities of an external DXF file to the main one?

Thanks,

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

Re: Append DXF Files in a CADImage

Post by support » 26 Jul 2016, 20:56

Hello Rafaelli,

I don't have such code sample at the moment, I could try to create it if it's urgently needed.


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

rafaellippert
Posts: 15
Joined: 12 May 2016, 18:00

Re: Append DXF Files in a CADImage

Post by rafaellippert » 26 Jul 2016, 23:00

Ok Mikhail,
please if you can help me with an example I would greatly appreciate it. Because basically that's what I need to advance on the project with the CADSOFT tool.

Thanks,

rafaellippert
Posts: 15
Joined: 12 May 2016, 18:00

Re: Append DXF Files in a CADImage

Post by rafaellippert » 05 Oct 2019, 00:32

Hello!
Do you have any news about this?
I'm need to attach DXF file into other DXF File.

Thanks,
RafaelLi

Post Reply