Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Shape factory
Shape gallery
What's new
System requirements
Download Center
Public license
Getting started
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
Home / Developer Corner / Forums / Usage issues / Mapping TopoDS_Shape to the name of its Product when reading STEP files

Mapping TopoDS_Shape to the name of its Product when reading STEP files

Mapping TopoDS_Shape to the name of its Product when reading STEP files
Warren Couvillion 2012/09/20 00:32
I've read the forum posts about extracting entity names from STEP files, and the code posted works. I've got a slightly different problem. When I find an entity that describes a STEP file, I need to know the name of the product that contains it.

Is there a way, given an entity, to find the product that contains it?
Timo 2012/09/20 17:12
As mentioned by Roman ( you could have a look at STEPCAFControl_Reader::ReadNames to see how it reads the names of products.

Personally, I don't read product names from STEP files, i only write them. I'm using the follwing code. Maybe it helps. But beware, it is written in C#:

// Create STEP writer
aWriter = new STEPControl_Writer();
FP = aWriter.WS().TransferWriter().FinderProcess();

// Transfer shape to STEP
status = aWriter.Transfer(shape, type);
if (status != IFSelect_ReturnStatus.IFSelect_RetDone)

// Get ShapeDefinitionRepresentation of transfered shape
StepShape_ShapeDefinitionRepresentation SDR = new StepShape_ShapeDefinitionRepresentation();
TransferBRep_ShapeMapper mapper = TransferBRep.TransferBRep.CreateShapeMapper(FP, shape);
if (!FP.FindTypedTransient(mapper, StepShape_ShapeDefinitionRepresentation.TypeOf(), SDR))

// Set the name to the PRODUCT
StepRepr_PropertyDefinition PropD = SDR.Definition().PropertyDefinition();
if (PropD.IsNull())
StepBasic_ProductDefinition PD = PropD.Definition().ProductDefinition();
if (PD.IsNull())
StepBasic_Product Prod = PD.Formation().OfProduct();
Prod.Name ...

Warren Couvillion 2012/09/21 23:00
I should really proofread. What I meant to say is that when I find an entity describing a *shape*, can I find the name of the Product containing it?     
Latest news
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!
  • Open CASCADE Technology 6.7.0 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map