Error when importing .step file

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
cmorgan
Posts: 2
Joined: Fri Jan 31, 2020 11:58 pm

Error when importing .step file

Post by cmorgan »

FreeCad 0.19 pre-release version (same occurs on the Freecad 0.18 release) on macOS.

Step file is at https://filebin.ca/5Am0GxMP72Oi/OM-O2S.step (too large to upload here)


Got this in the console for output:

/Applications/FreeCAD.app/Contents/Resources/lib/python3.8/site-packages/numpy/ma/core.py:4466: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.shape is ():
A3 available
/Applications/FreeCAD.app/Contents/Resources/lib/python3.8/site-packages/mpmath/ctx_mp_python.py:892: SyntaxWarning: "is" with a literal. Did you mean "=="?
if other is 0:
/Applications/FreeCAD.app/Contents/Resources/lib/python3.8/site-packages/mpmath/ctx_mp_python.py:986: SyntaxWarning: "is" with a literal. Did you mean "=="?
if other is 0:
Traceback (most recent call last):
File "<string>", line 1, in <module>
<class 'OSError'>: cannot read STEP file


Any ideas?
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Error when importing .step file

Post by vocx »

cmorgan wrote: Sat Feb 01, 2020 12:02 am Got this in the console for output:
These are warnings, not errors. They seem to be harmless. See the following thread.

Errors on startup
vocx wrote: Wed Jan 29, 2020 4:38 pm
chrisb wrote: Tue Jan 28, 2020 6:45 pm ...

Code: Select all

...
/Users/cb/Desktop/FreeCAD.app/Contents/Resources/lib/python3.8/site-packages/mpmath/ctx_mp_python.py:986: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if other is 0:
The previous version used Python3.8 as well and did not show these errors.
As looo says, these are not errors, they are warnings. Specifically, these are warnings in the syntax of the programming language.

These warnings do no occur in FreeCAD's code, they occur in Python 3.8's code, inside numpy and mpmath libraries. I don't understand why this would happen. It's like the Python guys wrote something wrong. Maybe this is already corrected in another version of Python 3.8.y.
However, your problem is a bit different because you get an actual error

Code: Select all

Traceback (most recent call last):
File "<string>", line 1, in <module>
<class 'OSError'>: cannot read STEP file
This is an "operating system error". That sounds like the file cannot be read for some reason.

Try reading other Step files. Can you use a smaller Step file, based on the bigger one? Can you remove some components of that Step file and try again?
Last edited by vocx on Sat Feb 01, 2020 2:25 am, edited 1 time in total.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
cmorgan
Posts: 2
Joined: Fri Jan 31, 2020 11:58 pm

Re: Error when importing .step file

Post by cmorgan »

I don't have access to the original file, I was provided this step file as is.

In terms of what might have happened I downloaded and saved two files from the same email into the Downloads folder. The .stl file opens but this is just a block model, the .step file doesn't and reports the error you saw. I can't imagine there are different permissions but I did check to confirm that the .step file has the proper permissions. I can only imagine that for some reason the internal step file loader is what is throwing the OSError.
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Error when importing .step file

Post by easyw-fc »

When downloaded the file seems a STEP file.
Opening it with a text file displays everithing as it should...
I tried to open it with CADAssistant of OCC and it fails too...
Then it seems an issue of OCC parser or an issue of the other CAD that exported the model.
Pablonen
Posts: 1
Joined: Tue Nov 03, 2020 10:12 am

Re: Error when importing .step file

Post by Pablonen »

For those who come here from search-engines, as i did...

Error:

Code: Select all

Traceback (most recent call last):
  File "<string>", line 1, in <module>
<class 'OSError'>: cannot read STEP file
Solution, that worked for me:

Open .step file in text editor.
Edit the line, starting with

Code: Select all

FILE_NAME(
'/home/.../123.step',
  '2020-10-14T12:36:15',('Author'),(''),
  'Open CASCADE STEP processor 7.4','FreeCAD','Unknown');
Enter correct filename (no spaces, etc.)
Save.
Import in Freecad.

BR
batucngiz
Posts: 3
Joined: Mon Jul 10, 2023 9:10 am
Contact:

Re: Error when importing .step file

Post by batucngiz »

I didn't understand how to solve this problem dude, can you explain a little bit more?
Pablonen wrote: Tue Nov 03, 2020 10:21 am For those who come here from search-engines, as i did...

Error:

Code: Select all

Traceback (most recent call last):
  File "<string>", line 1, in <module>
<class 'OSError'>: cannot read STEP file
Solution, that worked for me:

Open .step file in text editor.
Edit the line, starting with

Code: Select all

FILE_NAME(
'/home/.../123.step',
  '2020-10-14T12:36:15',('Author'),(''),
  'Open CASCADE STEP processor 7.4','FreeCAD','Unknown');
Enter correct filename (no spaces, etc.)
Save.
Import in Freecad.

BR
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Error when importing .step file

Post by GeneFC »

batucngiz wrote: Mon Jul 10, 2023 10:27 am I didn't understand how to solve this problem dude, can you explain a little bit more?
The "dude" never returned to the forum again. (At least never logged in.)

If you have a question why don't you spell out exactly the problem you are seeing in new topic? A lot has changed in FreeCAD over the past three years. 8-)

Gene
Post Reply