Problem importing Step (.stp) - 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!
PepperSoris
Posts: 17
Joined: Wed Dec 13, 2017 7:30 am

Problem importing Step (.stp) - File

Postby PepperSoris » Fri Jan 25, 2019 12:24 pm

Dear all,
I try to Import a STEP (.stp) file that was exported by a commercial software.
Unfortunately, I can't share the file.
The step file is of the plain-text type, (FILE_DESCRIPTION(('STEP AP214'),'1');)

If I open the file in FreeCad 0.17 it will start reading the file, the status bar says "Reading STEP file..." and the percent start to count up to around 16%. Then the operation disappears, but nothing was imported. What strange is: in the output window there is this message (repeated 4x times)

Code: Select all

not a freecad file: .STP
not a freecad file: .STP
not a freecad file: .STP
not a freecad file: .STP
If I open the file in FreeCad 0.18_pre it will show the following error message, which is not helpful

Code: Select all

Traceback (most recent call last):
  File "<string>", line 1, in <module>
<type 'exceptions.RuntimeError'>: Access violation
I tried to find out - by trial&error - which line the file causes this error by trimming the .stp file from the end until the error disappears. This line seems to be related to error message

Code: Select all

#4567=PRODUCT_DEFINITION('test','tes2',#123,#1234);
However, If I delete this line, there will be the same error, probably in a different line.

Does anybody have an idea, how I can debug this problem?

----
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 32-bit
Version: 0.18.15697 (Git)
Build type: Release
Branch: master
Hash: dedaa807629ab25cf32977d30bf7610f1346aff7
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Germany (de_DE)
User avatar
meme2704
Posts: 2926
Joined: Sat Apr 01, 2017 2:47 pm
Location: Vosges

Re: Problem importing Step (.stp) - File

Postby meme2704 » Fri Jan 25, 2019 1:44 pm

Hi
if it's a commercial product, maybe you're not up to date with your membership fee or you do not have the license to buy :?:
openBrain
Posts: 2119
Joined: Fri Nov 09, 2018 5:38 pm

Re: Problem importing Step (.stp) - File

Postby openBrain » Fri Jan 25, 2019 1:46 pm

Hi,

I got a quick look but can't actually find anything really useful.
I'm not a STEP expert, but a clue can be that AP214 defines a quite special AIM dedicated to automotive design.
The most standard AIM is defined in AP203. My idea was that maybe FreeCAD importer only supports for AP203, but I can't find right now any evidence of whether this idea is correct or not. :|
Are you able to get the file in another format (IGES, OBJ, ...) ?
User avatar
easyw-fc
Posts: 2661
Joined: Thu Jul 09, 2015 9:34 am

Re: Problem importing Step (.stp) - File

Postby easyw-fc » Fri Jan 25, 2019 2:12 pm

PepperSoris wrote:
Fri Jan 25, 2019 12:24 pm
Dear all,
I try to Import a STEP (.stp) file that was exported by a commercial software.
Unfortunately, I can't share the file.
The step file is of the plain-text type, (FILE_DESCRIPTION(('STEP AP214'),'1');)

If I open the file in FreeCad 0.17 it will start reading the file, the status bar says "Reading STEP file..." and the percent start to count up to around 16%. Then the operation disappears, but nothing was imported. What strange is: in the output window there is this message (repeated 4x times)

Code: Select all

not a freecad file: .STP
not a freecad file: .STP
not a freecad file: .STP
not a freecad file: .STP
If I open the file in FreeCad 0.18_pre it will show the following error message, which is not helpful

Code: Select all

Traceback (most recent call last):
  File "<string>", line 1, in <module>
<type 'exceptions.RuntimeError'>: Access violation
I tried to find out - by trial&error - which line the file causes this error by trimming the .stp file from the end until the error disappears. This line seems to be related to error message

Code: Select all

#4567=PRODUCT_DEFINITION('test','tes2',#123,#1234);
However, If I delete this line, there will be the same error, probably in a different line.

Does anybody have an idea, how I can debug this problem?

----
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 32-bit
Version: 0.18.15697 (Git)
Build type: Release
Branch: master
Hash: dedaa807629ab25cf32977d30bf7610f1346aff7
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Germany (de_DE)
Hi,
you may try with CADAssistant from OCC
https://www.opencascade.com/content/cad-assistant
or also with DesignSpark Mechanical
https://www.rs-online.com/designspark/m ... stallation

If it is not viewable with those, it could be malformed.
openBrain wrote:
Fri Jan 25, 2019 1:46 pm
I'm not a STEP expert, but a clue can be that AP214 defines a quite special AIM dedicated to automotive design.
The most standard AIM is defined in AP203. My idea was that maybe FreeCAD importer only supports for AP203, but I can't find right now any evidence of whether this idea is correct or not.
FC can read AP203 & AP214.
PepperSoris
Posts: 17
Joined: Wed Dec 13, 2017 7:30 am

Re: Problem importing Step (.stp) - File

Postby PepperSoris » Mon Jan 28, 2019 7:39 am

@easyw-fc: thank you for the tip with Cad Assistant; I did not know about this great CAD / STEP file Viewer.

