Aspose.CAD for .NET 16.12.1 - Release notes

Aspose.CAD for .Net has been updated to version 16.12.1 and we are pleased to announce it. The following is a list of changes in this version of Aspose.CAD.

Features and Improvements

Key Summary Category
CADNET-202 Update Dynabic.Metered functionality New Feature
CADNET-195 Implement Underlay Flags for DWG format New Feature
CADNET-170 Implement drawing of DGN format as a part of DWG New Feature
CADNET-185 Converting DWG to PDF is showing incorrect results Enhancement
CADNET-177 Implement reading insert coordinate and rotation angle for DGN underlay. Enhancement
CADNET-173 Converting DWG to PNG in multithread is throwing exception Enhancement

Usage Examples

CADNET-202 Update Dynabic.Metered functionality

 var metered = new Metered();

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

var consumed = Metered.GetConsumptionQuantity();

var image = Image.Load("10x10_inches.dwg");

var consumedNew = Metered.GetConsumptionQuantity();

CADNET-195 Implement Underlay Flags for DWG format

 string fileName = "BlockRefDgn.dwg";

using (CadImage image = (CadImage)Image.Load(fileName))

{

    foreach (CadBaseEntity entity in image.Entities)

    {

        if (entity is CadDgnUnderlay)

        {

            CadUnderlay underlay = entity as CadUnderlay;

            Console.WriteLine(underlay.UnderlayPath);

            Console.WriteLine(underlay.UnderlayName);

            Console.WriteLine(underlay.InsertionPoint.X);

            Console.WriteLine(underlay.InsertionPoint.Y);

            Console.WriteLine(underlay.RotationAngle);

            Console.WriteLine(underlay.ScaleX);

            Console.WriteLine(underlay.ScaleY);

            Console.WriteLine(underlay.ScaleZ);

            Console.WriteLine((underlay.Flags & UnderlayFlags.UnderlayIsOn) == UnderlayFlags.UnderlayIsOn);

            Console.WriteLine((underlay.Flags & UnderlayFlags.ClippingIsOn) == UnderlayFlags.ClippingIsOn);

            Console.WriteLine((underlay.Flags & UnderlayFlags.Monochrome) != UnderlayFlags.Monochrome);

            break;

        }

    }

}

CADNET-170 Implement drawing of DGN format as a part of DWG

 string fileName = "BlockRefDgn.dwg";

Console.WriteLine(fileName);

string outPath = fileName + ".pdf";

PdfOptions exportOptions = new PdfOptions();

using (CadImage cadImage = (CadImage)Image.Load(fileName))

{

	foreach (CadBaseEntity baseEntity in cadImage.Entities)

	{

		// if entity is an image definition

		if (baseEntity.TypeName == CadEntityTypeName.DGNUNDERLAY)

		{

			CadDgnUnderlay dgnFile = (CadDgnUnderlay)baseEntity;

			// get external reference to object

			System.Console.WriteLine(dgnFile.UnderlayPath);

		}

	}

	exportOptions.VectorRasterizationOptions = new CadRasterizationOptions()

	{

		PageWidth = 1600,

		PageHeight = 1600,

		CenterDrawing = true,

		Layouts = new string[] { "Model" },

		ScaleMethod = ScaleType.None,

		BackgroundColor = Color.Black,

		DrawType = CadDrawTypeMode.UseObjectColor

	};

	cadImage.Save(outPath, exportOptions);

}

CADNET-177 Implement reading insert coordinate and rotation angle for DGN underlay.

 string fileName = "BlockRefDgn.dwg";

using (CadImage image = (CadImage)Image.Load(fileName))

{

    foreach (CadBaseEntity entity in image.Entities)

        if (entity is CadDgnUnderlay)

        {

            CadUnderlay underlay = entity as CadUnderlay;

            Console.WriteLine(underlay.UnderlayPath);

            Console.WriteLine(underlay.UnderlayName);

            Console.WriteLine(underlay.InsertionPoint.X);

            Console.WriteLine(underlay.InsertionPoint.Y);

            Console.WriteLine(underlay.RotationAngle);

            Console.WriteLine(underlay.ScaleX);

            Console.WriteLine(underlay.ScaleY);

            Console.WriteLine(underlay.ScaleZ);

            break;

        }

}