Home > Enterprise >  Free DWG/DXF Convert to PDF
Free DWG/DXF Convert to PDF

Time:02-06

I am making a C# project converting DWG/DXF to pdf.(C# Windows Console Application) Using free packages(ACadSharp, PdfSharp), I 've already some drawing at .pdf file without AutoCAD Application. But in HATCH entity of AutoCAD, Some problems have arisen. 1)In the figure, it is not possible to process the arced edge part. 2)In INSERT entity, I can not find flip property. 3)How to get strings of MTEXT. These are the sample images I want and the ones I made. edge part ISERT-HATCH & METXT

My Project in: https://github.com/LeonidKaralis1993/ACAD_C-

if (e.ObjectType.ToString() == "HATCH")
{
    Console.Write("\n\t\t--HatchDraw--");
    hatch = (Hatch)e;

    foreach (Hatch.BoundaryPath mpath in hatch.Paths)
    {
        foreach (var pe in mpath.Edges)
        {
            Console.WriteLine("\n\t\t\t"   pe.Type);
            Hatch.BoundaryPath.Polyline polyline1;
            polyline1 = (Hatch.BoundaryPath.Polyline)pe;
            int count = polyline1.Vertices.Count; 
            int index = 0;
            XPoint[] xpoints = new XPoint[count];
            foreach (CSMath.XY point in polyline1.Vertices)
            {
                xpoints[index].X = v_d   point.X;
                xpoints[index].Y = vh - point.Y - v_d;
                //Console.WriteLine("\n\t"   point.X   "\t\t"   point.Y);
                index  ;
            }
            gfx.DrawPolygon(pdfpen, xBrush, xpoints, XFillMode.Winding);
            }                                       
        }
    }
}

CodePudding user response:

Your code looks perfect. Your efforts to benefit everyone are truly admirable. I have tried and failed to convert AutoCAD files to pdf without using a package with a commercial license. Try attaching the Rotate property to the DIMENTION_LINEAR Entity.

  • Related