| 84 | } |
| 85 | |
| 86 | App::DocumentObjectExecReturn *DrawParametricTemplate::execute() |
| 87 | { |
| 88 | std::string temp = Template.getValue(); |
| 89 | if (temp.empty()) { |
| 90 | return App::DocumentObject::StdReturn; |
| 91 | } |
| 92 | |
| 93 | Base::FileInfo tfi(temp); |
| 94 | if (!tfi.isReadable()) { |
| 95 | // if there is a old absolute template file set use a redirect |
| 96 | return App::DocumentObject::StdReturn; |
| 97 | } |
| 98 | |
| 99 | try { |
| 100 | Base::Interpreter().runFile(temp.c_str(), true); |
| 101 | } |
| 102 | catch(const Base::Exception& e) { |
| 103 | PyErr_SetString(PyExc_ImportError, e.what()); |
| 104 | } |
| 105 | return App::DocumentObject::StdReturn; |
| 106 | } |
| 107 | |
| 108 | int DrawParametricTemplate::drawLine(double x1, double y1, double x2, double y2) |
| 109 | { |