# Convert fault ASCII to RESQML

**URL:** <https://discourse.f2i-consulting.com/t/convert-fault-ascii-to-resqml/242>\
**Category:** FESAPI\
**Created:** [November 29, 2024, 8:12pm UTC](https://discourse.f2i-consulting.com/t/convert-fault-ascii-to-resqml/242 "2024-11-29T20:12:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marisabel](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/marisabel/32/125_2.png) [@Marisabel](https://discourse.f2i-consulting.com/u/Marisabel)\
**Post date:** [November 29, 2024, 8:12pm UTC](https://discourse.f2i-consulting.com/t/convert-fault-ascii-to-resqml/242/1 "2024-11-29T20:12:52Z")

</div>

Hi! I’m trying to generate a RESQML with fault interpretation, to put the binary need to create the PolylineSetRepresentation and use the def: PushBackGeometry. But I got the error: Wrong number or type of arguments for overloaded function ‘Resqml2\_PolylineSetRepresentation\_pushBackGeometryPatch’.  
But I’m putting the right variables maybe the most confusion part is understand the nodeCountPerPolyline and is Array 1D… of UNTINT. Anyone has experience creating RESQML with fault using FASAPI and could give me any advice. Already try different approaches without succeeds

---

<div class="post-metadata">

**Author:** ![philippeVerney](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/philippeverney/32/29_2.png) [@philippeVerney](https://discourse.f2i-consulting.com/u/philippeVerney)\
**Post date:** [December 2, 2024, 8:26am UTC](https://discourse.f2i-consulting.com/t/convert-fault-ascii-to-resqml/242/2 "2024-12-02T08:26:56Z")

</div>

Hi,  
Which FESAPI programming language flavor do you use? C++? Java? C#? Python?

---

<div class="post-metadata">

**Author:** ![Marisabel](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/marisabel/32/125_2.png) [@Marisabel](https://discourse.f2i-consulting.com/u/Marisabel)\
**Post date:** [December 2, 2024, 11:45am UTC](https://discourse.f2i-consulting.com/t/convert-fault-ascii-to-resqml/242/3 "2024-12-02T11:45:29Z")

</div>

Hi, python and FASPI version 2.12.0

---

<div class="post-metadata">

**Author:** ![philippeVerney](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/philippeverney/32/29_2.png) [@philippeVerney](https://discourse.f2i-consulting.com/u/philippeVerney)\
**Post date:** [December 2, 2024, 2:11pm UTC](https://discourse.f2i-consulting.com/t/convert-fault-ascii-to-resqml/242/4 "2024-12-02T14:11:18Z")

</div>

Arrays of numerical values in FESAPI are managed through some dedicated classes.  
An example can be found here in block #5 : [fesapi/python/example/fesapi.ipynb at master · F2I-Consulting/fesapi · GitHub](https://github.com/F2I-Consulting/fesapi/blob/master/python/example/fesapi.ipynb)

> resqml\_points = fesapi.DoubleArray(24)

Above is the creation of an array of 24 double values which you can set this way

> resqml\_points.setitem(i, i\*100)

and use directly in a FESAPI method such as in

> horizon\_grid\_2d\_representation.setGeometryAsArray2dOfExplicitZ(resqml\_points, 2, 3, hdf\_proxy, …)

Here are all different arrays in FESAPI Python :

```auto
	%array_class(int64_t, Int64Array);
	%array_class(uint64_t, UInt64Array);
	%array_class(int32_t, Int32Array);
	%array_class(uint32_t, UInt32Array);
	%array_class(int16_t, Int16Array);
	%array_class(uint16_t, UInt16Array);
	%array_class(int8_t, Int8Array);
	%array_class(uint8_t, UInt8Array);
	%array_class(float, FloatArray);
	%array_class(double, DoubleArray);
	%array_class(bool, BoolArray);

```

In your case, you want to use UInt32Array for an array of UINT since UINT are 32 bits long.

---

<div class="post-metadata">

**Author:** ![Marisabel](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/marisabel/32/125_2.png) [@Marisabel](https://discourse.f2i-consulting.com/u/Marisabel)\
**Post date:** [December 2, 2024, 2:52pm UTC](https://discourse.f2i-consulting.com/t/convert-fault-ascii-to-resqml/242/5 "2024-12-02T14:52:53Z")

</div>

I do exactly that for the two required arrays, as shown in the following lines

- resqml\_nodes = fesapi.UInt32Array(num\_points\_nodes)
- resqml\_points = fesapi.DoubleArray(num\_points \* 3)

I then populate both arrays with the data, and finally:  
polyline\_set\_representation.pushBackGeometryPatch(resqml\_nodes,resqml\_points,num\_points\_nodes,False,hdf\_proxy)

However, this last step results in the following error:  
[9245](file:///…/Python311/Lib/site-packages/fesapi/ **init**.py:9245) def pushBackGeometryPatch(self, \*args) → “void”: →   
[9246](file:///…/Python/Python311/Lib/site-packages/fesapi/ **init**.py:9246) return \_fesapi.Resqml2\_PolylineSetRepresentation\_pushBackGeometryPatch(self, \*args) TypeError: Wrong number or type of arguments for overloaded function ‘Resqml2\_PolylineSetRepresentation\_pushBackGeometryPatch’. Possible C/C++ prototypes are: resqml2::PolylineSetRepresentation::pushBackGeometryPatch(unsigned int \*,double \*,uint64\_t,bool,eml2::AbstractHdfProxy \*,eml2::AbstractLocal3dCrs \*) resqml2::PolylineSetRepresentation::pushBackGeometryPatch(unsigned int \*,double \*,uint64\_t,bool,eml2::AbstractHdfProxy \*) resqml2::PolylineSetRepresentation::pushBackGeometryPatch(unsigned int \*,double \*,uint64\_t,bool) resqml2::PolylineSetRepresentation::pushBackGeometryPatch(unsigned int \*,double \*,uint64\_t,bool \*,eml2::AbstractHdfProxy \*,eml2::AbstractLocal3dCrs \*) resqml2::PolylineSetRepresentation::pushBackGeometryPatch(unsigned int \*,double \*,uint64\_t,bool \*,eml2::AbstractHdfProxy \*) resqml2::PolylineSetRepresentation::pushBackGeometryPatch(unsigned int \*,double \*,uint64\_t,bool \*)

The error suggests a mismatch in the number or types of arguments for the `pushBackGeometryPatch()` function. However, I have already provided all the arguments in the correct order.

---

<div class="post-metadata">

**Author:** ![philippeVerney](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/philippeverney/32/29_2.png) [@philippeVerney](https://discourse.f2i-consulting.com/u/philippeVerney)\
**Post date:** [December 2, 2024, 4:26pm UTC](https://discourse.f2i-consulting.com/t/convert-fault-ascii-to-resqml/242/6 "2024-12-02T16:26:17Z")

</div>

It looks like a bug on FESAPI Python version side. I am on it and will let you know when I’ll find time to investigate exactly why.

---

<div class="post-metadata">

**Author:** ![Marisabel](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/marisabel/32/125_2.png) [@Marisabel](https://discourse.f2i-consulting.com/u/Marisabel)\
**Post date:** [December 2, 2024, 4:30pm UTC](https://discourse.f2i-consulting.com/t/convert-fault-ascii-to-resqml/242/7 "2024-12-02T16:30:14Z")

</div>

Thank you very much!

---

<div class="post-metadata">

**Author:** ![philippeVerney](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/philippeverney/32/29_2.png) [@philippeVerney](https://discourse.f2i-consulting.com/u/philippeVerney)\
**Post date:** [December 2, 2024, 4:46pm UTC](https://discourse.f2i-consulting.com/t/convert-fault-ascii-to-resqml/242/8 "2024-12-02T16:46:20Z")

</div>

It actually looks more as an example bug where I forgot to cast the array.  
The cast looks mandatory here maybe because Python cannot deduce the correct cast in case of overloaded methods…

Could you try to cast your arrays when used in a method please?  
`polyline_set_representation.pushBackGeometryPatch(resqml_nodes.cast(),resqml_points.cast(),num_points_nodes,False,hdf_proxy)`  
instead of  
`polyline_set_representation.pushBackGeometryPatch(resqml_nodes,resqml_points,num_points_nodes,False,hdf_proxy)`

---

<div class="post-metadata">

**Author:** ![Marisabel](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/marisabel/32/125_2.png) [@Marisabel](https://discourse.f2i-consulting.com/u/Marisabel)\
**Post date:** [December 2, 2024, 5:58pm UTC](https://discourse.f2i-consulting.com/t/convert-fault-ascii-to-resqml/242/9 "2024-12-02T17:58:16Z")

</div>

It works! I successfully created the fault in RESQML. Thank you very much for your help!
