Hello,
Just try the following example: 1.Read a BRep shape stored in file "filename.brep" 2.Set it under label 0:1:1 3. Undo the operation 2.
Imagine you have an instance of Handle(TDocStd_Document) theDocument;
//Setting number of possible Undo's = 10
theDocument->SetUndoLimit(10);
//Import BRep shape
BRep_Builder aBuilder;
TopoDS_Shape aShape;
BRepTools::Read(aShape,"filename.brep", aBuilder);
//Now "aShape" contains a shape from file "filename.brep"
//Get the "main" label of document 0:1
TDF_Label aMainLabel = theDocument->Main();
//Close the previous transaction if any and open a new one
theDocument->NewCommand();
TDF_Label aTargetLabel = aMainLabel.FindChild(1, Standard_True);
//Set "aShape" under label "aTargetLabel"
TDataStd_Shape::Set(aTargetLabel, aShape);
//Close the previous transaction if any and open a new one
theDocument->NewCommand();
//Undo the addition of "aShape"
theDocument->Undo();
That is all
Best Regards
Commenter-1