# Unable to get SVG to export

**URL:** <https://discourse.processing.org/t/unable-to-get-svg-to-export/40882>\
**Category:** Beginners\
**Created:** [February 9, 2023, 5:37am UTC](https://discourse.processing.org/t/unable-to-get-svg-to-export/40882 "2023-02-09T05:37:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gummy12](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@gummy12](https://discourse.processing.org/u/gummy12)\
**Post date:** [February 9, 2023, 5:37am UTC](https://discourse.processing.org/t/unable-to-get-svg-to-export/40882/1 "2023-02-09T05:37:04Z")

</div>

\<  
import processing.svg.\*;

void setup(){  
noLoop();  
beginRecord(SVG,“asdfasdf2.svg”);

size(1000, 1000,P3D);  
noFill();  
strokeWeight(2);  
beginShape();

int squarenumber = 12;

for (int i = 1; i\<squarenumber; i++){  
// strokeWeight((squarenumber - i) \* 0.20);  
translate(80,80);  
rotateY(0.1_i);  
rotateX(0.12_i);  
box(80);  
}  
endShape();  
endRecord();  
}

> 

Hello all im very new to coding in general and am having trouble getting an SVG to export properly. This code gives a simple output of rotating cubes across the diagonal of the output frame. When I run the code an output SVG is created that im able to view but its a blank white canvas with no lines. My end intention is to plot this on a pen plotter using inkscape. Im sure this is a simple fix but help would be appreciated.

Thank You!

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [February 9, 2023, 7:22am UTC](https://discourse.processing.org/t/unable-to-get-svg-to-export/40882/2 "2023-02-09T07:22:14Z")

</div>

This runs on my system. All I did was add asterisk for multiplication in rotateX, rotateY

```auto
import processing.svg.*;

void setup() {
  noLoop();
  beginRecord(SVG, "asdfasdf2.svg");

  size(1000, 1000, P3D);
  noFill();
  strokeWeight(2);
  beginShape();

  int squarenumber = 12;

  for (int i = 1; i<squarenumber; i++) {
    //strokeWeight((squarenumber - i) * 0.20);
    translate(80, 80);
    rotateY(0.1*i);
    rotateX(0.12*i);
    box(80);
  }
  endShape();
  endRecord();
}

```

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [February 9, 2023, 11:06am UTC](https://discourse.processing.org/t/unable-to-get-svg-to-export/40882/3 "2023-02-09T11:06:20Z")

</div>

Hello @gummy12,

Please format your code as a courtesy to this community:  
[https://discourse.processing.org/faq#format-your-code](https://discourse.processing.org/faq#format-your-code)

Important elements of your code are lost when not properly formatted when posting.

There is a tutorial here:

> **[SVG Export / Libraries](https://processing.org/reference/libraries/svg/index.html)**
>
> Create SVG files.

I modified your code with elements from this section of the tutorial:

> SVG Files from 3D Geometry (With Screen Display)

I was then able to generate an SVG and could open it with Inkscape.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/c/7/c7f67995a5ef70879193410cab198b1e6809c51d.png)

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/f/5/f5888f32024eda003d7e32ddc0bab6be28d1bd98.png)

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/a/4/a4154b54058d4646a6c24230d3b993d48c4eb8c5.png)

`:)`
