Hello!
When using aspose.cad to convert dwg to dxf, two issues were encountered:
- Use
CadImage cadImage = (CadImage) Image.load(dwgPath);
cadImage.save(outFile);
When using the method, the conversion result may result in the loss of vector data such as annotated text and fillers on the drawing;
- Use
CadRasterizationOptions cadOptions = new CadRasterizationOptions();
ImageOptionsBase dxfOptions = new DxfOptions();
cadImage.save(outFile, dxfOptions);
When the ImageOptionsBase method is used as an input parameter, the processing result has a high degree of restoration, but the geographic coordinate information of the CAD source file will not be retained, resulting in the inability to perform secondary development of coordinate conversion in the future;
May I ask how to balance or be compatible between the two methods, which can maintain the integrity of the original drawing data as much as possible while ensuring the coordinate information of the DWG? thank you very much!
When I use the following method for conversion, I encounter the problem of incorrect coordinates in the screenshot below:
CadImage cadImage = (CadImage) Image.load(dwgPath);
CadRasterizationOptions cadOptions = new CadRasterizationOptions();
cadOptions.setPageWidth(cadImage.getWidth());
cadOptions.setPageHeight(cadImage.getHeight());
cadOptions.setDrawType(CadDrawTypeMode.UseObjectColor);
cadOptions.setExportAllLayoutContent(true);
DxfOptions dxfOptions = new DxfOptions();
dxfOptions.setVectorRasterizationOptions(cadOptions);
cadImage.save(outFile, dxfOptions);
image.png (43.5 KB)
Therefore, I would like to consult with you on how to maintain the original coordinate information of the drawing after the conversion is completed
@tianlong88,
right now there is no way to preserve the initial coordinates unfortunately and the entire drawing gets shifted. We are already working with the option to do it in the next versions. We have attached task CADJAVA-11645 to this forum thread so its status is visible at the bottom of this page.