std::string ExchangePlugin_Tools::selectionType2xaoDimension(const std::string& theType)
{
- if (theType == "Vertices")
+ if (theType == "Vertices" || theType == "vertex")
return "vertex";
- else if (theType == "Edges")
+ else if (theType == "Edges" || theType == "edge")
return "edge";
- else if (theType == "Faces")
+ else if (theType == "Faces" || theType == "face")
return "face";
- else if (theType == "Solids")
+ else if (theType == "Solids" || theType == "solid")
return "solid";
return std::string();
std::string ExchangePlugin_Tools::xaoDimension2selectionType(const std::string& theDimension)
{
-// return theDimension;
-
if (theDimension == "vertex")
- return "Vertices";
+ return "vertex";
else if (theDimension == "edge")
- return "Edges";
+ return "edge";
else if (theDimension == "face")
- return "Faces";
+ return "face";
else if (theDimension == "solid")
- return "Solids";
+ return "solid";
return std::string();
}
aGroupFeature = aSession.activeDocument().addFeature("Group")
aGroupFeature.data().setName("boite_1")
aSelectionListAttr = aGroupFeature.selectionList("group_list")
- aSelectionListAttr.setSelectionType("Solids")
+ aSelectionListAttr.setSelectionType("solid")
aSelectionListAttr.append(anImportFeature.lastResult(), None)
aGroupFeature.execute()
aSession.finishOperation()
aGroupFeature = aSession.activeDocument().addFeature("Group")
aGroupFeature.data().setName("")
aSelectionListAttr = aGroupFeature.selectionList("group_list")
- aSelectionListAttr.setSelectionType("Faces")
- aSelectionListAttr.append("Box_1_1/Shape1_1", "face")
- aSelectionListAttr.append("Box_1_1/Shape2_1", "face")
+ aSelectionListAttr.setSelectionType("face")
+ aSelectionListAttr.append("Box_1_1/Shape1_1")
+ aSelectionListAttr.append("Box_1_1/Shape2_1")
aGroupFeature.execute()
aSession.finishOperation()
# Export
aSession.startOperation("Export")
anExportFeature = aPart.addFeature("Export")
- anExportFeature.string("ExportType").setValue("XAO")
+# anExportFeature.string("ExportType").setValue("XAO")
anExportFeature.string("file_path").setValue("Data/export.xao")
- anExportFeature.string("file_format").setValue("XAO")
+# anExportFeature.string("file_format").setValue("XAO")
anExportFeature.string("xao_author").setValue("me")
anExportFeature.string("xao_geometry_name").setValue("mygeom")
anExportFeature.execute()