+ExportPtr exportToXAO(const std::shared_ptr<ModelAPI_Document> & thePart,
+ const std::string & theFilePath, const ModelHighAPI_Selection& theSelectedShape,
+ const std::string & theAuthor, const std::string & theGeometryName)
+{
+ apply(); // finish previous operation to make sure all previous operations are done
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(ExchangePlugin_ExportFeature::ID());
+ // special internal case when for XAO a selection list is filled
+ return ExportPtr(new ExchangeAPI_Export(aFeature, theFilePath, theSelectedShape, "XAO"));
+}
+
+void exportPart(const std::shared_ptr<ModelAPI_Document> & thePart,
+ const std::string & theFilePath,
+ const std::list<ModelHighAPI_Selection> & theSelected)
+{
+ FeaturePtr aFeature = thePart->addFeature(ExchangePlugin_ExportPart::ID());
+ aFeature->string(ExchangePlugin_ExportPart::FILE_PATH_ID())->setValue(theFilePath);
+ if (!theSelected.empty()) {
+ fillAttribute(theSelected,
+ aFeature->selectionList(ExchangePlugin_ExportPart::SELECTION_LIST_ID()));
+ }
+ // restart transaction to execute and delete the macro-feature
+ apply();
+}