# Discrepancies in quantity and properties of edge connections using Model.AddElements \[SOLVED\]

**URL:** <https://femdesign.discourse.group/t/discrepancies-in-quantity-and-properties-of-edge-connections-using-model-addelements-solved/107>\
**Category:** Grasshopper\
**Tags:** solved\
**Created:** [18 November 2023 20:48 UTC](https://femdesign.discourse.group/t/discrepancies-in-quantity-and-properties-of-edge-connections-using-model-addelements-solved/107 "2023-11-18T20:48:20Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomasz\_Gniady](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/tomasz_gniady/32/34_2.png) [@Tomasz\_Gniady](https://femdesign.discourse.group/u/Tomasz_Gniady)\
**Post date:** [18 November 2023 20:48 UTC](https://femdesign.discourse.group/t/discrepancies-in-quantity-and-properties-of-edge-connections-using-model-addelements-solved/107/1 "2023-11-18T20:48:20Z")

</div>

Hello again,

During testing and debugging my script, which setting up a correct mesh size for surface elements I found out sth interesting. Simple script, which use Model.AddElements:

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/femdesign_api/original/1X/6e4247694d5c6cab0e72de17bd8ec87bb1c18d9e.png)

![image](https://europe1.discourse-cdn.com/flex017/uploads/femdesign_api/original/1X/dcd55ffdabb2f34ec2c476b71c2082656f3d8812.png)

This is how wall looks like orginially:

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/femdesign_api/original/1X/237767f5ac98495fc1ca84ce091933c8c4e6497b.png)

And after using script:

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/femdesign_api/original/1X/acc4a30a35aba3292a396ea5612ba432176c6a65.png)

In every instances, where wall edge was divided into 2 or more pieces, division gone as well as edge connection properties is not correctly placed.

Do you have any idea how to make it work properly?

