Examples of reading part names from step files?

830 views
Skip to first unread message

JR Cary

unread,
Nov 6, 2013, 12:15:20 PM11/6/13
to oce...@googlegroups.com
Are there any such?

Thx.....John Cary

Thomas Paviot

unread,
Nov 7, 2013, 1:59:01 AM11/7/13
to oce...@googlegroups.com
2013/11/6 JR Cary <ca...@txcorp.com>
Are there any such?

Thx.....John Cary


Hi John,

I guess you want to access the product structure (or product hierarchy) from a STEP file generated using famous 3D cad packages, right? In that case, you have to use the STEP importer available from OCAF (STEPCAFControl_Reader). That's something I did in Python (see the classes STEPOCAF_Import and STEPOCAFExport at https://github.com/tpaviot/pythonocc/blob/master/src/addons/DataExchange/STEP.py), but I didn't port the example to C++. Let me know when you're done and if you want to share your results.

Thomas

JR Cary

unread,
Nov 7, 2013, 12:08:42 PM11/7/13
to oce...@googlegroups.com

On 11/7/13 8:44 AM, oce...@googlegroups.com wrote:


    Are there any such?
     
    Thx.....John Cary

     


      Thanks, Thomas,

      I will give back any C++ examples I generate.

      ........John


      Epy

      unread,
      Nov 7, 2013, 9:38:44 PM11/7/13
      to oce...@googlegroups.com
      Hi Thomas,

      Related to this, is there an *easy* way to attach names to solid shapes when exporting a STEP file? I've searched around and it doesn't seem like there's a straight example out there to do just that.

      Best,
      Jake

      benjami...@compositence.de

      unread,
      Nov 11, 2013, 4:19:08 AM11/11/13
      to oce...@googlegroups.com


      Am Mittwoch, 6. November 2013 18:15:20 UTC+1 schrieb John Cary:
      Are there any such?

      Thx.....John Cary

      Hi John,

      I have used the example code at http://opencascade.wikidot.com/entitynames for extracting entity names. It works well. But be sure to check the remark on the "Discuss" link on that page.

      Bye,
      Benjamin

      Epy

      unread,
      Nov 12, 2013, 12:01:24 PM11/12/13
      to oce...@googlegroups.com
      Slightly OT, I found the answer to my own question. You have to set the static property "write.step.product.name" before each shape is transferred to the STEPControl_Writer, i.e.:

      Interface_Static::SetCVal("write.step.product.name", "My part name!");
      Reply all
      Reply to author
      Forward
      0 new messages