Salome 9.3.0 cannot generate .fms file
first to avoid syntax errors. I had to replace all occurrences of
print ---whatever---- with print (---whatever----) in scripts extractFeatureEdges.py and salomeTriSurf.py ( the opening and closing parentheses are essential) (These scripts are found under the installation of cfMesh software you can download cfMesh from their site or find it part of OpenFoam 18.0.6) I load script salomeTriSurf.py in Salome 9.3.0 after highlighting my mesh in the Mesh module and pressing Ctrl-t) Then, when I type triSurf().writeFms('FileName.fms') in the command window opened up by the loaded script, I get the following error on line 113: AttributeError: 'collections.OrderedDict' object has no attribute 'iteritems' I am beginning to wonder if those scripts were written to be understood by python 2.7 but not by python 3.6 which is the one used by Salome 9.3.0 Has anybody encountered this error ? |
Quote:
https://www.cfd-online.com/Forums/op...sh-cfmesh.html Alternatively, you can download salime 8.5, and it should work there. Best regards, Igor Carvalho |
Thanks Igor. I will stick with version 7.4.0 since I had already downloaded it. Version 9.3.0 does not even work when you modify the scripts using the 2to3 python conversion program. (you get TypeError updateObjBrowser() takes 1 argument but 2 were given)
|
Hey, anohter way can be to export a stl file a then convert it with surfaceToFMS.
|
1 Attachment(s)
Quote:
You were close, the problem is that it open the file to write in binary: Code:
open(fileName, 'wb') Code:
open(fileName, 'w') And for using it, after loading the script, I selected a surface mesh and then on the console i typed: Code:
|
Quote:
|
Quote:
|
salomeTriSurf3.py
Hello
I used salomeTriSurf3.py and many other script, But all failed. please help me to overcome that issues. I got that error. >>> exec(open("/home/smeralda/Cfmesh/cfMesh/python/Salome/salomeTriSurf3.py", "rb").read()) >>> triSurf().writeFms(‘FileName.fms’) Traceback (most recent call last): File "/opt/Salome/V2019.0.3_universal/prerequisites/Python-365/lib/python3.6/codeop.py", line 87, in _maybe_compile code1 = compiler(source + "\n", filename, symbol) File "/opt/Salome/V2019.0.3_universal/prerequisites/Python-365/lib/python3.6/codeop.py", line 102, in _compile return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT) File "<input>", line 1 triSurf().writeFms(‘FileName.fms’) ^ SyntaxError: invalid character in identifier >>> |
Quote:
Hello I used salomeTriSurf3.py and many other script, But all failed. please help me to overcome that issues. I got that error. >>> exec(open("/home/smeralda/Cfmesh/cfMesh/python/Salome/salomeTriSurf3.py", "rb").read()) >>> triSurf().writeFms(‘FileName.fms’) Traceback (most recent call last): File "/opt/Salome/V2019.0.3_universal/prerequisites/Python-365/lib/python3.6/codeop.py", line 87, in _maybe_compile code1 = compiler(source + "\n", filename, symbol) File "/opt/Salome/V2019.0.3_universal/prerequisites/Python-365/lib/python3.6/codeop.py", line 102, in _compile return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT) File "<input>", line 1 triSurf().writeFms(‘FileName.fms’) ^ SyntaxError: invalid character in identifier >>> |
Quote:
|
Succeed
Quote:
Finally succeeded thanks a lot |
Problem
Quote:
Hello Thank you for your post. I did exactly what you wrote but failed at the begging of pressing Enter button. I don't know why?. Thanks again. |
Thanks
Quote:
Thank you very much. I fixed the problem of cfmesh with the blender. Thanks again. |
1 Attachment(s)
If anyone stumbles on this post, what worked for me (Salome 9.9.0) was:
1) Update extractFeatureEdges.py to py2/3 using futurize. Skip to Step 1, 1b here if you already have python installed. This updates your file to work with Python 2 or 3. 2) Delete "x" in "xrange" in 3 places to use "range" which is what is used in Python3 3) Delete or comment out the last 2 lines (line 131,132). in extractFeatureEdges.py. cfmesh hasn't been updated in years so should be same for you. i.e # if salome.sg.hasDesktop(): # salome.sg.updateObjBrowser(True) 4) Run script in Salome as usual 5) Refresh through object browser as "Ship Designer" mentioned This worked for me! |
All times are GMT -4. The time now is 12:57. |