The file imports nicely into Open Cascade Cad Assistant 1.2.1. This means that at least the file is not corrupt.
User avatar
easyw-fc
Posts: 2661
Joined: Thu Jul 09, 2015 9:34 am

Re: Problem importing Step (.stp) - File

Postby easyw-fc » Mon Jan 28, 2019 9:44 am

PepperSoris wrote:
Fri Jan 25, 2019 12:24 pm
If I open the file in FreeCad 0.17 it will start reading the file, the status bar says "Reading STEP file..." and the percent start to count up to around 16%. Then the operation disappears, but nothing was imported. What strange is: in the output window there is this message (repeated 4x times)

Code: Select all

not a freecad file: .STP
not a freecad file: .STP
not a freecad file: .STP
not a freecad file: .STP
it seems a step file with 'External References'... this is not fully supported in FC main code...
you could try with Asm3 branch (it could be some security issues)
https://forum.freecadweb.org/viewtopic. ... 50#p237344
https://github.com/realthunder/FreeCAD_ ... -Notes-0.9
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Problem importing Step (.stp) - File

Postby NormandC » Tue Jan 29, 2019 3:36 pm

easyw-fc wrote:
Mon Jan 28, 2019 9:44 am
it seems a step file with 'External References'...
Do those even exist?


PepperSoris wrote:
Fri Jan 25, 2019 12:24 pm
What strange is: in the output window there is this message (repeated 4x times)
Those "not a freecad file" messages are not related to your issue. They're produced by the Start page, they can be disregarded. It prints these messages in the Report view when it builds the "Recent files" section, each time it encounters a file that was not a FCStd file.

The message is repeated 4 times, because you previously opened 4 separate STP files. You will see them in the Start page's Recent files list.
User avatar
easyw-fc
Posts: 2661
Joined: Thu Jul 09, 2015 9:34 am

Re: Problem importing Step (.stp) - File

Postby easyw-fc » Tue Jan 29, 2019 4:00 pm

NormandC wrote:
Tue Jan 29, 2019 3:36 pm
easyw-fc wrote:
Mon Jan 28, 2019 9:44 am
it seems a step file with 'External References'...
Do those even exist?
Yes, and FC can open them (not always perfectly though)
External references are partially supported when importing the file(s), but are not supported/implemented when exporting step external references.
Links:
https://www.cax-if.org/library/index.html (and search for External References in the page)
example file:
https://www.cax-if.org/library/s1-c5-214.zip
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Problem importing Step (.stp) - File

Postby NormandC » Tue Jan 29, 2019 4:18 pm

Thanks for the links.
PepperSoris
Posts: 17
Joined: Wed Dec 13, 2017 7:30 am

Re: Problem importing Step (.stp) - File

Postby PepperSoris » Thu Jan 31, 2019 7:06 am

I installed the Asm3-Branch, but error message stays the same, but is now repeated twice for the same file. My STEP file is a sinlge, self-contained file, with no external or additional files.

Code: Select all

Traceback (most recent call last):
  File "<string>", line 1, in <module>
<type 'exceptions.RuntimeError'>: Access violation
Traceback (most recent call last):
  File "<string>", line 1, in <module>
<type 'exceptions.RuntimeError'>: Access violation
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15841 (Git)
Build type: Release
Branch: (HEAD detached at FETCH_HEAD)
Hash: 362441873b984a4f169fd430f989aee1016a337e
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Germany (de_DE)


I tried to debug into the issuse with gdb.ex (GNU Debugger), but it ist not clear for me, what's going on.

Code: Select all

Thread 1 received signal SIGSEGV, Segmentation fault.
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
0x00007ff8a434403f in TKXSBase!?AddList@Interface_EntityIterator@@QEAAXAEBV?$handle@VTColStd_HSequenceOfTransient@@@opencascade@@@Z () from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKXSBase.dll

> bt

Python Exception <type 'exceptions.ImportError'> No module named gdb.frames: 
#0  0x00007ff8a434403f in TKXSBase!?AddList@Interface_EntityIterator@@QEAAXAEBV?$handle@VTColStd_HSequenceOfTransient@@@opencascade@@@Z () from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKXSBase.dll
#1  0x00007ff8a434ade5 in TKXSBase!?Sharings@Interface_Graph@@QEBA?AVInterface_EntityIterator@@AEBV?$handle@VStandard_Transient@@@opencascade@@@Z () from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKXSBase.dll
#2  0x00007ff8a302ae1d in TKSTEP!?CheckSRRReversesNAUO@STEPConstruct_Assembly@@SA_NAEBVInterface_Graph@@AEBV?$handle@VStepShape_ContextDependentShapeRepresentation@@@opencascade@@@Z ()
   from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKSTEP.dll
#3  0x00007ff8a3090beb in TKSTEP!?TransferEntity@STEPControl_ActorRead@@IEAA?AV?$handle@VTransferBRep_ShapeBinder@@@opencascade@@AEBV?$handle@VStepRepr_NextAssemblyUsageOccurrence@@@3@AEBV?$handle@VTransfer_TransientProcess@@@3@@Z ()
   from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKSTEP.dll
