Skip to content

Incomplete read STEP with special 'COMPOUND_REPRESENTATION_ITEM' #1283

@wsw0108

Description

@wsw0108

Description

  1. read file nist_ctc_05_asme1_ap242-e1.stp
  2. try handle StepRepr_CompoundRepresentationItem in this file
  3. got null item_element

related lines:

#14000=COMPOUND_REPRESENTATION_ITEM('',SET_REPRESENTATION_ITEM((#14001)));
#14001=DESCRIPTIVE_REPRESENTATION_ITEM('dimensional note','statistical');

Expected Behavior

Can get correct item_element for entity #14000.

Actual Behavior

Got item_element is null.

Sample Code or DRAW Tcl Script

int main() {
    auto reader = std::make_shared<STEPControl_Reader>();
    auto status = reader->ReadFile(filePath.data());
    auto model = reader->StepModel();

    for (int i = 1; i <= model->NbEntities(); i++) {
        auto entity = model.Model()->Entity(i);
        if (!entity->IsInstance(STANDARD_TYPE(StepRepr_CompoundRepresentationItem))) {
            continue;
        }
        auto item = Handle(StepRepr_CompoundRepresentationItem)::DownCast(entity);
        if (item->NbItemElement() > 0) {
            for (int n = 1; n <= item->NbItemElement(); n++) {
                auto element = item->ItemElementValue(n);
                // handle element, but element is NULL
            }
        }
    }

    return 0;
}

Operating System

Windows

Compiler

MSVC

Bitness

64-bit

OCCT Version

7.9

Additional Files

nist_ctc_05_asme1_ap242-e1.stp in NIST-PMI-STEP-Files

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. NewThe issue was created, but not updated by maintainer. Waiting for updates labels and categories2. BugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions