Browse our Products

Aspose.CAD for Java 16.12.1 - Release notes

We are pleased to announce the release of Aspose.CAD 16.12.1 for Java. The following is a list of changes in this version of Aspose.CAD.

Features and Improvements

KeySummaryCategory
CADJAVA-85Update Dynabic.Metered functionalityNew Feature
CADJAVA-77Implement Underlay Flags for DWG formatNew Feature
CADJAVA-82Implement drawing of DGN format as a part of DWGNew Feature
CADJAVA-70Converting DWG to PDF is showing incorrect resultsEnhancement
CADJAVA-79Implement reading insert coordinate and rotation angle for DGN underlay.Enhancement
CADJAVA-80Converting DWG to PNG in multithread is throwing exceptionEnhancement
CADJAVA-64Loading a DWG file using CadImage.load() method is throwing exceptionEnhancement

Usage examples:

CADNET-85 Update Dynabic.Metered functionality

 Metered metered = new Metered();

metered.setMeteredKey("publicKey", "privateKey");

double quantityOld = Metered.getConsumptionQuantity();

CadImage image = (CadImage)Image.load("BlockRefDgn.dwg");

double quantity = Metered.getConsumptionQuantity();

CADJAVA-77 Implement Underlay Flags for DWG format

 String fileName = getDwgFile("BlockRefDgn.dwg");

CadImage image = (CadImage)Image.load(fileName);

for (CadBaseEntity entity : image.getEntities())

{

    if (entity instanceof CadDgnUnderlay)

    {

        CadUnderlay underlay = (CadUnderlay) entity;

        System.out.println(underlay.getUnderlayPath());

        System.out.println(underlay.getUnderlayName());

        System.out.println(underlay.getInsertionPoint().getX());

        System.out.println(underlay.getInsertionPoint().getY());

        System.out.println(underlay.getRotationAngle());

        System.out.println(underlay.getScaleX());

        System.out.println(underlay.getScaleY());

        System.out.println(underlay.getScaleZ());

        System.out.println((underlay.getFlags() & UnderlayFlags.UnderlayIsOn) == UnderlayFlags.UnderlayIsOn);

        System.out.println((underlay.getFlags() & UnderlayFlags.ClippingIsOn) == UnderlayFlags.ClippingIsOn);

        System.out.println((underlay.getFlags() & UnderlayFlags.Monochrome) != UnderlayFlags.Monochrome);

        break;

    }

}

CADJAVA-82 Implement drawing of DGN format as a part of DWG

 String fileName = getDwgFile("BlockRefDgn.dwg");

System.out.println(fileName);

String outPath = getFileFromDesktop("BlockRefDgn.dwg.pdf");

PdfOptions exportOptions = new PdfOptions();

CadImage cadImage = (CadImage)Image.load(fileName);

for (CadBaseEntity baseEntity : cadImage.getEntities())

{

        // if entity is an image definition

    if (baseEntity.getTypeName() == CadEntityTypeName.DGNUNDERLAY)

    {

        CadDgnUnderlay dgnFile = (CadDgnUnderlay)baseEntity;

        // get external reference to object

        System.out.println(dgnFile.getUnderlayPath());

    }

}

CadRasterizationOptions vectorRasterizationOptions = new CadRasterizationOptions();

vectorRasterizationOptions.setPageWidth(1600);

vectorRasterizationOptions.setPageHeight(1600);

vectorRasterizationOptions.setCenterDrawing(true);

vectorRasterizationOptions.setLayouts(new String[] { "Model" });

vectorRasterizationOptions.setScaleMethod(ScaleType.None);

vectorRasterizationOptions.setBackgroundColor(Color.getBlack());

vectorRasterizationOptions.setDrawType(CadDrawTypeMode.UseObjectColor);

exportOptions.setVectorRasterizationOptions(vectorRasterizationOptions);

cadImage.save(outPath, exportOptions);

CADJAVA-79 Implement reading insert coordinate and rotation angle for DGN underlay.

 String fileName = getDwgFile("BlockRefDgn.dwg");

CadImage image = (CadImage)Image.load(fileName);

{

    for (CadBaseEntity entity : image.getEntities())

    if (entity instanceof CadDgnUnderlay)

    {

        CadUnderlay underlay = (CadUnderlay)entity;

        System.out.println(underlay.getUnderlayPath());

        System.out.println(underlay.getUnderlayName());

        System.out.println(underlay.getInsertionPoint().getX());

        System.out.println(underlay.getInsertionPoint().getY());

        System.out.println(underlay.getRotationAngle());

        System.out.println(underlay.getScaleX());

        System.out.println(underlay.getScaleY());

        System.out.println(underlay.getScaleZ());

        break;

    }

}