--
You received this message because you are subscribed to the Google Groups "STEPcode - Developers Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scl-dev+u...@googlegroups.com.
To post to this group, send email to scl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scl-dev/ce7988a6-cbe0-4ce6-8ab0-e71f6cc2e7b3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Thomas,
I contributed the python code for SCL about one year ago as far as I remember. Unfortunately I didn't have any time to further improve these first experiments, and SCL has changed a lot in the meantime thanks to Mark's efforts. Everything thus remains in a very experimental stage. When I started this work, my objectives were:* be able to read/write step files from a set of instances created from a python script. My first experiment was a python wrapper on top of JSDAI, using Jython (http://sourceforge.net/projects/pysdai/), but I didnt' feel very confortable with using both Java and Python. I needed something with python only ;* SCL made possible to generate python code directly from an EXPRESS schema. My goal was to be as simple as possible: from an EXPRESS schema, generate only 1 python module that could be used with a simple 'from ap203 import*'.
* at last, more important: to be able to check EXPRESS rules. When a STEP based data exchange fails between A and B, it's quite difficult to identify where does the problem comes from, and which program is responsible for the failure: the source A or the target B? both ? Being able to ensure that the instance file is valid in regard with the integrity rules defined in the schema is thus something important.
I may have something on my hard disk that I did not push yet, I'll check that. Feel free to ask any question, I will give you an answer if I can remember what I did.
As an application programmer I have a different goal ;) I want to read everything possible, checking other's format is nice, but non of our concern.
Thank you very much. So far its going well. I already implemented a SimpleParser.py which is able to parse and recursively instantiate most of the standard file. Also already done is a GraphViz exporter which generate a graph diagram of the STEP graph. Makes it much easier for me to interpret new STEP files.
Next steps will be finishing instantiation and implementing a filter facility which allows to limit the transfer process to certain subsets of Item-types.
At the moment I develop on a certain subset of FreeCAD, but when I have something usable, I will send you a patch upstream.
Cheers
Jürgen
Hi Jürgen,
If you are working with large files of which you only need a subset, you might be interested in lazy loading, implemented in cllazyfile. I'm not sure that using it from python would be feasible, but it would reduce loading time and memory use if you don't need the entire file.
Once Dave and I get exp2cxx working with small files, I'll be able to debug a branch that I was working on previously. The changes in this branch allow inverse references to be located and associated with the inverse attribute, when using the cllazyfile. This isn't currently possible with or without lazy loading.
The IFC folks will be happy to have inverse references, and it'll also mean that STEPcode passes 100% of our tests for the first time.
Regards
Mark
--
You received this message because you are subscribed to the Google Groups "STEPcode - Developers Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scl-dev+u...@googlegroups.com.
To post to this group, send email to scl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scl-dev/8c4a8932-52cd-4e35-a714-fcc6973cdaf7%40googlegroups.com.
Actually, the more I think about it, the more certain I am that cllazyfile could be used with python easily. It wouldn't take much to add a method that returns a string containing the full text of an instance. This could be fed to the python instance parser.
I noticed that if I open a STEP file generated by commercial sw and save it by OCC I get a correct STEP file, but with a file size much bigger from 3 to 6 times bigger...
i.e. if I open https://github.com/stepcode/stepcode/blob/master/data/ap214e3/sg1-c5-214.stp
and I save it with OCC the size increases from 24kb to 143kb...
I also noticed that if I re-open the big-size file in a commercial sw and save it, the size will return to previous smaller value…
On Thursday, March 24, 2016 at 3:51:23 PM UTC+1, Sean wrote:
Not knowing anything else, that tells me that you have two different programs dumping out the same geometry in different ways.
git clone https://github.com/stepcode/stepcode.git stepcode
cd stepcode; mkdir build; cd build
cmake .. -G "MSYS Makefiles" -DSC_BUILD_SCHEMAS=ap214 -DSC_BUILD_SCHEMAS=../data/ap214e3
make -j4
cd bin
./p21read_sdai_ap214e3.exe cube-nx.stp cube-scl.stp
./p21read_sdai_ap214e3.exe cube-out-fc.stp cube-scl.stp
\p21read_sdai_ap214e3.exe: load file ...
Reading Data from cube-out-fc.stp...
HEADER read:
ERROR: instance #8 'MECHANICAL_CONTEXT': Unknown ENTITY type.
Data lost: ('',#2,'mechanical')
ERROR: instance #24 'PRODUCT_TYPE': Unknown ENTITY type.
Data lost: ('part',$,(#7))
ERROR: instance #366 'MECHANICAL_CONTEXT': Unknown ENTITY type.
Data lost: ('',#2,'mechanical')
ERROR: instance #373 'PRODUCT_TYPE': Unknown ENTITY type.
Data lost: ('part',$,(#365))
FIRST PASS complete: 380 instances created.
4 ERRORS 0 WARNINGS
ERROR: ENTITY #7 Product
frame_of_reference : index: 1
Reference to non-existent ENTITY #8.
ERROR in EXCHANGE FILE: incomplete instance #7.
ERROR: in 2nd pass, instance #8 not found.
Data lost: = MECHANICAL_CONTEXT('',#2,'mechanical')
ERROR: in 2nd pass, instance #24 not found.
Data lost: = PRODUCT_TYPE('part',$,(#7))
ERROR: ENTITY #365 Product
frame_of_reference : index: 1
Reference to non-existent ENTITY #366.
ERROR in EXCHANGE FILE: incomplete instance #365.
ERROR: in 2nd pass, instance #366 not found.
Data lost: = MECHANICAL_CONTEXT('',#2,'mechanical')
ERROR: in 2nd pass, instance #373 not found.
Data lost: = PRODUCT_TYPE('part',$,(#365))
Second pass complete - instance summary:
Total instances: 380
Invalid instances: 4
Incomplete instances (includes invalid instances): 0
Warnings: 0.
SECOND PASS complete: 380 instances valid.
6 ERRORS 0 WARNINGS
Finished reading file.
Severity: SEVERITY_WARNING
User message in parens:
(STEPfile Reading File: Unable to create 4 instances.
In first pass through DATA section. Check for invalid entity types.
Second pass complete - instance summary:
Total instances: 380
Invalid instances: 4
Incomplete instances (includes invalid instances): 0
Warnings: 0.
6 ERRORS 0 WARNINGS
)
Detailed message in parens:
(Second pass complete - instance summary:
Total instances: 380
Invalid instances: 4
Incomplete instances (includes invalid instances): 0
Warnings: 0.
)
p21 ReadExchangeFile() Physical memory: 1132kb; Virtual memory: 528kb; User CPU time: 1ms; System CPU time: 0ms
./p21read_sdai_ap210e2.exe cube-out-fc.stp cube-fc-scl.stp
'PRODUCT_TYPE': Unknown ENTITY type.
p21 ReadExchangeFile() Physical memory: 1016kb; Virtual memory: 508kb; User CPU time: 1ms; System CPU time: 0ms
This pair of schema names do not match - AUTOMOTIVE_DESIGN_CC2 { 1 2 10303 214 -1 1 5 4 } and AUTOMOTIVE_DESIGN
ERROR - schema name mismatch. Tried all available combinations.