Closed aravantaa closed 1 year ago
Hi @aravantaa
Thank you very much for posting this very well detailed, explained and formatted issue. We appreciate a lot your support.
It seems it is an MAPDL error.
Pinging @FredAns for visibility.
I might be able to do something on the client side to mitigate this issue.
Kind regards,
Surprisingly, in MAPDL you can do this:
IOPTN,IGES,SMOOTH
IOPTN,MERGE,YES
IOPTN,SOLID,YES
IOPTN,SMALL,YES
IOPTN,GTOLER, DEFA
IGESIN,'test','igs','..\other path with spaces\'
And it works. But the third argument of IGESIN
is not documented.
Hi @aravantaa, @germa89, & @FredAns Here is a way to do this with utilizing the PyMAPDL input_strings method and some Python replacing. I created a folder with some spaces in it and am using it as the Python (Jupyter Lab) and MAPDL working directory.
from ansys.mapdl.core import launch_mapdl
import os
path = os.getcwd()
mapdl = launch_mapdl(run_location = path)
iges = "test.igs"
cad_file = os.path.join(path, iges)
print(cad_file)
The cad_file value is D:\TechnicalSupport\PyMAPDL\1601\Folder With White Space\test.igs Then the input continues with:
mapdl.clear()
cmd = '''
*dim,iges_file,string,248
*set,iges_file(1),'QQQ'
'''.replace("QQQ",cad_file)
mapdl.input_strings(cmd)
mapdl.aux15()
mapdl.igesin('iges_file(1)')
mapdl.prep7()
print(mapdl.geometry)
mapdl.aplot('all')
And the resulting geometry:
I tried different options on the MPADL Iges import but there is a bad surface/area and the volume cannot be auto created.
Mike
@mikerife Thank you for the workaround Mike. It works fine on my end as well (pyCharm). Good idea to inject the apdl commands. @germa89 Yes, I also suspected a limitation with APDL at first, but when I could read in the IGES like you describe, I figured that was not the case.
Hi @aravantaa, @germa89, & @FredAns Here is a way to do this with utilizing the PyMAPDL input_strings method and some Python replacing. I created a folder with some spaces in it and am using it as the Python (Jupyter Lab) and MAPDL working directory.
from ansys.mapdl.core import launch_mapdl import os path = os.getcwd() mapdl = launch_mapdl(run_location = path) iges = "test.igs" cad_file = os.path.join(path, iges) print(cad_file)
The cad_file value is D:\TechnicalSupport\PyMAPDL\1601\Folder With White Space\test.igs Then the input continues with:
mapdl.clear() cmd = ''' *dim,iges_file,string,248 *set,iges_file(1),'QQQ' '''.replace("QQQ",cad_file) mapdl.input_strings(cmd) mapdl.aux15() mapdl.igesin('iges_file(1)') mapdl.prep7() print(mapdl.geometry) mapdl.aplot('all')
And the resulting geometry:
I tried different options on the MPADL Iges import but there is a bad surface/area and the volume cannot be auto created.
Mike
Awesome @mikerife ! I could implement that trick on PyMAPDL. :)
Thank you!
@germa89 any chance for a bug fix for this? thanks!
Not for the moment unfortunately. :(
@germa89 Thanks for the follow up. We have a workaround that works fine for now. Cheers!
Before submitting the issue
pip install --upgrade --upgrade-strategy eager ansys-mapdl-core
)Description of the bug
When trying to read an *.IGES file from a path with white spaces, it falls over with the following error message:
When reading the IGES file from a path without white spaces, it works fine. in the APDL GUI, it can read iges files from paths containing white spaces.
Steps To Reproduce
Steps:
directory
variable accordingly. The error message above should point to thedirectory
variable, sans whitespaces.Code in question:
Which Operating System are you using?
Windows
Which Python version are you using?
3.10
PyMAPDL Report
PyMAPDL report
```text ------------------------------------------------------------------------------- PyMAPDL Software and Environment Report Packages Requirements ********************* Core packages ------------- ansys.mapdl.core : 0.63.3 numpy : 1.23.4 appdirs : 1.4.4 scipy : 1.9.3 grpc : Package not found ansys.api.mapdl.v0 : Package not found ansys.mapdl.reader : 0.52.3 google.protobuf : Package not found Optional packages ----------------- matplotlib : 3.6.1 pyvista : 0.36.1 pyiges : 0.2.1 tqdm : 4.64.1 Ansys Installation ****************** Version Location ------------------ 191 C:\Program Files\ANSYS Inc\v191 193 C:\Program Files\ANSYS Inc\v193 202 C:\Program Files\ANSYS Inc\v202 212 C:\Program Files\ANSYS Inc\v212 221 C:\Program Files\ANSYS Inc\v221 222 C:\Program Files\ANSYS Inc\v222 Ansys Environment Variables *************************** ANSYS191_DIR C:\Program Files\ANSYS Inc\v191\ANSYS ANSYS193_DIR C:\Program Files\ANSYS Inc\v193\ANSYS ANSYS202_DIR C:\Program Files\ANSYS Inc\v202\ANSYS ANSYS212_DIR C:\Program Files\ANSYS Inc\v212\ANSYS ANSYS221_DIR C:\Program Files\ANSYS Inc\v221\ANSYS ANSYS222_DIR C:\Program Files\ANSYS Inc\v222\ANSYS ANSYS231_DIR C:\Program Files\ANSYS Inc\v231\ANSYS ANSYSCLOUDCLI_ROOT C:\Program Files\ANSYS Inc\ANSYS Cloud\ANSYS Cloud CLI\ ANSYSELECTRON_ROOT C:\Program Files\ANSYS Inc\ANSYS Cloud\ANSYS Electron\ ANSYSLIC_DIR C:\Program Files\ANSYS Inc\Shared Files\Licensing ANSYSLMD_LICENSE_FILE ansyslmd.lic ANSYSNCODE222_DIR C:\Program Files\nCode\ANSYS 2022 R2 nCode DesignLife 64-bit ANSYS_SYSDIR winx64 ANSYS_SYSDIR32 win32 AWP_LOCALE191 en-us AWP_LOCALE193 en-us AWP_LOCALE202 en-us AWP_LOCALE212 en-us AWP_LOCALE221 en-us AWP_LOCALE222 en-us AWP_ROOT191 C:\Program Files\ANSYS Inc\v191 AWP_ROOT193 C:\Program Files\ANSYS Inc\v193 AWP_ROOT202 C:\Program Files\ANSYS Inc\v202 AWP_ROOT212 C:\Program Files\ANSYS Inc\v212 AWP_ROOT221 C:\Program Files\ANSYS Inc\v221 AWP_ROOT222 C:\Program Files\ANSYS Inc\v222 AWP_ROOT231 C:\Program Files\ANSYS Inc\v231 CADOE_LIBDIR191 C:\Program Files\ANSYS Inc\v191\CommonFiles\Language\en-us CADOE_LIBDIR193 C:\Program Files\ANSYS Inc\v193\CommonFiles\Language\en-us CADOE_LIBDIR202 C:\Program Files\ANSYS Inc\v202\CommonFiles\Language\en-us CADOE_LIBDIR212 C:\Program Files\ANSYS Inc\v212\CommonFiles\Language\en-us CADOE_LIBDIR221 C:\Program Files\ANSYS Inc\v221\CommonFiles\Language\en-us CADOE_LIBDIR222 C:\Program Files\ANSYS Inc\v222\CommonFiles\Language\en-us CADOE_LIBDIR231 C:\Program Files\ANSYS Inc\v231\CommonFiles\Language\en-us ICEFLOW_ANSYS_PORT 9600 ```Installed packages
Show the installed packages!
``` WARNING: Ignoring invalid distribution -rotobuf (d:\sr\edrmedeso_import_pyansys\proj\venv\lib\site-packages) aiohttp==3.8.3 aiosignal==1.2.0 ansys-api-mapdl==0.5.1 ansys-api-platform-instancemanagement==1.0.0b3 ansys-mapdl-core==0.63.3 ansys-mapdl-reader==0.52.3 ansys-platform-instancemanagement==1.0.2 appdirs==1.4.4 async-timeout==4.0.2 attrs==22.1.0 bottle==0.12.23 cachetools==5.2.0 certifi==2022.9.24 charset-normalizer==2.1.1 colorama==0.4.6 commonmark==0.9.1 contourpy==1.0.6 cycler==0.11.0 Cython==0.29.32 fonttools==4.38.0 frozenlist==1.3.1 geomdl==5.3.1 google-api-core==2.10.2 google-api-python-client==2.65.0 google-auth==2.13.0 google-auth-httplib2==0.1.0 googleapis-common-protos==1.56.4 grpcio==1.50.0 grpcio-tools==1.50.0 httplib2==0.21.0 idna==3.4 imageio==2.22.2 importlib-metadata==5.0.0 kiwisolver==1.4.4 matplotlib==3.6.1 more-itertools==9.0.0 multidict==6.0.2 numpy==1.23.4 packaging==21.3 Paste==3.5.2 Pillow==9.3.0 pkginfo==1.8.3 protobuf==3.20.3 protoc-gen-swagger==0.1.0 pyasn1==0.4.8 pyasn1-modules==0.2.8 Pygments==2.13.0 pyiges==0.2.1 pyparsing==3.0.9 python-dateutil==2.8.2 pyvista==0.36.1 pywin32-ctypes==0.2.0 requests==2.28.1 rfc3986==2.0.0 rsa==4.9 scipy==1.9.3 scooby==0.7.0 six==1.16.0 tqdm==4.64.1 uritemplate==4.1.1 urllib3==1.26.12 vtk==9.2.2 webencodings==0.5.1 wslink==1.9.0 yarl==1.8.1 zipp==3.10.0 ```