Using Annotative Scale in Aspose.CAD

Hi,

We are in the process of evaluating Aspose.CAD and it looks like a good option for our project. However, we have come across the following limitations related to Annotative Scale:

  1. When we render the DWG as a TIFF, labels are shown in viewports even if their ANNOSCALE scale is different to the view ports scale. This results in labels being shown when they shouldn’t.
  2. There doesn’t seem to be any way to read the Annotative scale via Apose.CAD. This means we can’t process and validate these objects.

Could you confirm if this is a known limitation and if it is likely to be resolved?

Thanks,

John-Paul

@johnpaulcowling,
Hello,

Thank you for trying out Aspose.CAD and for sharing the details of the behavior you’ve observed with annotative scales. The points you mentioned—labels appearing in viewports despite differing ANNOSCALE values, and the lack of an API to read the annotative scale—are indeed areas we need to look into more closely.

To investigate this properly we’d need a sample DWG file that reproduces the issue, along with the code you’re using to render the drawing to TIFF. This will help us see exactly how the viewport and label entities are being processed by the library.

At the moment the library does not expose a direct property for the annotative scale, and the rendering engine may not filter labels based on that setting. Providing the sample will allow us to confirm whether this is a limitation of the current implementation and to explore possible work‑arounds.

If you could attach the DWG (or a simplified version that still shows the problem) and the rendering snippet, we’ll be able to investigate further and get back to you with more concrete information.

Looking forward to your sample so we can dive deeper into this.

Hi,

Thank you for the quick reply.

Below is a link to a PDF with the expected results, as you can see different labels are shown for each viewport:
Multiple annotative scales.pdf (33.0 KB)

Below is the dwg file, you will need to rename the extension as I was getting blocked from uploading it
Multiple annotative scales.dwg.pdf (322.7 KB)

Below is the tiff that got generated, you will need to rename the extension as I was getting blocked from uploading it. As you can see the 1:1000 scale viewport is showing labels that should be hidden.
test_DS__1_.tiff.pdf (134.7 KB)

Below is the code we used to generate it:

public static void main(String[] args) throws Exception
  {
    val sw = Stopwatch.createStarted();
    try (val is = Main.class.getResourceAsStream("/Multiple annotative scales.dwg");
      val image = (CadImage) Image.load(is))
    {
      image.getLayers().getLayersNames().forEach(log::debug);

      val quality = new RasterizationQuality();
      quality.setText(RasterizationQualityValue.High);
      quality.setArc(RasterizationQualityValue.High);
      quality.setObjectsPrecision(RasterizationQualityValue.High);

      for (val entry : image.getLayouts().entrySet())
      {
        val layoutName = entry.getValue().getLayoutName();

        val rasterOptions = new CadRasterizationOptions();
        rasterOptions.setLayouts(new String[]{ layoutName });
        rasterOptions.setPageWidth(842 * 5);
        rasterOptions.setPageHeight(595 * 5);
        rasterOptions.setQuality(quality);
        rasterOptions.setLayouts(new String[]{layoutName});

        val tiffOptions = new TiffOptions(TiffExpectedFormat.TiffLzwRgb);
        tiffOptions.setVectorRasterizationOptions(rasterOptions);

        val outputPath = "test_" + layoutName.replaceAll("[^a-zA-Z0-9_-]", "_") + ".tiff";
        image.save(outputPath, tiffOptions);
        log.debug("Saved layout '{}' to {}", layoutName, outputPath);
      }
    }
    log.debug("Done in {}", sw);
  }

Kind Regards,

John-Paul

@johnpaulcowling,
Hi,
thank you for all details, we have briefly tested the issue and can confirm it. We have planned to fix both problems in the scope of task CADJAVA-12124.