*/
void ExchangePlugin_ExportFeature::initAttributes()
{
- data()->addAttribute(ExchangePlugin_ExportFeature::FILE_FORMAT_ID(), ModelAPI_AttributeString::typeId());
data()->addAttribute(ExchangePlugin_ExportFeature::FILE_PATH_ID(), ModelAPI_AttributeString::typeId());
+ data()->addAttribute(ExchangePlugin_ExportFeature::FILE_FORMAT_ID(), ModelAPI_AttributeString::typeId());
data()->addAttribute(ExchangePlugin_ExportFeature::SELECTION_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
}
static const std::string MY_EXPORT_ID("Export");
return MY_EXPORT_ID;
}
- /// attribute name of file format
- inline static const std::string& FILE_FORMAT_ID()
- {
- static const std::string MY_FILE_FORMAT_ID("export_file_format");
- return MY_FILE_FORMAT_ID;
- }
/// attribute name of file path
inline static const std::string& FILE_PATH_ID()
{
- static const std::string MY_FILE_PATH_ID("export_file_selector");
+ static const std::string MY_FILE_PATH_ID("file_path");
return MY_FILE_PATH_ID;
}
+ /// attribute name of file format
+ inline static const std::string& FILE_FORMAT_ID()
+ {
+ static const std::string MY_FILE_FORMAT_ID("file_format");
+ return MY_FILE_FORMAT_ID;
+ }
/// attribute name of selection list
inline static const std::string& SELECTION_LIST_ID()
{
/// attribute name of referenced face
inline static const std::string& FILE_PATH_ID()
{
- static const std::string MY_FILE_PATH_ID("import_file_selector");
+ static const std::string MY_FILE_PATH_ID("file_path");
return MY_FILE_PATH_ID;
}
/// default constructor
aSession.startOperation()
anImportFeature = aPart.addFeature("Import")
- anImportFeature.string("import_file_selector").setValue("Data/screw.step")
+ anImportFeature.string("file_path").setValue("Data/screw.step")
anImportFeature.execute()
aSession.finishOperation()
anExportFeature = aPart.addFeature(aFeatureKind)
assert anExportFeature, "{0}: Can not create a feature {1}".format(theType, aFeatureKind)
- aFormatAttrName = "export_file_format"
+ aFormatAttrName = "file_format"
aFormatAttr = anExportFeature.string(aFormatAttrName)
assert aFormatAttr, "{0}: Can not receive string field {1}".format(theType, aFormatAttrName)
aFormatAttr.setValue(theFormat)
- aFileAttrName = "export_file_selector"
+ aFileAttrName = "file_path"
aFileAttr = anExportFeature.string(aFileAttrName)
assert aFileAttr, "{0}: Can not receive string field {1}".format(theType, aFileAttrName)
aFileAttr.setValue(theFile)
aFeatureKind = "Import"
anImportFeature = aPart.addFeature(aFeatureKind)
assert anImportFeature, "{0}: Can not create a feature {1}".format(theType, aFeatureKind)
- aFieldName = "import_file_selector"
+ aFieldName = "file_path"
file = anImportFeature.string(aFieldName)
assert file, "{0}: Can not receive string field {1}".format(theType, aFieldName)
file.setValue(theFile)
<workbench id="Features" document="Part">
<group id="Exchange">
<feature id="Import" title="Import" tooltip="Import a file" icon=":icons/import.png">
- <file_selector id="import_file_selector" title="Import file" path="">
+ <file_selector id="file_path" title="Import file" path="">
<validator id="ExchangePlugin_ImportFormat" parameters="BREP|BRP:BREP,STEP|STP:STEP,IGES|IGS:IGES" />
</file_selector>
</feature>
<feature id="Export" title="Export" tooltip="Export to file" icon=":icons/export.png">
- <export_file_selector id="export_file_selector" type="save" title="Export file" path="">
+ <export_file_selector id="file_path" type="save" title="Export file" path="">
<validator id="ExchangePlugin_ExportFormat" parameters="BREP|BRP:BREP,STEP|STP:STEP,IGES|IGS:IGES-5.1,IGES|IGS:IGES-5.3" />
</export_file_selector>
<multi_selector id="selection_list" tooltip="Select a set of objects" type_choice="Vertices Edges Faces Solids" />