TestSketcherSetEqual.py
TestSketcherSetFillet.py
+ TestFeatures.py
TestFeaturesExtrusion.py
TestFeaturesRevolution.py
self.setLength(dy)
self.setHeight(dz)
- self._execute()
+ self.execute()
pass
def setWidth(self, width):
"""B.setWidth(float) -- modify width attribute"""
- self._fill_attribute(self._width, width)
+ self._fillAttribute(self._width, width)
pass
def setLength(self, length):
"""B.setLength(float) -- modify length attribute"""
- self._fill_attribute(self._length, length)
+ self._fillAttribute(self._length, length)
pass
def setHeight(self, height):
"""B.setHeight(float) -- modify height attribute"""
- self._fill_attribute(self._height, height)
+ self._fillAttribute(self._height, height)
pass
Pass all args to Axis __init__ function.
"""
+ assert(args)
feature = part.addFeature("Axis")
return Axis(feature, *args)
elif len(args) == 1:
self.setCylindricalFace(*args)
- self._execute()
+ self.execute()
pass
def __clear(self):
- self._fill_attribute(self._CreationMethod, "AxisByPointsCase")
- self._fill_attribute(self._FirstPoint, None)
- self._fill_attribute(self._SecondPoint, None)
- self._fill_attribute(self._CylindricalFace, None)
+ self._fillAttribute(self._CreationMethod, "AxisByPointsCase")
+ self._fillAttribute(self._FirstPoint, None)
+ self._fillAttribute(self._SecondPoint, None)
+ self._fillAttribute(self._CylindricalFace, None)
def setPoints(self, p1, p2):
"""Modify points attribute of the feature.
See __init__.
"""
self.__clear()
- self._fill_attribute(self._CreationMethod, "AxisByPointsCase")
- self._fill_attribute(self._FirstPoint, p1)
- self._fill_attribute(self._SecondPoint, p2)
+ self._fillAttribute(self._CreationMethod, "AxisByPointsCase")
+ self._fillAttribute(self._FirstPoint, p1)
+ self._fillAttribute(self._SecondPoint, p2)
pass
def setCylindricalFace(self, face):
See __init__.
"""
self.__clear()
- self._fill_attribute(self._CreationMethod, "AxisByCylindricalFaceCase")
- self._fill_attribute(self._CylindricalFace, face)
+ self._fillAttribute(self._CreationMethod, "AxisByCylindricalFaceCase")
+ self._fillAttribute(self._CylindricalFace, face)
pass
Pass all args to Plane __init__ function.
"""
+ assert(args)
feature = part.addFeature("Plane")
return Plane(feature, *args)
elif len(args) == 4:
self.setGeneralEquation(*args)
- self._execute()
+ self.execute()
pass
def __clear(self):
- self._fill_attribute(self._CreationMethod, "PlaneByFaceAndDistance")
- self._fill_attribute(self._plane_face, None)
- self._fill_attribute(self._distance, 0)
- self._fill_attribute(self._a, 0)
- self._fill_attribute(self._b, 0)
- self._fill_attribute(self._c, 0)
- self._fill_attribute(self._d, 0)
+ self._fillAttribute(self._CreationMethod, "PlaneByFaceAndDistance")
+ self._fillAttribute(self._plane_face, None)
+ self._fillAttribute(self._distance, 0)
+ self._fillAttribute(self._a, 0)
+ self._fillAttribute(self._b, 0)
+ self._fillAttribute(self._c, 0)
+ self._fillAttribute(self._d, 0)
def setFaceAndDistance(self, face, distance):
"""Modify face and distance attribute of the feature.
See __init__.
"""
self.__clear()
- self._fill_attribute(self._CreationMethod, "PlaneByFaceAndDistance")
- self._fill_attribute(self._plane_face, face)
- self._fill_attribute(self._distance, distance)
+ self._fillAttribute(self._CreationMethod, "PlaneByFaceAndDistance")
+ self._fillAttribute(self._plane_face, face)
+ self._fillAttribute(self._distance, distance)
pass
def setGeneralEquation(self, a, b, c, d):
See __init__.
"""
self.__clear()
- self._fill_attribute(self._CreationMethod, "PlaneByGeneralEquation")
- self._fill_attribute(self._a, a)
- self._fill_attribute(self._b, b)
- self._fill_attribute(self._c, c)
- self._fill_attribute(self._d, d)
+ self._fillAttribute(self._CreationMethod, "PlaneByGeneralEquation")
+ self._fillAttribute(self._a, a)
+ self._fillAttribute(self._b, b)
+ self._fillAttribute(self._c, c)
+ self._fillAttribute(self._d, d)
pass
Pass all args to Point __init__ function.
"""
+ assert(args)
feature = part.addFeature("Point")
return Point(feature, *args)
assert(len(args) == 3)
self.setPoint(*args)
- self._execute()
+ self.execute()
pass
def setPoint(self, x, y, z):
See __init__.
"""
- self._fill_attribute(self._x, x)
- self._fill_attribute(self._y, y)
- self._fill_attribute(self._z, z)
+ self._fillAttribute(self._x, x)
+ self._fillAttribute(self._y, y)
+ self._fillAttribute(self._z, z)
pass
Pass all args to Import __init__ function.
"""
+ assert(args)
feature = part.addFeature("Import")
return Import(feature, *args)
assert(len(args) == 1)
self.setFilePath(args[0])
- self._execute()
+ self.execute()
pass
def setFilePath(self, file_path):
See __init__.
"""
- self._fill_attribute(self._file_path, file_path)
+ self._fillAttribute(self._file_path, file_path)
pass
Pass all args to Export __init__ function.
"""
+ assert(args)
feature = part.addFeature("Export")
return Export(feature, *args)
self.setFileFormat(args[1])
self.setObjects(args[2])
- self._execute()
+ self.execute()
pass
def setFilePath(self, file_path):
See __init__.
"""
- self._fill_attribute(self._file_path, file_path)
+ self._fillAttribute(self._file_path, file_path)
pass
def setFileFormat(self, file_format):
See __init__.
"""
- self._fill_attribute(self._file_format, file_format)
+ self._fillAttribute(self._file_format, file_format)
pass
def setObjects(self, objects):
See __init__.
"""
- self._fill_attribute(self._objects, object)
+ self._fillAttribute(self._objects, object)
pass
from model.roots import Interface
-def addAddition(part, object, tool):
+def addAddition(part, *args):
"""Inserts an addition to the given Part and executes the operation.
This operation adds tool to the given object.
"""
+ assert(args)
+ object, tool = args
feature = part.addFeature("Boolean")
return Boolean(feature, object, tool, GeomAlgoAPI_Boolean.BOOL_FUSE)
-def addSubtraction(part, object, tool):
+def addSubtraction(part, *args):
"""Inserts a subtraction to the given Part and executes the operation.
This operation subtracts tool to the given object.
"""
+ assert(args)
+ object, tool = args
feature = part.addFeature("Boolean")
return Boolean(feature, object, tool, GeomAlgoAPI_Boolean.BOOL_CUT)
-def addIntersection(part, object, tool):
+def addIntersection(part, *args):
"""Inserts an intersection to the given Part and executes the operation.
This operation intersects tool to the given object.
"""
+ assert(args)
+ object, tool = args
feature = part.addFeature("Boolean")
return Boolean(feature, object, tool, GeomAlgoAPI_Boolean.BOOL_COMMON)
self.setToolObjects(tool_objects)
self.setBoolType(bool_type)
- self._execute()
+ self.execute()
pass
def setMainObjects(self, main_objects):
"""F.setMainObjects(iterable) -- modify main_objects attribute"""
- self._fill_attribute(self._main_objects, main_objects)
+ self._fillAttribute(self._main_objects, main_objects)
pass
def setToolObjects(self, tool_objects):
"""F.setToolObjects(iterable) -- modify tool_objects attribute"""
- self._fill_attribute(self._tool_objects, tool_objects)
+ self._fillAttribute(self._tool_objects, tool_objects)
pass
def setBoolType(self, bool_type):
- GeomAlgoAPI_Boolean.BOOL_CUT
- GeomAlgoAPI_Boolean.BOOL_COMMON
"""
- self._fill_attribute(self._bool_type, bool_type)
+ self._fillAttribute(self._bool_type, bool_type)
pass
elif len(args) == 1:
self.setSize(args[0])
- self._execute()
+ self.execute()
pass
def __clear(self):
self._CreationMethod.setValue("BySizes")
- self._fill_attribute(self._to_size, 0)
- self._fill_attribute(self._from_size, 0)
- self._fill_attribute(self._to_object, None)
- self._fill_attribute(self._to_offset, 0)
- self._fill_attribute(self._from_object, None)
- self._fill_attribute(self._from_offset, 0)
+ self._fillAttribute(self._to_size, 0)
+ self._fillAttribute(self._from_size, 0)
+ self._fillAttribute(self._to_object, None)
+ self._fillAttribute(self._to_offset, 0)
+ self._fillAttribute(self._from_object, None)
+ self._fillAttribute(self._from_offset, 0)
pass
def setBase(self, base):
See __init__.
"""
- self._fill_attribute(self._base, base)
+ self._fillAttribute(self._base, base)
pass
def setSizes(self, to_size, from_size):
See __init__.
"""
self.__clear()
- self._fill_attribute(self._CreationMethod, "BySizes")
- self._fill_attribute(self._to_size, to_size)
- self._fill_attribute(self._from_size, from_size)
+ self._fillAttribute(self._CreationMethod, "BySizes")
+ self._fillAttribute(self._to_size, to_size)
+ self._fillAttribute(self._from_size, from_size)
pass
def setSize(self, size):
"""
self.__clear()
self._CreationMethod.setValue("ByPlanesAndOffsets")
- self._fill_attribute(self._to_object, to_object)
- self._fill_attribute(self._to_offset, to_offset)
- self._fill_attribute(self._from_object, from_object)
- self._fill_attribute(self._from_offset, from_offset)
+ self._fillAttribute(self._to_object, to_object)
+ self._fillAttribute(self._to_offset, to_offset)
+ self._fillAttribute(self._from_object, from_object)
+ self._fillAttribute(self._from_offset, from_offset)
pass
def result(self):
elif len(args) == 2:
self.setSizes(*args)
- self._execute()
+ self.execute()
pass
def __clear(self):
self._CreationMethod.setValue("BySizes")
- self._fill_attribute(self._to_size, 0)
- self._fill_attribute(self._from_size, 0)
- self._fill_attribute(self._to_object, None)
- self._fill_attribute(self._to_offset, 0)
- self._fill_attribute(self._from_object, None)
- self._fill_attribute(self._from_offset, 0)
+ self._fillAttribute(self._to_size, 0)
+ self._fillAttribute(self._from_size, 0)
+ self._fillAttribute(self._to_object, None)
+ self._fillAttribute(self._to_offset, 0)
+ self._fillAttribute(self._from_object, None)
+ self._fillAttribute(self._from_offset, 0)
pass
def setSizes(self, to_size, from_size):
"""
self.__clear()
self._CreationMethod.setValue("BySizes")
- self._fill_attribute(self._to_size, to_size)
- self._fill_attribute(self._from_size, from_size)
+ self._fillAttribute(self._to_size, to_size)
+ self._fillAttribute(self._from_size, from_size)
pass
def setPlanesAndOffsets(self, to_object, to_offset,
"""
self.__clear()
self._CreationMethod.setValue("ByPlanesAndOffsets")
- self._fill_attribute(self._to_object, to_object)
- self._fill_attribute(self._to_offset, to_offset)
- self._fill_attribute(self._from_object, from_object)
- self._fill_attribute(self._from_offset, from_offset)
+ self._fillAttribute(self._to_object, to_object)
+ self._fillAttribute(self._to_offset, to_offset)
+ self._fillAttribute(self._from_object, from_object)
+ self._fillAttribute(self._from_offset, from_offset)
pass
elif len(args) == 2:
self.setSizes(*args)
- self._execute()
+ self.execute()
pass
def __clear(self):
self._CreationMethod.setValue("BySizes")
- self._fill_attribute(self._to_size, 0)
- self._fill_attribute(self._from_size, 0)
- self._fill_attribute(self._to_object, None)
- self._fill_attribute(self._to_offset, 0)
- self._fill_attribute(self._from_object, None)
- self._fill_attribute(self._from_offset, 0)
+ self._fillAttribute(self._to_size, 0)
+ self._fillAttribute(self._from_size, 0)
+ self._fillAttribute(self._to_object, None)
+ self._fillAttribute(self._to_offset, 0)
+ self._fillAttribute(self._from_object, None)
+ self._fillAttribute(self._from_offset, 0)
pass
def setSizes(self, to_size, from_size):
"""
self.__clear()
self._CreationMethod.setValue("BySizes")
- self._fill_attribute(self._to_size, to_size)
- self._fill_attribute(self._from_size, from_size)
+ self._fillAttribute(self._to_size, to_size)
+ self._fillAttribute(self._from_size, from_size)
pass
def setPlanesAndOffsets(self, to_object, to_offset,
"""
self.__clear()
self._CreationMethod.setValue("ByPlanesAndOffsets")
- self._fill_attribute(self._to_object, to_object)
- self._fill_attribute(self._to_offset, to_offset)
- self._fill_attribute(self._from_object, from_object)
- self._fill_attribute(self._from_offset, from_offset)
+ self._fillAttribute(self._to_object, to_object)
+ self._fillAttribute(self._to_offset, to_offset)
+ self._fillAttribute(self._from_object, from_object)
+ self._fillAttribute(self._from_offset, from_offset)
pass
assert(len(args) == 1)
self.setGroupList(args[0])
- self._execute()
+ self.execute()
pass
def setGroupList(self, main_objects):
See __init__.
"""
- self._fill_attribute(self._group_list, group_list)
+ self._fillAttribute(self._group_list, group_list)
pass
self.setToolObjects(tool_objects)
self.setPartitionCombine(partition_combine)
- self._execute()
+ self.execute()
pass
def setMainObjects(self, main_objects):
See __init__.
"""
- self._fill_attribute(self._main_objects, main_objects)
+ self._fillAttribute(self._main_objects, main_objects)
pass
def setToolObjects(self, tool_objects):
See __init__.
"""
- self._fill_attribute(self._tool_objects, tool_objects)
+ self._fillAttribute(self._tool_objects, tool_objects)
pass
def setPartitionCombine(self, partition_combine):
See __init__.
"""
- self._fill_attribute(self._partition_combine, partition_combine)
+ self._fillAttribute(self._partition_combine, partition_combine)
pass
self.setReverseDirection(args[3])
self.setCentering(args[4])
- self._execute()
+ self.execute()
pass
def setObjectList(self, objects_list):
See __init__.
"""
- self._fill_attribute(self._objects_list, objects_list)
+ self._fillAttribute(self._objects_list, objects_list)
pass
def setStartShape(self, start_shape):
See __init__.
"""
- self._fill_attribute(self._start_shape, start_shape)
+ self._fillAttribute(self._start_shape, start_shape)
pass
def setEndShape(self, end_shape):
See __init__.
"""
- self._fill_attribute(self._end_shape, end_shape)
+ self._fillAttribute(self._end_shape, end_shape)
pass
def setReverseDirection(self, reverse_direction):
See __init__.
"""
- self._fill_attribute(self._reverse_direction, reverse_direction)
+ self._fillAttribute(self._reverse_direction, reverse_direction)
pass
def setCentering(self, centering):
See __init__.
"""
- self._fill_attribute(self._centering, centering)
+ self._fillAttribute(self._centering, centering)
pass
elif len(args) == 2:
self.setAngles(*args)
- self._execute()
+ self.execute()
pass
def __clear(self):
self._CreationMethod.setValue("ByAngles")
- self._fill_attribute(self._to_angle, 0)
- self._fill_attribute(self._from_angle, 0)
- self._fill_attribute(self._to_object, None)
- self._fill_attribute(self._to_offset, 0)
- self._fill_attribute(self._from_object, None)
- self._fill_attribute(self._from_offset, 0)
+ self._fillAttribute(self._to_angle, 0)
+ self._fillAttribute(self._from_angle, 0)
+ self._fillAttribute(self._to_object, None)
+ self._fillAttribute(self._to_offset, 0)
+ self._fillAttribute(self._from_object, None)
+ self._fillAttribute(self._from_offset, 0)
pass
def setBase(self, base):
See __init__.
"""
- self._fill_attribute(self._base, base)
+ self._fillAttribute(self._base, base)
pass
def setAxisObject(self, axis_object):
See __init__.
"""
- self._fill_attribute(self._axis_object, axis_object)
+ self._fillAttribute(self._axis_object, axis_object)
pass
def setAngles(self, to_angle, from_angle):
"""
self.__clear()
self._CreationMethod.setValue("ByAngles")
- self._fill_attribute(self._to_angle, to_angle)
- self._fill_attribute(self._from_angle, from_angle)
+ self._fillAttribute(self._to_angle, to_angle)
+ self._fillAttribute(self._from_angle, from_angle)
pass
def setPlanesAndOffsets(self, to_object, to_offset,
"""
self.__clear()
self._CreationMethod.setValue("ByPlanesAndOffsets")
- self._fill_attribute(self._to_object, to_object)
- self._fill_attribute(self._to_offset, to_offset)
- self._fill_attribute(self._from_object, from_object)
- self._fill_attribute(self._from_offset, from_offset)
+ self._fillAttribute(self._to_object, to_object)
+ self._fillAttribute(self._to_offset, to_offset)
+ self._fillAttribute(self._from_object, from_object)
+ self._fillAttribute(self._from_offset, from_offset)
pass
elif len(args) == 2:
self.setAngles(*args)
- self._execute()
+ self.execute()
pass
def __clear(self):
self._CreationMethod.setValue("ByAngles")
- self._fill_attribute(self._to_angle, 0)
- self._fill_attribute(self._from_angle, 0)
- self._fill_attribute(self._to_object, None)
- self._fill_attribute(self._to_offset, 0)
- self._fill_attribute(self._from_object, None)
- self._fill_attribute(self._from_offset, 0)
+ self._fillAttribute(self._to_angle, 0)
+ self._fillAttribute(self._from_angle, 0)
+ self._fillAttribute(self._to_object, None)
+ self._fillAttribute(self._to_offset, 0)
+ self._fillAttribute(self._from_object, None)
+ self._fillAttribute(self._from_offset, 0)
pass
def setAxisObject(self, axis_object):
See __init__.
"""
- self._fill_attribute(self._axis_object, axis_object)
+ self._fillAttribute(self._axis_object, axis_object)
pass
def setAngles(self, to_angle, from_angle):
"""
self.__clear()
self._CreationMethod.setValue("ByAngles")
- self._fill_attribute(self._to_angle, to_angle)
- self._fill_attribute(self._from_angle, from_angle)
+ self._fillAttribute(self._to_angle, to_angle)
+ self._fillAttribute(self._from_angle, from_angle)
pass
def setPlanesAndOffsets(self, to_object, to_offset,
"""
self.__clear()
self._CreationMethod.setValue("ByPlanesAndOffsets")
- self._fill_attribute(self._to_object, to_object)
- self._fill_attribute(self._to_offset, to_offset)
- self._fill_attribute(self._from_object, from_object)
- self._fill_attribute(self._from_offset, from_offset)
+ self._fillAttribute(self._to_object, to_object)
+ self._fillAttribute(self._to_offset, to_offset)
+ self._fillAttribute(self._from_object, from_object)
+ self._fillAttribute(self._from_offset, from_offset)
pass
elif len(args) == 2:
self.setAngles(*args)
- self._execute()
+ self.execute()
pass
def __clear(self):
self._CreationMethod.setValue("ByAngles")
- self._fill_attribute(self._to_angle, 0)
- self._fill_attribute(self._from_angle, 0)
- self._fill_attribute(self._to_object, None)
- self._fill_attribute(self._to_offset, 0)
- self._fill_attribute(self._from_object, None)
- self._fill_attribute(self._from_offset, 0)
+ self._fillAttribute(self._to_angle, 0)
+ self._fillAttribute(self._from_angle, 0)
+ self._fillAttribute(self._to_object, None)
+ self._fillAttribute(self._to_offset, 0)
+ self._fillAttribute(self._from_object, None)
+ self._fillAttribute(self._from_offset, 0)
pass
def setAxisObject(self, axis_object):
See __init__.
"""
- self._fill_attribute(self._axis_object, axis_object)
+ self._fillAttribute(self._axis_object, axis_object)
pass
def setAngles(self, to_angle, from_angle):
"""
self.__clear()
self._CreationMethod.setValue("ByAngles")
- self._fill_attribute(self._to_angle, to_angle)
- self._fill_attribute(self._from_angle, from_angle)
+ self._fillAttribute(self._to_angle, to_angle)
+ self._fillAttribute(self._from_angle, from_angle)
pass
def setPlanesAndOffsets(self, to_object, to_offset,
"""
self.__clear()
self._CreationMethod.setValue("ByPlanesAndOffsets")
- self._fill_attribute(self._to_object, to_object)
- self._fill_attribute(self._to_offset, to_offset)
- self._fill_attribute(self._from_object, from_object)
- self._fill_attribute(self._from_offset, from_offset)
+ self._fillAttribute(self._to_object, to_object)
+ self._fillAttribute(self._to_offset, to_offset)
+ self._fillAttribute(self._from_object, from_object)
+ self._fillAttribute(self._from_offset, from_offset)
pass
def setSketch(self, sketch):
"""Modify sketch attribute"""
- self._fill_attribute(self._sketch, sketch)
+ self._fillAttribute(self._sketch, sketch)
pass
def setSketchSelection(self, sketch_selection):
"""Modify sketch_selection attribute"""
- self._fill_attribute(self._sketch_selection, sketch_selection)
+ self._fillAttribute(self._sketch_selection, sketch_selection)
pass
def setBooleanObjects(self, boolean_objects):
"""Modify boolean_objects attribute"""
- self._fill_attribute(self._boolean_objects, boolean_objects)
+ self._fillAttribute(self._boolean_objects, boolean_objects)
pass
def setSketch(self, sketch):
"""Modify sketch attribute"""
- self._fill_attribute(self._sketch, sketch)
+ self._fillAttribute(self._sketch, sketch)
pass
def setSketchSelection(self, sketch_selection):
"""Modify sketch_selection attribute"""
- self._fill_attribute(self._sketch_selection, sketch_selection)
+ self._fillAttribute(self._sketch_selection, sketch_selection)
pass
self.setAxisObject(args[1])
self.setAngle(args[2])
- self._execute()
+ self.execute()
pass
def setMainObjects(self, main_objects):
See __init__.
"""
- self._fill_attribute(self._main_objects, main_objects)
+ self._fillAttribute(self._main_objects, main_objects)
pass
def setAxisObject(self, axis_object):
See __init__.
"""
- self._fill_attribute(self._axis_object, axis_object)
+ self._fillAttribute(self._axis_object, axis_object)
pass
def setAngle(self, angle):
See __init__.
"""
- self._fill_attribute(self._angle, angle)
+ self._fillAttribute(self._angle, angle)
pass
self.setAxisObject(args[1])
self.setDistance(args[2])
- self._execute()
+ self.execute()
pass
def setMainObjects(self, main_objects):
See __init__.
"""
- self._fill_attribute(self._main_objects, main_objects)
+ self._fillAttribute(self._main_objects, main_objects)
pass
def setAxisObject(self, axis_object):
See __init__.
"""
- self._fill_attribute(self._axis_object, axis_object)
+ self._fillAttribute(self._axis_object, axis_object)
pass
def setDistance(self, distance):
See __init__.
"""
- self._fill_attribute(self._distance, distance)
+ self._fillAttribute(self._distance, distance)
pass
Pass all args to Parameter __init__ function.
"""
+ assert(args)
feature = part.addFeature("Parameter")
return Parameter(feature, *args)
Interface.__init__(self, feature)
assert(self._feature.getKind() == "Parameter")
- self._variable = self._feature.data().selection("variable")
- self._expression = self._feature.data().real("expression")
+ self._variable = self._feature.data().string("variable")
+ self._expression = self._feature.data().string("expression")
assert(self._variable)
assert(self._expression)
self.setName(args[0])
self.setExpression(args[1])
- self._execute()
+ self.execute()
pass
def setName(self, name):
See __init__.
"""
- self._fill_attribute(self._name, name)
+ self._fillAttribute(self._name, name)
pass
def setExpression(self, expression):
See __init__.
"""
- self._fill_attribute(self._expression, expression)
+ self._fillAttribute(self._expression, expression)
pass
Interface.__init__(self, feature)
assert(self._feature.getKind() == "Part")
- self._execute()
+ self.execute()
pass
def document(self):
def __init__(self, feature):
"""x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
self._feature = feature
- self._attribute_white_list = [
- "execute",
- "getKind", "results", "firstResult", "lastResult",
- ]
def __getattr__(self, name):
"""Process missing attributes.
Add get*() methods for access feature attributes.
- Redirect some missing attributes to the feature.
"""
if name.startswith("get"):
possible_names = [
return getattr(self, possible_name)
return getter
- if name in self._attribute_white_list:
- return getattr(self._feature, name)
-
raise AttributeError()
+ def _fillAttribute(self, attribute, value):
+ """Fill ModelAPI_Attribute* with value."""
+ tools.fill_attribute(attribute, value)
+
def feature(self):
"""Return ModelAPI_Feature."""
return self._feature
- def _fill_attribute(self, attribute, value):
- """Fill ModelAPI_Attribute* with value."""
- tools.fill_attribute(attribute, value)
+ def getKind(self):
+ """Return the unique kind of the feature"""
+ return self._feature.getKind()
+
+ def results(self):
+ """Return current results of the feature"""
+ return self._feature.results()
+
+ def firstResult(self):
+ """Return the first result in the list of results"""
+ return self._feature.firstResult()
+
+ def lastResult(self):
+ """Return the result in the list of results"""
+ return self._feature.lastResult()
def setRealInput(self, inputid, value):
"""I.setRealInput(str, float) -- set real value to the attribute"""
validators = ModelAPI.ModelAPI_Session.get().validators()
return validators.validate(self._feature)
- def _execute(self):
- """I._execute() -- validate and execute the feature.
+ def execute(self):
+ """I.execute() -- validate and execute the feature.
Raises RuntimeError if validation fails.
"""
raise WrongNumberOfArguments(
"Arc takes 3 or 6 arguments (%s given)" % len(args)
)
- self._execute()
+ self.execute()
########
#
raise WrongNumberOfArguments(
"Arc takes 1, 2 or 4 arguments (%s given)" % len(args)
)
- self._execute()
+ self.execute()
def __createByCoordinates(self, x1, y1, x2, y2):
self.setStartPoint(x1, y1)
self._feature.data().attribute("PointCoordinates")
)
self.setValue(x, y)
- self._execute()
+ self.execute()
def setValue(self, x, y):
"""Set point coordinates."""
constraint = self._feature.addFeature("SketchConstraintCoincidence")
constraint.data().refattr("ConstraintEntityA").setAttr(p1)
constraint.data().refattr("ConstraintEntityB").setAttr(p2)
- self._execute()
+ self.execute()
return constraint
def setParallel(self, l1, l2):
constraint = self._feature.addFeature("SketchConstraintParallel")
constraint.data().refattr("ConstraintEntityA").setObject(l1)
constraint.data().refattr("ConstraintEntityB").setObject(l2)
- self._execute()
+ self.execute()
return constraint
def setPerpendicular(self, l1, l2):
constraint = self._feature.addFeature("SketchConstraintPerpendicular")
constraint.data().refattr("ConstraintEntityA").setObject(l1)
constraint.data().refattr("ConstraintEntityB").setObject(l2)
- self._execute()
+ self.execute()
return constraint
def setHorizontal(self, line):
constraint to this Sketch."""
constraint = self._feature.addFeature("SketchConstraintHorizontal")
constraint.data().refattr("ConstraintEntityA").setObject(line)
- self._execute()
+ self.execute()
return constraint
def setVertical(self, line):
constraint to this Sketch."""
constraint = self._feature.addFeature("SketchConstraintVertical")
constraint.data().refattr("ConstraintEntityA").setObject(line)
- self._execute()
+ self.execute()
return constraint
def setDistance(self, point, line, length):
constraint.data().refattr("ConstraintEntityA").setAttr(point)
constraint.data().refattr("ConstraintEntityB").setObject(line)
constraint.data().real("ConstraintValue").setValue(length)
- self._execute()
+ self.execute()
return constraint
def setLength(self, line, length):
constraint = self._feature.addFeature("SketchConstraintLength")
constraint.data().refattr("ConstraintEntityA").setObject(line)
constraint.data().real("ConstraintValue").setValue(length)
- self._execute()
+ self.execute()
return constraint
def setRadius(self, circle, radius):
constraint = self._feature.addFeature("SketchConstraintRadius")
constraint.data().refattr("ConstraintEntityA").setObject(circle)
constraint.data().real("ConstraintValue").setValue(radius)
- self._execute()
+ self.execute()
return constraint
def setEqual(self, object_1, object_2):
constraint = self._feature.addFeature("SketchConstraintEqual")
constraint.data().refattr("ConstraintEntityA").setObject(object_1)
constraint.data().refattr("ConstraintEntityB").setObject(object_2)
- self._execute()
+ self.execute()
return constraint
def setAngle(self, line_1, line_2, angle):
constraint.data().refattr("ConstraintEntityA").setObject(line_1)
constraint.data().refattr("ConstraintEntityB").setObject(line_2)
constraint.data().real("ConstraintValue").setValue(angle)
- self._execute()
+ self.execute()
return constraint
def setTangent(self, object_1, object_2):
constraint = self._feature.addFeature("SketchConstraintTangent")
constraint.data().refattr("ConstraintEntityA").setObject(object_1)
constraint.data().refattr("ConstraintEntityB").setObject(object_2)
- self._execute()
+ self.execute()
return constraint
def setFillet(self, line_1, line_2, radius):
constraint.data().refattr("ConstraintEntityA").setObject(line_1)
constraint.data().refattr("ConstraintEntityB").setObject(line_2)
constraint.data().real("ConstraintValue").setValue(radius)
- self._execute()
+ self.execute()
return constraint
#-------------------------------------------------------------