Browse our Products

Aspose.CAD for .NET 16.12 Release notes

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

Features and Improvements

KeySummaryCategory
CADNET-195Implement Underlay Flags for DWG formatNew Feature
CADNET-170Implement drawing of DGN format as a part of DWGNew Feature
CADNET-185Converting DWG to PDF is showing incorrect resultsEnhancement
CADNET-177Implement reading insert coordinate and rotation angle for DGN underlayEnhancement
CADNET-173Converting DWG to PNG in multithread is throwing exceptionEnhancement

Usage Examples

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;

        }

}