- boost::shared_ptr<ModelAPI_ResultConstruction> aConst1 =
- boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(anAttr1->object());
- if (aConst1) aLine1 = aConst1->shape();
- boost::shared_ptr<ModelAPI_ResultConstruction> aConst2 =
- boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(anAttr2->object());
- if (aConst2) aLine2 = aConst2->shape();
-
- boost::shared_ptr<GeomDataAPI_Point2D> aFlyoutAttr =
- boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()));
- boost::shared_ptr<GeomAPI_Pnt> aFlyoutPnt = sketch()->to3D(aFlyoutAttr->x(), aFlyoutAttr->y());
-
- boost::shared_ptr<GeomAPI_AISObject> anAIS = thePrevious;
+ boost::shared_ptr<ModelAPI_ResultConstruction> aConst1 = boost::dynamic_pointer_cast<
+ ModelAPI_ResultConstruction>(anAttr1->object());
+ if (aConst1)
+ aLine1 = aConst1->shape();
+ boost::shared_ptr<ModelAPI_ResultConstruction> aConst2 = boost::dynamic_pointer_cast<
+ ModelAPI_ResultConstruction>(anAttr2->object());
+ if (aConst2)
+ aLine2 = aConst2->shape();
+
+ boost::shared_ptr<GeomDataAPI_Point2D> aFlyoutAttr = boost::dynamic_pointer_cast<
+ GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()));
+ boost::shared_ptr<GeomAPI_Pnt> aFlyoutPnt = boost::shared_ptr<GeomAPI_Pnt>();;
+ if(aFlyoutAttr->isInitialized()) {
+ aFlyoutPnt = sketch()->to3D(aFlyoutAttr->x(), aFlyoutAttr->y());
+ }
+
+ AISObjectPtr anAIS = thePrevious;