#4  0x00007ff8a308e616 in TKSTEP!?TransferEntity@STEPControl_ActorRead@@IEAA?AV?$handle@VTransferBRep_ShapeBinder@@@opencascade@@AEBV?$handle@VStepBasic_ProductDefinition@@@3@AEBV?$handle@VTransfer_TransientProcess@@@3@@Z ()
   from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKSTEP.dll
#5  0x00007ff8a309108d in TKSTEP!?TransferEntity@STEPControl_ActorRead@@IEAA?AV?$handle@VTransferBRep_ShapeBinder@@@opencascade@@AEBV?$handle@VStepRepr_NextAssemblyUsageOccurrence@@@3@AEBV?$handle@VTransfer_TransientProcess@@@3@@Z ()
   from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKSTEP.dll
#6  0x00007ff8a308e616 in TKSTEP!?TransferEntity@STEPControl_ActorRead@@IEAA?AV?$handle@VTransferBRep_ShapeBinder@@@opencascade@@AEBV?$handle@VStepBasic_ProductDefinition@@@3@AEBV?$handle@VTransfer_TransientProcess@@@3@@Z ()
   from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKSTEP.dll
#7  0x00007ff8a309402f in TKSTEP!?TransferShape@STEPControl_ActorRead@@QEAA?AV?$handle@VTransfer_Binder@@@opencascade@@AEBV?$handle@VStandard_Transient@@@3@AEBV?$handle@VTransfer_TransientProcess@@@3@_N@Z ()
   from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKSTEP.dll
#8  0x00007ff8a308dcdf in TKSTEP!?Transfer@STEPControl_ActorRead@@UEAA?AV?$handle@VTransfer_Binder@@@opencascade@@AEBV?$handle@VStandard_Transient@@@3@AEBV?$handle@VTransfer_TransientProcess@@@3@@Z ()
   from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKSTEP.dll
#9  0x00007ff8a436104a in TKXSBase!?Transferring@Transfer_ActorOfTransientProcess@@UEAA?AV?$handle@VTransfer_Binder@@@opencascade@@AEBV?$handle@VStandard_Transient@@@3@AEBV?$handle@VTransfer_ProcessForTransient@@@3@@Z ()
   from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKXSBase.dll
#10 0x00007ff8a436ed45 in TKXSBase!?TransferProduct@Transfer_ProcessForTransient@@AEAA?AV?$handle@VTransfer_Binder@@@opencascade@@AEBV?$handle@VStandard_Transient@@@3@@Z ()
   from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKXSBase.dll
#11 0x00007ff8a436f3b8 in TKXSBase!?Transferring@Transfer_ProcessForTransient@@QEAA?AV?$handle@VTransfer_Binder@@@opencascade@@AEBV?$handle@VStandard_Transient@@@3@@Z ()
   from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKXSBase.dll
#12 0x00007ff8a436ec7c in TKXSBase!?Transfer@Transfer_ProcessForTransient@@QEAA_NAEBV?$handle@VStandard_Transient@@@opencascade@@@Z () from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKXSBase.dll
#13 0x00007ff8a43dd6c0 in TKXSBase!?TransferOne@XSControl_TransferReader@@QEAAHAEBV?$handle@VStandard_Transient@@@opencascade@@_N@Z () from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKXSBase.dll
#14 0x00007ff8a43d68e9 in TKXSBase!?TransferEntity@XSControl_Reader@@QEAA_NAEBV?$handle@VStandard_Transient@@@opencascade@@@Z () from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKXSBase.dll
#15 0x00007ff8a43d6d2b in TKXSBase!?TransferOneRoot@XSControl_Reader@@QEAA_NH@Z ()
   from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKXSBase.dll
#16 0x00007ff8a23990da in TKXDESTEP!?Transfer@STEPCAFControl_Reader@@IEAA_NAEAVSTEPControl_Reader@@HAEAV?$handle@VTDocStd_Document@@@opencascade@@AEAV?$NCollection_Sequence@VTDF_Label@@@@_N@Z ()
   from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKXDESTEP.dll
#17 0x00007ff8a239aa3b in TKXDESTEP!?Transfer@STEPCAFControl_Reader@@QEAA_NAEAV?$handle@VTDocStd_Document@@@opencascade@@@Z () from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\bin\TKXDESTEP.dll
#18 0x00007ff8c7a10589 in ImportGui!?SetPresentation@XCAFDimTolObjects_GeomToleranceObject@@QEAAXAEBVTopoDS_Shape@@AEBV?$handle@VTCollection_HAsciiString@@@opencascade@@@Z ()
   from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\Mod\Import\ImportGui.pyd
#19 0x00007ff8c7a10ca5 in ImportGui!?SetPresentation@XCAFDimTolObjects_GeomToleranceObject@@QEAAXAEBVTopoDS_Shape@@AEBV?$handle@VTCollection_HAsciiString@@@opencascade@@@Z ()
   from C:\temp\FreeCAD-asm3-20190121-49e18e2c-e15a96b-Win64\Mod\Import\ImportGui.pyd
   ...