Python Forum
TypeError: size; expecting a recognized type filling string dict - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: TypeError: size; expecting a recognized type filling string dict (/thread-24346.html)



TypeError: size; expecting a recognized type filling string dict - a11_m11 - Feb-10-2020

I have been working on Python script for Abaqus and it has to do with dynamic changes in the parameters of the model. The script opens up a .txt file and reads different values. The values are separated using tabs and I am using split() function of the Abaqus-Python to read the values properly once I have assigned them to a list.
The last index is [5] and it contains mesh size, again a float value. The structure is properly drawn in ABAQUS, the only error it throws me is while assigning the mesh size. It throws me the error listed above. So I tried using repr() to make it a string, but I was it will throw me that the input should be float/integer value and it did exactly the same. Now I am stuck and I can't work any further. I even tried to truncate the float value to 3-decimal points for the mesh size, but it would still throw the same error.
Any help is much appreciated, thanks a lot :)

What I am expecting is that it writes exactly how the mesh size must be written in the specified line. I don't understand what is the problem, because it is able to write the dimensions properly, the only problem comes while writing the float value of mesh size.

CODE:::

beamPart.setElementType(elemTypes=(ElemType(elemCode=B23, elemLibrary=STANDARD), ), regions=beam_mesh_region)
    beamPart.seedPart(deviationFactor=0.1, minSizeFactor=0.1, size=mesh)
In the above line, it throws me the error as shown in the thread :::
Error:
TypeError: size; found 'module', expecting a recognized type filling string dict
From what I know is, it always writes in 'module' - so the error has something to with size or the filling string dict.

The exact error looks like this:
Error:
File "C:\Users\ANANT\PycharmProjects\test_final\test_copy.py", line 104, in <module> beamPart.seedPart(deviationFactor=0.1, minSizeFactor=0.1, size=mesh) TypeError: size; found 'module', expecting a recognized type filling string dict
Thanks for the feedback, I shall keep that in mind hereafter.