myShape = ModuleBase_Tools::getShape(theAttribute, theWorkshop);
myRefAttribute = AttributePtr();
myIsObject = false;
- AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+ AttributeRefAttrPtr aRefAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
if (aRefAttr) {
myIsObject = aRefAttr->isObject();
myRefAttribute = aRefAttr->attr();
{
std::string aType = theAttribute->attributeType();
if (aType == ModelAPI_AttributeSelectionList::typeId()) {
- AttributeSelectionListPtr aSelectionListAttr =
+ AttributeSelectionListPtr aSelectionListAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
aSelectionListAttr->setSelectionType(mySelectionType);
// restore selection in the attribute. Indeed there is only one stored object
aSelectionListAttr->removeLast();
}
else if (aType == ModelAPI_AttributeRefList::typeId()) {
- AttributeRefListPtr aRefListAttr =
+ AttributeRefListPtr aRefListAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(theAttribute);
// restore objects in the attribute. Indeed there is only one stored object
int aCountAppened = aRefListAttr->size() - mySelectionCount;
aRefAttrListAttr->removeLast();
}
else {
- ModuleBase_Tools::setObject(theAttribute, myObject, myShape, theWorkshop, true);
- AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+ ModuleBase_Tools::setObject(theAttribute, myObject, myShape, theWorkshop, true, true);
+ AttributeRefAttrPtr aRefAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
if (aRefAttr) {
if (!myIsObject)
aRefAttr->setAttr(myRefAttribute);