_I have to use Overwrite option, due to another problem with not allowing to copying line connections with pre-defined library, which is described there_: [Copying point & line connections in 22.9.0 version [SOLVED] - #5 by Tomasz\_Gniady](https://femdesign.discourse.group/t/copying-point-line-connections-in-22-9-0-version/100/5)

---

<div class="post-metadata">

**Author:** ![MarcoPelle](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/marcopelle/32/6_2.png) [@MarcoPelle](https://femdesign.discourse.group/u/MarcoPelle)\
**Post date:** [20 November 2023 08:37 UTC](https://femdesign.discourse.group/t/discrepancies-in-quantity-and-properties-of-edge-connections-using-model-addelements-solved/107/2 "2023-11-20T08:37:37Z")

</div>

@Tomasz_Gniady

It would be great if you can isolate the problem and send us a small script/file to allow us to replicate the problem.

---

<div class="post-metadata">

**Author:** ![Tomasz\_Gniady](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/tomasz_gniady/32/34_2.png) [@Tomasz\_Gniady](https://femdesign.discourse.group/u/Tomasz_Gniady)\
**Post date:** [20 November 2023 08:54 UTC](https://femdesign.discourse.group/t/discrepancies-in-quantity-and-properties-of-edge-connections-using-model-addelements-solved/107/3 "2023-11-20T08:54:21Z")

</div>

As you wish, please find attached files.  
[Mesh size setting up-edge conn error.zip](https://femdesign.discourse.group/uploads/short-url/vYhG3umnSbLgNy6WWG5r7OX0yBn.zip) (5.8 MB)

---

<div class="post-metadata">

**Author:** ![MarcoPelle](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/marcopelle/32/6_2.png) [@MarcoPelle](https://femdesign.discourse.group/u/MarcoPelle)\
**Post date:** [20 November 2023 14:08 UTC](https://femdesign.discourse.group/t/discrepancies-in-quantity-and-properties-of-edge-connections-using-model-addelements-solved/107/4 "2023-11-20T14:08:35Z")

</div>

Issue similar to the following thread.

> [@Slab.SetEdgeConnection for multiple surfaces - solution exception error \[SOLVED\]](https://femdesign.discourse.group/t/slab-setedgeconnection-for-multiple-surfaces-solution-exception-error-solved/108/7):
>
> @Tomasz_Gniady have a look at the following script [EdgeConnForMultipleSurfaces\_error\_replication\_SOLVED\_2.gh](https://femdesign.discourse.group/uploads/short-url/91j7eT1FDNLwqEteBJVlZwWs3pE.gh) (16.8 KB) Can you just “setEdgeConnection” without creating a new one? There is a Bug in constructing the surface again which changes the order of the edge

It looks like a Bug

---

<div class="post-metadata">

**Author:** ![Tomasz\_Gniady](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/tomasz_gniady/32/34_2.png) [@Tomasz\_Gniady](https://femdesign.discourse.group/u/Tomasz_Gniady)\
**Post date:** [20 November 2023 14:18 UTC](https://femdesign.discourse.group/t/discrepancies-in-quantity-and-properties-of-edge-connections-using-model-addelements-solved/107/5 "2023-11-20T14:18:14Z")

</div>

Last thing, ordering works, but do you have any idea why some of edges disappear?  
Original model:

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/femdesign_api/original/1X/f3ccf0a94b798411fc708d936032db9eeb472a8a.png)

Model with script:

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/femdesign_api/original/1X/1ab5594941e8a144ec69743ea116e4102b93dea5.png)

Instead of 3 edges, there is 1 edge only. It’s really important for results from analysis. Without copying correct quantity of edges unfortunately, script will be not useful 😕

---

<div class="post-metadata">

**Author:** ![MarcoPelle](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/marcopelle/32/6_2.png) [@MarcoPelle](https://femdesign.discourse.group/u/MarcoPelle)\
**Post date:** [20 November 2023 15:41 UTC](https://femdesign.discourse.group/t/discrepancies-in-quantity-and-properties-of-edge-connections-using-model-addelements-solved/107/6 "2023-11-20T15:41:26Z")

</div>

@Tomasz_Gniady

I do not see any duplicate edges in the .str

Can you please send me a model with edge connections on the same edge?

---

<div class="post-metadata">

**Author:** ![Tomasz\_Gniady](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/tomasz_gniady/32/34_2.png) [@Tomasz\_Gniady](https://femdesign.discourse.group/u/Tomasz_Gniady)\
**Post date:** [20 November 2023 16:11 UTC](https://femdesign.discourse.group/t/discrepancies-in-quantity-and-properties-of-edge-connections-using-model-addelements-solved/107/7 "2023-11-20T16:11:09Z")

</div>

![image](https://europe1.discourse-cdn.com/flex017/uploads/femdesign_api/original/1X/252790867a39ed6c8e54e06b232c4fc829ddad96.png)  
Please find attached 2 models.  
No 1: Model adjusted by script  
No 2: Original model for comparision.  
[Edge-Connection - quantity error.zip](https://femdesign.discourse.group/uploads/short-url/kVY9T21ynQIUjSP0AQfV16OHk3R.zip) (6.5 MB)

There is a differences between quantity of edge connections, which I mentioned on figures above.

---

<div class="post-metadata">

**Author:** ![MarcoPelle](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/marcopelle/32/6_2.png) [@MarcoPelle](https://femdesign.discourse.group/u/MarcoPelle)\
**Post date:** [23 November 2023 10:09 UTC](https://femdesign.discourse.group/t/discrepancies-in-quantity-and-properties-of-edge-connections-using-model-addelements-solved/107/8 "2023-11-23T10:09:15Z")

</div>

@Tomasz_Gniady  
I can still do not find the edge connections as you have showed me in your picture.

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/femdesign_api/original/1X/678b5dbc2e2a4e2b2c66a51834bcd3daa1be1e83.png)

---

<div class="post-metadata">

**Author:** ![Tomasz\_Gniady](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/tomasz_gniady/32/34_2.png) [@Tomasz\_Gniady](https://femdesign.discourse.group/u/Tomasz_Gniady)\
**Post date:** [23 November 2023 12:01 UTC](https://femdesign.discourse.group/t/discrepancies-in-quantity-and-properties-of-edge-connections-using-model-addelements-solved/107/9 "2023-11-23T12:01:58Z")

</div>

@MarcoPelle  
The easiest way will be open view in axis “D.B”. I show where to find it on picture below:

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/femdesign_api/original/1X/d530d392eb665c4560d0fdb0e4e6c03fcadc4c99.png)

---

<div class="post-metadata">

**Author:** ![MarcoPelle](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/marcopelle/32/6_2.png) [@MarcoPelle](https://femdesign.discourse.group/u/MarcoPelle)\
**Post date:** [29 November 2023 11:32 UTC](https://femdesign.discourse.group/t/discrepancies-in-quantity-and-properties-of-edge-connections-using-model-addelements-solved/107/10 "2023-11-29T11:32:28Z")

</div>

@Joakim

The user has a wall element with some edge connection specified at the edges.  
If we save the file in .struxml, the file is written correctly (5 edges, with some edge connections assign to them), however, if we open the .struxml in FEM-Design, the edge connections will be set in a different way. Is this a bug?

.str file

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/femdesign_api/original/1X/57d2fd81bb86d7c0630f0f0b3753c71ad797c7e0.png)

.struxml file

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/femdesign_api/original/1X/10246111a868b74ac849721a6312025a9a842284.png)

[EdgeConn-Simple.zip](https://femdesign.discourse.group/uploads/short-url/usj29VCr4fIbSvMRLyFNyZBZ1ar.zip) (2.1 MB)

---

<div class="post-metadata">

**Author:** ![MarcoPelle](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/marcopelle/32/6_2.png) [@MarcoPelle](https://femdesign.discourse.group/u/MarcoPelle)\
**Post date:** [29 November 2023 13:59 UTC](https://femdesign.discourse.group/t/discrepancies-in-quantity-and-properties-of-edge-connections-using-model-addelements-solved/107/11 "2023-11-29T13:59:11Z")

</div>

@Tomasz_Gniady

Unfortuntely, it looks like we have a bug in FEM-Design and the issue is not related to the API.  
We have opened a case and we will follow up when it is solved.

---

<div class="post-metadata">

**Author:** ![Tomasz\_Gniady](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/tomasz_gniady/32/34_2.png) [@Tomasz\_Gniady](https://femdesign.discourse.group/u/Tomasz_Gniady)\
**Post date:** [29 November 2023 14:01 UTC](https://femdesign.discourse.group/t/discrepancies-in-quantity-and-properties-of-edge-connections-using-model-addelements-solved/107/12 "2023-11-29T14:01:34Z")

</div>

Of course I’ll wait for the results.  
Thank you for all your commitment.

---

<div class="post-metadata">

**Author:** ![MarcoPelle](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/marcopelle/32/6_2.png) [@MarcoPelle](https://femdesign.discourse.group/u/MarcoPelle)\
**Post date:** [29 November 2023 14:50 UTC](https://femdesign.discourse.group/t/discrepancies-in-quantity-and-properties-of-edge-connections-using-model-addelements-solved/107/13 "2023-11-29T14:50:28Z")

</div>

@Tomasz_Gniady  
Looks like that FEM-Design will not fix the issue in the short period.

However, as a workaround, I do suggest to do the following:

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/femdesign_api/original/1X/965eff41704103805b5e429b6d090c36ccdc443a.png)

---

<div class="post-metadata">

**Author:** ![MarcoPelle](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/marcopelle/32/6_2.png) [@MarcoPelle](https://femdesign.discourse.group/u/MarcoPelle)\
**Post date:** [8 April 2024 13:25 UTC](https://femdesign.discourse.group/t/discrepancies-in-quantity-and-properties-of-edge-connections-using-model-addelements-solved/107/14 "2024-04-08T13:25:39Z")

</div>

@Tomasz_Gniady

The bug has been solved and the model will keep the edge connection as specified!
