For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

How to get Descriptive Representation Items?

Stephan S.'s picture

Hi everyone,

I have in a step file following code


My objective is to select this item together with the description. I’m able to retrieve the entity 'USER_STRING_1'. Here the snippet

workSession = step_reader.Reader().WS()

model = workSession.GetObject().Model()

nb = model.GetObject().NbEntities()

for i in range(1,nb):

    entity = model.GetObject().Value(i)

    SRRI = Handle_StepRepr_RepresentationItem.DownCast(entity)

    if SRRI.IsNull():


    name = SRRI.GetObject().Name().GetObject().ToCString()

    if ( name == 'USER_STRING_1' ):


# Output: USER_STRING_1

Now I want also retrieve the description 'HERE_IS_A_DESCRIPTION'. I think I have to use the class StepRepr_DescriptiveRepresentationItem. But I didn’t succeed. In this way, I tried to program. It could possibly be wrong …


Could someone help me. Thanks!