{
// TODO(spo): check that thePart is not empty
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(ExchangePlugin_ExportFeature::ID());
+ fillAttribute("Regular", aFeature->string(ExchangePlugin_ExportFeature::EXPORT_TYPE_ID()));
fillAttribute(theFilePath, aFeature->string(ExchangePlugin_ExportFeature::FILE_PATH_ID()));
fillAttribute(theSelectionList, aFeature->selectionList(ExchangePlugin_ExportFeature::SELECTION_LIST_ID()));
fillAttribute(theFileFormat, aFeature->string(ExchangePlugin_ExportFeature::FILE_FORMAT_ID()));
{
// TODO(spo): check that thePart is not empty
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(ExchangePlugin_ExportFeature::ID());
- fillAttribute(theFilePath, aFeature->string(ExchangePlugin_ExportFeature::FILE_PATH_ID()));
+ fillAttribute("XAO", aFeature->string(ExchangePlugin_ExportFeature::EXPORT_TYPE_ID()));
+ fillAttribute(theFilePath, aFeature->string(ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID()));
fillAttribute(theAuthor, aFeature->string(ExchangePlugin_ExportFeature::XAO_AUTHOR_ID()));
fillAttribute(theGeometryName, aFeature->string(ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID()));
+ fillAttribute("XAO", aFeature->string(ExchangePlugin_ExportFeature::FILE_FORMAT_ID()));
aFeature->execute();
}
#include <ModelHighAPI_Dumper.h>
#include <ModelHighAPI_Tools.h>
//--------------------------------------------------------------------------------------
+#include <algorithm>
+
ExchangeAPI_Import::ExchangeAPI_Import(
const std::shared_ptr<ModelAPI_Feature> & theFeature)
: ModelHighAPI_Interface(theFeature)
FeaturePtr aBase = feature();
std::string aPartName = theDumper.name(aBase->document());
- theDumper << aBase << " = model.addImport(" << aPartName << ", "
- << aBase->string(ExchangePlugin_ImportFeature::FILE_PATH_ID()) << ")" << std::endl;
+ std::string aFilePath = aBase->string(ExchangePlugin_ImportFeature::FILE_PATH_ID())->value();
+ std::string aFrom = "\\";
+ std::string aTo = "\\\\";
+ for(std::size_t aPos = aFilePath.find(aFrom);
+ aPos != std::string::npos;
+ aPos = aFilePath.find(aFrom, aPos)) {
+ aFilePath.replace(aPos, aFrom.size(), aTo);
+ aPos += aTo.size();
+ }
+
+ theDumper << aBase << " = model.addImport(" << aPartName << ", \""
+ << aFilePath << "\")" << std::endl;
// to make import have results
theDumper << "model.do()" << std::endl;
aSession.startOperation()
aGroup = model.addGroup(aPart, [])
- aGroup.defaultResult().data().setName("")
aGroup.groupList().setSelectionType("face")
aGroup.groupList().append("Box_1_1/Shape1_1")
aGroup.groupList().append("Box_1_1/Shape2_1")
+ aGroup.defaultResult().data().setName("")
# aGroupFeature = aSession.activeDocument().addFeature("Group")
# aGroupFeature.data().setName("")
# aSelectionListAttr = aGroupFeature.selectionList("group_list")