# Write beam element direction with CGX

**URL:** <https://calculix.discourse.group/t/write-beam-element-direction-with-cgx/135>\
**Category:** CalculiX GraphiX\
**Created:** [August 24, 2020, 4:00pm UTC](https://calculix.discourse.group/t/write-beam-element-direction-with-cgx/135 "2020-08-24T16:00:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SergioP](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/sergiop/32/10_2.png) [@SergioP](https://calculix.discourse.group/u/SergioP)\
**Post date:** [August 24, 2020, 4:00pm UTC](https://calculix.discourse.group/t/write-beam-element-direction-with-cgx/135/1 "2020-08-24T16:00:12Z")

</div>

Hi, I’m trying yo model a curved frame estructure made of pipes, so I made a 1D mesh on Salome of the pipe path, but is there a way to write the element orientation of the beam elements with CGX?

Curved beam  
[https://drive.google.com/file/d/1Txzq5oN9YAFxGulLkjBYjhARjDwEaEJM/view?usp=sharing](https://drive.google.com/file/d/1Txzq5oN9YAFxGulLkjBYjhARjDwEaEJM/view?usp=sharing)

Stright beam (ok to do it manually)  
[https://drive.google.com/file/d/1KoADoctbSaGVjAi-u2Si8EbsEQL4IO5i/view?usp=sharing](https://drive.google.com/file/d/1KoADoctbSaGVjAi-u2Si8EbsEQL4IO5i/view?usp=sharing)

Best regards, and thanks in advance

---

<div class="post-metadata">

**Author:** ![konstantin](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@konstantin](https://calculix.discourse.group/u/konstantin)\
**Post date:** [September 22, 2020, 2:57pm UTC](https://calculix.discourse.group/t/write-beam-element-direction-with-cgx/135/2 "2020-09-22T14:57:42Z")

</div>

Hello,  
Access to `google drive` file is not open for all.

---

<div class="post-metadata">

**Author:** ![SergioP](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/sergiop/32/10_2.png) [@SergioP](https://calculix.discourse.group/u/SergioP)\
**Post date:** [September 22, 2020, 8:04pm UTC](https://calculix.discourse.group/t/write-beam-element-direction-with-cgx/135/3 "2020-09-22T20:04:13Z")

</div>

Ok, try now

> **[Mesh\_3.inp](https://drive.google.com/file/d/1Txzq5oN9YAFxGulLkjBYjhARjDwEaEJM/view?usp=sharing)**
>
> Google Drive file.

> **[Mesh\_4.inp](https://drive.google.com/file/d/1KoADoctbSaGVjAi-u2Si8EbsEQL4IO5i/view?usp=sharing)**
>
> Google Drive file.

---

<div class="post-metadata">

**Author:** ![konstantin](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@konstantin](https://calculix.discourse.group/u/konstantin)\
**Post date:** [September 22, 2020, 8:55pm UTC](https://calculix.discourse.group/t/write-beam-element-direction-with-cgx/135/4 "2020-09-22T20:55:16Z")

</div>

I try `Mesh_3.inp` and do next:

- remove 14 line from ELSET\_ALL
- add

```auto
*element, elset=BYX,type=B32R
14, 5, 64, 30, 

```

- add change

```auto
*BEAM SECTION,MATERIAL=STEEL,ELSET=BYX,OFFSET1=-0.5,SECTION=RECT
30,30
0.,0.,1.
*BEAM SECTION,MATERIAL=STEEL,ELSET=ELSET_ALL,OFFSET1=-0.5,SECTION=RECT
30,30
0.,0.,1.

```

And now:

```auto
*element, elset=ELSET_ALL,type=B32R
1, 1, 51, 19, 
2, 19, 52, 20, 
3, 20, 53, 21, 
4, 21, 54, 22, 
5, 22, 55, 23, 
6, 23, 56, 24, 
7, 24, 57, 25, 
8, 25, 58, 26, 
9, 26, 59, 27, 
10, 27, 60, 2, 
11, 3, 61, 28, 
12, 28, 62, 29, 
13, 29, 63, 4, 
15, 30, 65, 31, 
16, 31, 66, 32, 
17, 32, 67, 33, 
18, 33, 68, 34, 
19, 34, 69, 35, 
20, 35, 70, 6, 
21, 7, 71, 36, 
22, 36, 72, 37, 
23, 37, 73, 8, 
24, 9, 74, 38, 
25, 38, 75, 39, 
26, 39, 76, 40, 
27, 40, 77, 41, 
28, 41, 78, 42, 
29, 42, 79, 43, 
30, 43, 80, 44, 
31, 44, 81, 45, 
32, 45, 82, 46, 
33, 46, 83, 10, 
34, 11, 84, 12, 
35, 13, 85, 47, 
36, 47, 86, 48, 
37, 48, 87, 14, 
38, 15, 88, 49, 
39, 49, 89, 50, 
40, 50, 90, 16, 
41, 17, 91, 18,
*element, elset=BYX,type=B32R
14, 5, 64, 30, 
*MATERIAL, NAME=STEEL
*ELASTIC
210000, 0.3
*BEAM SECTION,MATERIAL=STEEL,ELSET=BYX,OFFSET1=-0.5,SECTION=RECT
30,30
0.,0.,1.
*BEAM SECTION,MATERIAL=STEEL,ELSET=ELSET_ALL,OFFSET1=-0.5,SECTION=RECT
30,30
0.,0.,1.
*STEP
*NO ANALYSIS
*END STEP

```

 ![C](https://global.discourse-cdn.com/free1/uploads/calculix/original/1X/0ad9cb764834752f44578b2fbfced3f9cb177c51.png)

---

<div class="post-metadata">

**Author:** ![konstantin](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@konstantin](https://calculix.discourse.group/u/konstantin)\
**Post date:** [September 22, 2020, 9:39pm UTC](https://calculix.discourse.group/t/write-beam-element-direction-with-cgx/135/5 "2020-09-22T21:39:21Z")

</div>

That is enough.

```auto
*BEAM SECTION,MATERIAL=STEEL,ELSET=ELSET_ALL,OFFSET1=-0.5,SECTION=RECT
30,30
0.,0.,1.

```
