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
Forums: 

Hi everyone,

I have in a step file following code

#10024=DESCRIPTIVE_REPRESENTATION_ITEM('USER_STRING_1', 'HERE_IS_A_DESCRIPTION');

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():

        continue

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

    if ( name == 'USER_STRING_1' ):

        print(name)

# 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 …

Handle_StepRepr_DescriptiveRepresentationItem.DownCast(entity)

Could someone help me. Thanks!