aPointCoodFeat->attribute(FeaturesPlugin_GeometryCalculation::RESULT_VALUES_ID()));
for (int i : {0, 1, 2})
- res.push_back( aResult->value(i));
+ res.push_back(aResult->value(i));
return res;
}
class ModelHighAPI_Selection;
/// \ingroup CPPHighAPI
-/// \brief get the basic properties (lenght, Surface area, volume)
+/// \brief get the basic properties (length, Surface area, volume)
FEATURESAPI_EXPORT
std::list<double> getBasicProperties(const std::shared_ptr<ModelAPI_Document>& thePart,
const ModelHighAPI_Selection& theObject);
// attribute for point selected
data()->addAttribute(OBJECT_SELECTED_ID(), ModelAPI_AttributeSelection::typeId());
// attributes for result message and values
- data()->addAttribute(LENGHT_ID(), ModelAPI_AttributeString::typeId());
+ data()->addAttribute(LENGTH_ID(), ModelAPI_AttributeString::typeId());
data()->addAttribute(AREA_ID(), ModelAPI_AttributeString::typeId());
data()->addAttribute(VOLUME_ID(), ModelAPI_AttributeString::typeId());
aValues->setValue(2, aVolume);
}
- string(LENGHT_ID())->setValue("Lenght = " + streamL.str());
+ string(LENGTH_ID())->setValue("Length = " + streamL.str());
string(AREA_ID())->setValue("Area = " + streamA.str());
string(VOLUME_ID())->setValue("Volume = " + streamV.str());
}
return MY_OBJECT_SELECTED_ID;
}
- /// Attribute name for lenght
- inline static const std::string& LENGHT_ID()
+ /// Attribute name for length
+ inline static const std::string& LENGTH_ID()
{
- static const std::string MY_LENGHT_ID("lenght");
- return MY_LENGHT_ID;
+ static const std::string MY_LENGTH_ID("length");
+ return MY_LENGTH_ID;
}
/// Attribute name for area
<source>Angular Copy</source>
<translation>Copie angulaire</translation>
</message>
+ <message>
+ <source>Geometry calculation</source>
+ <translation>Calcul géométrique</translation>
+ </message>
<message>
<source>Linear copy</source>
<translation>Copie linéaire</translation>
<translation>Deuxième direction</translation>
</message>
</context>
-
+
+ <!-- Geometry calculation -->
+ <context>
+ <name>GeometryCalculation</name>
+ <message>
+ <source>Geometry calculation</source>
+ <translation>Calcul géométrique</translation>
+ </message>
+ <message>
+ <source>GeometryCalculation:Object</source>
+ <translation>Objet</translation>
+ </message>
+ <message>
+ <source>GeometryCalculation:Length</source>
+ <translation>Longueur</translation>
+ </message>
+ <message>
+ <source>GeometryCalculation:Area</source>
+ <translation>Surface</translation>
+ </message>
+ <message>
+ <source>GeometryCalculation:Volume</source>
+ <translation>Volume</translation>
+ </message>
+ </context>
<!-- Measurement -->
<context>
<name>Measurement</name>
Part_1_doc = Part_1.document()
Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
properties = model.getBasicProperties(Part_1_doc,model.selection("SOLID", "Box_1_1"))
-print(" lenght: ", properties[0])
+print(" length: ", properties[0])
print(" area: ", properties[1])
print(" volume: ", properties[2])
model.end()
\ No newline at end of file
The **Geometry calculation** feature displays basic properties of sub-elements of a geometrical object (shape).
-The basic properties displayed in the property panel are lenght, area and volume.
+The basic properties displayed in the property panel are length, area and volume.
**Apply** button does not generate any result and has the same effect as **Cancel** for this feature.
:param part: The current part object.
:param object: A shape in format *model.selection("type", shape)*.
- :return: list containing lenght, area and volume.
+ :return: list containing length, area and volume.
**See Also** a sample TUI Script of :ref:`tui_basic_properties` operation.
\ No newline at end of file
geometrical_selection="true">
<validator id="GeomValidators_ShapeType" parameters="line,edge,wire,face,shell,solid,compsolid,compound"/>
</shape_selector>
- <label id="lenght" isSelectable = "true"/>
+ <label id="length" isSelectable = "true"/>
<label id="area" isSelectable = "true"/>
<label id="volume" isSelectable = "true"/>
</source>
</workbench>
<workbench id="Inspection">
<group id="Calculation">
- <feature id="GeometryCalculation" title="Geometry Calculation" tooltip="Calculate properties of objects"
+ <feature id="GeometryCalculation" title="Geometry calculation" tooltip="Calculate properties of objects"
icon="icons/Features/basicproperties.png" helpfile="geometryCalculationFeature.html" abort_confirmation="false">
<source path="geometry_calculation_widget.xml"/>
</feature>
/// Run chamfer operation with two distances or with a distance and an angle .
/// \param theShape the shape
/// \param theTolerance tolerance desirated
- /// \param theLength lenght calculated
+ /// \param theLength length calculated
/// \param theSurfArea Surface Area calculated
/// \param theVolume Volume calculated
/// \param theError error