Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(aShape, aShapeLab);
if(!aNS.IsNull() && !aNS->IsEmpty()) {
// This shape is already in document, store reference instead of shape;
const TDF_Label aFoundLabel = aNS->Label();
TDF_Reference::Set(aShapeLab, aFoundLabel);
Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(aShape, aShapeLab);
if(!aNS.IsNull() && !aNS->IsEmpty()) {
// This shape is already in document, store reference instead of shape;
const TDF_Label aFoundLabel = aNS->Label();
TDF_Reference::Set(aShapeLab, aFoundLabel);