Author Topic: netDxf created file  (Read 2407 times)

0 Members and 1 Guest are viewing this topic.

jtoverka

  • Newt
  • Posts: 127
netDxf created file
« on: May 16, 2020, 11:17:16 AM »
So I have been working on creating dxf files using a C# dxf reader writer library found on github: https://github.com/haplokuon/netDxf.
I compiled it into a dll file, and I am using that dll file as a reference in my program. I have created a dxf file with a line in it. AutoCAD throws an error message. I have attached a photo of the error message as well as the drawing. I want understand what this error message means. It asks me if I would like to continue and I select yes. It then shows the drawing with the line as intended.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: netDxf created file
« Reply #1 on: May 16, 2020, 01:29:47 PM »
(on iPad) Wild assed guess - is the dll emitting Unicode?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

jtoverka

  • Newt
  • Posts: 127
Re: netDxf created file
« Reply #2 on: May 16, 2020, 03:58:22 PM »
(on iPad) Wild assed guess - is the dll emitting Unicode?

I am not sure, you might be right, however, it seems fixed when I put the version I want as AutoCAD 2018. The default is AutoCAD 2000. Is there something in AutoCAD 2000 formats that cause this in AutoCAD 2018? Below is a little snippet.

Code: [Select]
        public void New(Documents dxfDocuments, netDxf.DxfDocument dxfActiveDocument)
        {
            string buffer;
            string input; // hello mp
            buffer = ">>> Enter template file name or [. (for none)] <>:";
            Console.Write("\n" + buffer);
            input = GetInput(0, buffer);
            try
            {
                if (input == ".")
                {
                    netDxf.DxfDocument dxfDocument = new netDxf.DxfDocument(netDxf.Header.DxfVersion.AutoCad2018); // Create Document
                    dxfDocuments.Add(dxfDocument);                             // Add document to collection
                    dxfActiveDocument = dxfDocument;                           // Make the document the active document
                    Console.Write("\nSuccessfully loaded new dxf document");   // Print to console
                }
            }
            catch
            {
                Console.Write("\nLoad failed");
            }
        }