Hi,
Our goal is to use CAD .NET and import CAD/3D files (DWF, DWFX, IFC, STL, IGES, OBJ, IGS, STP) using CAD .NET Sdk and measure their width, height, and breath. Then, we display the imported file in the browser.
Is it possible ? Please advise for this case
@subbu9119
Can you please provide more details on the specific CAD file formats you are working with and the methods you are currently using to import and measure the models?
@subbu9119,
Hi,
we have Height, Width and Depth properties for Image instance: Class Image | Aspose.CAD for .NET API Reference. Could you please prepare and attach here few test files in different formats and the desired results for them, we will test these cases as some formats store the size of the drawing directly, and for other formats the calculation over the entire drawing is required to get size.
Hi,
Thanks for your reply. Please check that different format sample files as per your request. Please examine the files and also please send sample code of that implementation.
Thanks
samples.zip (1.9 MB)
@subbu9119,
Here is the usage example:
using (Image image = Aspose.CAD.Image.Load(fileName))
{
if (image is CadImage)
{
CadImage cadImage = (CadImage)image;
System.Console.WriteLine("Min point= ({0};{1};{2}), Max point = ({3};{4};{5})", cadImage.MinPoint.X, cadImage.MinPoint.Y,
cadImage.MinPoint.Z, cadImage.MaxPoint.X, cadImage.MaxPoint.Y, cadImage.MaxPoint.Z);
}
System.Console.WriteLine("Width= " + image.Width + " Height= " + image.Height + " Depth=" + image.Depth);
}
As for your files we can confirm that for DXF/DWG Depth is zero always, but you can use MinPoint and MaxPoint to calculate size. For STL and IGS the Depth is not filled too. We have created CADNET-9893 to fix the issue with this property. You can also test this code sample yourself and share problems, files and expected values here, we will fix these issues.