Skip to content

Entity missing when call 'XCAFDoc_DimTolTool.GetGDTPresentations()' #1238

@wsw0108

Description

@wsw0108

Description

When open a step file attached, some entities are missing.

And when import the attached stp file to solidworks 2025(with "Include PMI" checked), all PMI are imported correctly.

Expected Behavior

The output should be gdt label to shape: 4.

The entities about #130=DRAUGHTING_CALLOUT('Datum10@Plane4(A)',(#114)); are missing.

Actual Behavior

it output gdt label to shape: 3.

Sample Code or DRAW Tcl Script

static int load(const std::string& filename) {
    Handle(XCAFApp_Application) app = XCAFApp_Application::GetApplication();
    Handle(TDocStd_Document) doc;
    app->NewDocument("MDTV-XCAF", doc);

    STEPCAFControl_Reader cafReader;
    cafReader.SetGDTMode(true);

    auto status = cafReader.ReadFile(filename.c_str());
    if (status != IFSelect_RetDone) {
        return 1;
    }

    if (!cafReader.Transfer(doc)) {
        return 1;
    }

    Handle(XCAFDoc_DimTolTool) dimTolTool = XCAFDoc_DocumentTool::DimTolTool(doc->Main());
    {
        NCollection_IndexedDataMap<TDF_Label, TopoDS_Shape> theGDTLabelToShape;
        dimTolTool->GetGDTPresentations(theGDTLabelToShape);
        printf("gdt label to shape: %d\n", theGDTLabelToShape.Size());
    }
    return 0;
}

Operating System

Windows

Compiler

MSVC

Bitness

64-bit

OCCT Version

7.9

Additional Files

test-files.zip

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

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions