# Unable to open .dxf file

**URL:** https://discourse.processing.org/t/unable-to-open-dxf-file/16703
**Category:** Coding Questions
**Created:** [December 29, 2019, 2:24pm UTC](https://discourse.processing.org/t/unable-to-open-dxf-file/16703 "2019-12-29T14:24:37Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![bp396](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@bp396](https://discourse.processing.org/u/bp396)
#### Post date: [December 29, 2019, 2:24pm UTC](https://discourse.processing.org/t/unable-to-open-dxf-file/16703/1 "2019-12-29T14:24:37Z")

</div>

I am trying to save a sketch output as a dsx file. Am using this because I am looking to save a sketch using 3D bezier curves. Although the file appears to be saving, it will not open properly using Adobe Illustrator or an Autodesk viewer that I was able to download (I don’t have CAD). Also, tried with this example from [Processing.org](http://Processing.org) and got same result. Sketch opens but not with the screen content.

```Processing
import processing.dxf.*;
boolean record;
void setup() {
  size(500, 500, P3D);
}
void draw() {
  if (record) {
    beginRaw(DXF, "output.dxf");
  }
  // Do all your drawing here
  if (record) {
    endRaw();
    record = false;
  }
}
void keyPressed() {
  // Use a key press so that it doesn't make a million files
  if (key == 'r') {
  	record = true;
  }
}

```

When I do open it with Illustrator, this is what I see:

SECTION  
2  
ENTITIES  
0  
ENDSEC  
0  
EOF  
Not even sure what this is?

In addition I am getting the following error in the console, even though the sketch seems to run,  
TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!  
2019-12-29 08:53:36.385 java[762:12250] WARNING: NSWindow drag regions should only be invalidated on the Main Thread! This will throw an exception in the future.

I know there was a thread on this is the past, but ticket was closed; don’t know if it is related to my dfx issue or not. If anyone can advise on how to save a sketch using 3D bezier curves and how that sketch can be opened, would appreciate it. Running 10.14.3 MacOS Mojave.  
Thanks for your help on this.

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [December 29, 2019, 2:49pm UTC](https://discourse.processing.org/t/unable-to-open-dxf-file/16703/2 "2019-12-29T14:49:48Z")

</div>

> [@bp396](#):
>
> dxf

you mean dxf, right? I edited your title.

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [December 29, 2019, 2:50pm UTC](https://discourse.processing.org/t/unable-to-open-dxf-file/16703/3 "2019-12-29T14:50:48Z")

</div>

what do you see when you open it with text editor?

---

<div class="post-metadata">

### Author: ![DongKingKong0](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/dongkingkong0/32/960_2.png) [@DongKingKong0](https://discourse.processing.org/u/DongKingKong0)
#### Post date: [December 29, 2019, 2:52pm UTC](https://discourse.processing.org/t/unable-to-open-dxf-file/16703/4 "2019-12-29T14:52:48Z")

</div>

The error you are getting in the console is a general problem with Processing 3 on macOS. This happens every time you specify a renderer (`P3D` in your case) in `size` or `fullScreen`.

---

<div class="post-metadata">

### Author: ![bp396](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@bp396](https://discourse.processing.org/u/bp396)
#### Post date: [December 29, 2019, 5:06pm UTC](https://discourse.processing.org/t/unable-to-open-dxf-file/16703/5 "2019-12-29T17:06:55Z")

</div>

Yes, right dxf. Thanks!

---

<div class="post-metadata">

### Author: ![bp396](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@bp396](https://discourse.processing.org/u/bp396)
#### Post date: [December 29, 2019, 5:11pm UTC](https://discourse.processing.org/t/unable-to-open-dxf-file/16703/6 "2019-12-29T17:11:10Z")

</div>

I see the same thing.

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [December 29, 2019, 5:12pm UTC](https://discourse.processing.org/t/unable-to-open-dxf-file/16703/7 "2019-12-29T17:12:57Z")

</div>

> [@bp396](#):
>
> save a sketch using 3D bezier curves

Maybe try to run a test sketch with simple lines. And see if that works. Maybe bezier isn’t implemented in the export

---

<div class="post-metadata">

### Author: ![bp396](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@bp396](https://discourse.processing.org/u/bp396)
#### Post date: [December 29, 2019, 7:43pm UTC](https://discourse.processing.org/t/unable-to-open-dxf-file/16703/8 "2019-12-29T19:43:02Z")

</div>

Yes, did it with a few lines,  
beginShape();  
vertex (10,24);  
vertex (100,23);  
vertex (100,180);  
//bezierVertex (mouseX,mouseY, 400, 400,mouseX,mouseY,350,200,200);  
endShape(0);

but output was the same - just a print-out of coordinates or something, no graphic. Any other ideas for saving 3D custom shapes?

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [December 29, 2019, 7:54pm UTC](https://discourse.processing.org/t/unable-to-open-dxf-file/16703/9 "2019-12-29T19:54:59Z")

</div>

How does it look like in text editor? Or if you open dxf with processing?
