- AttributeRefAttrPtr aLineRefAttr =
- std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(attribute(EXTERNAL_LINE_ID()));
- ResultPtr aLineResult = std::dynamic_pointer_cast<ModelAPI_Result>(aLineRefAttr->object());
- if (!aLineResult)
+ AttributeSelectionPtr aLineAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(attribute(EXTERNAL_LINE_ID()));
+
+ std::shared_ptr<GeomAPI_Edge> anEdge;
+ if(aLineAttr && aLineAttr->value() && aLineAttr->value()->isEdge()) {
+ anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aLineAttr->value()));
+ } else if(aLineAttr->context() && aLineAttr->context()->shape() &&
+ aLineAttr->context()->shape()->isEdge()) {
+ anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aLineAttr->context()->shape()));
+ }
+ if(!anEdge.get())