Page 1 of 1
Append DXF Files in a CADImage
Posted: 26 Jul 2016, 00:10
by rafaellippert
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
Re: Append DXF Files in a CADImage
Posted: 26 Jul 2016, 16:12
by support
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
Re: Append DXF Files in a CADImage
Posted: 26 Jul 2016, 17:07
by rafaellippert
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,
Re: Append DXF Files in a CADImage
Posted: 26 Jul 2016, 18:01
by support
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
Re: Append DXF Files in a CADImage
Posted: 26 Jul 2016, 20:13
by rafaellippert
Hello Mikhail,
Do you have a sample of how to copy the entities of an external DXF file to the main one?
Thanks,
Re: Append DXF Files in a CADImage
Posted: 26 Jul 2016, 20:56
by support
Hello Rafaelli,
I don't have such code sample at the moment, I could try to create it if it's urgently needed.
Mikhail
Re: Append DXF Files in a CADImage
Posted: 26 Jul 2016, 23:00
by rafaellippert
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,
Re: Append DXF Files in a CADImage
Posted: 05 Oct 2019, 00:32
by rafaellippert
Hello!
Do you have any news about this?
I'm need to attach DXF file into other DXF File.
Thanks,
RafaelLi