- // dump sketch based on coordinate plane
- theDumper << aBase << " = model.addSketch(" << aDocName
- << ", model.defaultPlane(\"" << aPlaneName << "\"))" << std::endl;
+ if (aPlaneName.empty()) {
+ // needs import additional module
+ theDumper.importModule("GeomAPI");
+ // dump plane parameters
+ const std::string& aSketchName = theDumper.name(aBase);
+ std::string anOriginName = aSketchName + "_origin";
+ std::string aNormalName = aSketchName + "_norm";
+ std::string aDirXName = aSketchName + "_dirx";
+ theDumper << anOriginName << " = " << anOrigin << std::endl
+ << aNormalName << " = " << aNormal << std::endl
+ << aDirXName << " = " << aDirX << std::endl;
+ // dump sketch based on arbitrary plane
+ theDumper << aBase << " = model.addSketch(" << aDocName << ", GeomAPI_Ax3("
+ << anOriginName << ", " << aDirXName << ", " << aNormalName << "))" << std::endl;
+ } else {
+ // dump sketch based on coordinate plane
+ theDumper << aBase << " = model.addSketch(" << aDocName
+ << ", model.defaultPlane(\"" << aPlaneName << "\"))" << std::endl;
+ }