CADImport V8.0 - Missing entities dxf --> png

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
Gabo
Posts: 1
Joined: 18 Jun 2013, 16:13

CADImport V8.0 - Missing entities dxf --> png

Post by Gabo » 18 Jun 2013, 16:42

Hello,

currently we face the problem, that when we try to generate a png image out of an dxf file several entities will not be shown/rendered.
The project is an c# WPF Project (.NET 4.0)
We are using at the moment the CAD Import .NET 8.0.0.30472 library.
Previously imported dxf files worked well. When i am using the ABViewer all entities are properly shown.
Is there a way that you could have a look on it?

The implementation is something like that:

CADImage cadImage = CADImage.CreateImageByExtension(fileName);
cadImage.Converter.SHXSettings.UseSHXFonts = false;
cadImage.Converter.SHXSettings.UseMultyTTFFonts = true;
cadImage.Converter.SHXSettings.UseTTFFonts = true;
cadImage.IsShowLineWeight = true;
cadImage.DefaultColor = Color.Black;
cadImage.BackgroundColor = Color.Transparent;
cadImage.GraphicsOutMode = DrawGraphicsMode.WPF;
cadImage.InterpolationMode = InterpolationMode.HighQualityBicubic;

if (CADConst.IsWebPath(fileName))
{
cadImage.LoadFromWeb(fileName);
}
else
{
cadImage.LoadFromFile(fileName);
}

using (var stream = new MemoryStream())
{
double pixelsize = Resolution;
var rect = new DRect {Width = pixelsize, Height = pixelsize};
cadImage.ChangeGraphicsMode(DrawGraphicsMode.WPF, RenderMode.Points);
cadImage.SaveToStream(stream, ImageFormat.Tiff, rect);
stream.WriteTo(new FileStream("TestImage.tiff", FileMode.Create));

CadData = new CadItem();
CadData.DisplayImage = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()).Replace(".tmp", ".png");
CadData.Width = cadImage.Extents.Width;
CadData.Height = cadImage.Extents.Height;
CadData.TopLeft = cadImage.Extents.TopLeft;
using (var image = new Bitmap(stream))
{
image.Save(CadData.DisplayImage);
}
}

I also attached a dxf test file (which i modified with the ABViewer 9.0 demo version)

I also tested the CAD Import .NET 9 demo Version with the same result.

Thanks in advance and best regards
Attachments
example.zip
(45.75 KiB) Downloaded 1199 times

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: CADImport V8.0 - Missing entities dxf --> png

Post by support » 19 Jun 2013, 13:54

Hello.
The DXF test file that you provided contains MPolygon entities. Generally MPolygon is the variant of Hatch. Unfortunately CAD Import .NET current version doesn't support this entity. We plan to implement supporting MPolygons in the future library versions.

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply