def exportToGEOM(part):
- """Export the Part to GEOM module."""
+ """Export the Part to GEOM module.
+
+ Args:
+ part (ModelAPI_Document): part document
+ """
feature = part.addFeature("ExportToGEOM")
- feature.execute()
\ No newline at end of file
+ feature.execute()
def addAxis(part, *args):
- """Add an Axis feature to the Part and return Axis.
+ """Add an Axis feature to the Part.
- Pass all args to Axis __init__ function.
+ .. function:: addAxis(part, p1, p2)
+
+ Args:
+ part (ModelAPI_Document): part document
+ p1 (Selection): first point
+ p2 (Selection): second point
+
+ .. function:: addAxis(part, face)
+
+ Args:
+ part (ModelAPI_Document): part document
+ face (Selection): cylindrical face
+
+ Returns:
+ Axis: axis object
"""
assert(args)
feature = part.addFeature("Axis")
class Axis(Interface):
"""Interface class for Axis feature.
- Axis(feature) -> feature interface without initialization
- Axis(feature, p1, p2) ->
- feature interface initialized from arguments:
- - p1 -- FirstPoint
- - p2 -- SecondPoint
- Axis(feature, face) ->
- feature interface initialized from arguments:
- - face -- CylindricalFace
+ .. function:: Axis(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: Axis(feature, p1, p2)
+
+ Create interface for the feature and initialize the feature with arguments.
+
+ .. function:: Axis(feature, face)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
def addPlane(part, *args):
"""Add a Plane feature to the Part and return Plane.
- Pass all args to Plane __init__ function.
+ .. function:: addPartition(part, face, distance)
+
+ Args:
+ part (ModelAPI_Document): part document
+ face (Selection): plane face
+ distance (double): distance
+
+ .. function:: addPartition(part, a, b, c, d)
+
+ Args:
+ part (ModelAPI_Document): part document
+ a (double): general equation parameter
+ b (double): general equation parameter
+ c (double): general equation parameter
+ d (double): general equation parameter
+
+ Returns:
+ Plane: plane object
"""
assert(args)
feature = part.addFeature("Plane")
class Plane(Interface):
"""Interface class for Plane feature.
- Plane(feature) -> feature interface without initialization
- Plane(feature, face, distance) ->
- feature interface initialized from arguments:
- - face -- planeFace
- - distance -- distance
- Plane(feature, a, b, c, d) ->
- feature interface initialized from arguments:
- - A, B, C, D -- GeneralEquation parameters
+ .. function:: Plane(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: Plane(feature, face, distance)
+
+ Create interface for the feature and initialize the feature with arguments.
+
+ .. function:: Plane(feature, a, b, c, d)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
def addPoint(part, *args):
"""Add an Point feature to the Part and return Point.
- Pass all args to Point __init__ function.
+ .. function:: addPoint(part, x, y, z)
+
+ Args:
+ part (ModelAPI_Document): part document
+ x (double): X coordinate for the point
+ y (double): Y coordinate for the point
+ z (double): Z coordinate for the point
+
+ Returns:
+ Point: point object
"""
assert(args)
feature = part.addFeature("Point")
class Point(Interface):
"""Interface class for Point feature.
- Point(feature) -> feature interface without initialization
- Point(feature, x, y, z) ->
- feature interface initialized from arguments:
- - x, y, z -- coordinates for the point
+ .. function:: Point(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: Point(feature, x, y, z)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
def addImport(part, *args):
- """Add an Import feature to the Part and return Import.
+ """Add an Import feature to the Part.
- Pass all args to Import __init__ function.
+ .. function:: addImport(part, file_path)
+
+ Args:
+ part (ModelAPI_Document): part document
+ file_path (string): path to the imported file
+
+ Returns:
+ Import: import object
"""
assert(args)
feature = part.addFeature("Import")
class Import(Interface):
"""Interface class for Import feature.
- Import(feature) -> feature interface without initialization
- Import(feature, file_path) ->
- feature interface initialized from arguments:
- - file_path -- path to the imported file
+ .. function:: Import(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: Import(feature, file_path)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
def exportToFile(part, *args):
- """Add an Export feature to the Part and return Export.
+ """Perform export from the Part to file.
- Pass all args to Export __init__ function.
+ .. function:: exportToFile(part, file_path, file_format, selection_list)
+
+ Args:
+ part (ModelAPI_Document): part document
+ file_path (string): path to the exported file
+ file_format (string): format of to the exported file
+ selection_list (list of Selection): objects to export
+
+ Returns:
+ Export: export object
"""
assert(args)
feature = part.addFeature("Export")
class Export(Interface):
"""Interface class for Export feature.
- Export(feature) -> feature interface without initialization
- Export(feature, file_path, file_format, selection_list) ->
- feature interface initialized from arguments:
- - file_path -- path to the exported file
- - file_format -- format of to the exported file
- - selection_list -- objects to export
+ .. function:: Export(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: Export(feature, file_path, file_format, selection_list)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
"""Boolean operations Interface
-Author: Daniel Brunier-Coulin
+Author: Daniel Brunier-Coulin with contribution by Sergey Pokhodenko
Copyright (C) 2014-20xx CEA/DEN, EDF R&D
"""
+from GeomAlgoAPI import GeomAlgoAPI_Boolean
+
from model.roots import Interface
+
def addAddition(part, *args):
- """Inserts an addition to the given Part and executes the operation.
- This operation adds tool to the given object.
+ """Perform addition in the Part.
+
+ .. function:: addAddition(part, main_objects, tool_objects)
+
+ This operation adds tools to the given objects.
+
+ Args:
+ part (ModelAPI_Document): part document
+ main_objects (list of :class:`model.Selection`): main objects
+ tool_objects (list of :class:`model.Selection`): tool_objects objects
+
+ Returns:
+ Boolean: boolean object
"""
assert(args)
- object, tool = args
+ main_objects, tool_objects = args
feature = part.addFeature("Boolean")
- return Boolean(feature, object, tool, GeomAlgoAPI_Boolean.BOOL_FUSE)
+ return Boolean(
+ feature, main_objects, tool_objects, GeomAlgoAPI_Boolean.BOOL_FUSE)
def addSubtraction(part, *args):
- """Inserts a subtraction to the given Part and executes the operation.
- This operation subtracts tool to the given object.
+ """Perform subtraction in the Part.
+
+ .. function:: addSubtraction(part, main_objects, tool_objects)
+
+ This operation subtracts tools from the given objects.
+
+ Args:
+ part (ModelAPI_Document): part document
+ main_objects (list of :class:`model.Selection`): main objects
+ tool_objects (list of :class:`model.Selection`): tool_objects objects
+
+ Returns:
+ Boolean: boolean object
"""
assert(args)
- object, tool = args
+ main_objects, tool_objects = args
feature = part.addFeature("Boolean")
- return Boolean(feature, object, tool, GeomAlgoAPI_Boolean.BOOL_CUT)
+ return Boolean(
+ feature, main_objects, tool_objects, GeomAlgoAPI_Boolean.BOOL_CUT)
def addIntersection(part, *args):
- """Inserts an intersection to the given Part and executes the operation.
- This operation intersects tool to the given object.
+ """Perform intersection in the Part.
+
+ .. function:: addIntersection(part, main_objects, tool_objects)
+
+ This operation intersects tools with the given objects.
+
+ Args:
+ part (ModelAPI_Document): part document
+ main_objects (list of :class:`model.Selection`): main objects
+ tool_objects (list of :class:`model.Selection`): tool_objects objects
+
+ Returns:
+ Boolean: boolean object
"""
assert(args)
- object, tool = args
+ main_objects, tool_objects = args
feature = part.addFeature("Boolean")
- return Boolean(feature, object, tool, GeomAlgoAPI_Boolean.BOOL_COMMON)
+ return Boolean(
+ feature, main_objects, tool_objects, GeomAlgoAPI_Boolean.BOOL_COMMON)
class Boolean(Interface):
"""Interface class for Boolean features.
- Boolean(feature) -> feature interface without initialization
- Boolean(feature, main_objects, tool_objects, bool_type) ->
- feature interface initialized from arguments
+ .. function:: Boolean(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: Boolean(feature, main_objects, tool_objects, bool_type)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
pass
def setMainObjects(self, main_objects):
- """F.setMainObjects(iterable) -- modify main_objects attribute"""
+ """Modify main_objects attribute of the feature.
+
+ Args:
+ main_objects (list of :class:`model.Selection`): main objects
+ """
self._fillAttribute(self._main_objects, main_objects)
pass
def setToolObjects(self, tool_objects):
- """F.setToolObjects(iterable) -- modify tool_objects attribute"""
+ """Modify tool_objects attribute of the feature.
+
+ Args:
+ tool_objects (list of :class:`model.Selection`): tool objects
+ """
self._fillAttribute(self._tool_objects, tool_objects)
pass
def setBoolType(self, bool_type):
- """F.setBoolType(integer) -- modify bool_type attribute.
+ """Modify bool_type attribute of the feature.
+
+ Args:
+ bool_type (integer): type of operation
Available types:
- - GeomAlgoAPI_Boolean.BOOL_FUSE
- - GeomAlgoAPI_Boolean.BOOL_CUT
- - GeomAlgoAPI_Boolean.BOOL_COMMON
+
+ * GeomAlgoAPI_Boolean.BOOL_FUSE
+ * GeomAlgoAPI_Boolean.BOOL_CUT
+ * GeomAlgoAPI_Boolean.BOOL_COMMON
"""
self._fillAttribute(self._bool_type, bool_type)
pass
def addExtrusion(part, *args):
"""Add an Extrusion feature to the Part and return Extrusion.
-
+
This function has *3 signatures*:
-
+
.. function:: addExtrusion(base, size)
-
+
Arguments:
base(str, Sketch or list): base object(s)
size(double): size of the extrusion, the side is decided by the sign
-
+
.. function:: addExtrusion(base, to_size, from_size)
-
+
Arguments:
base(str, Sketch or list): base object(s)
to_size(double): upper size of the extrusion
from_size(double): lower size of the extrusion
-
+
.. function:: addExtrusion(base, to_object, to_offset, from_object, from_offset)
-
+
Arguments:
base(str, Sketch or list): base object(s)
- to_object(plane): upper object
+ to_object(plane): upper plane
to_offset(double): offset from upper object
from_object(plane): lower plane
from_offset(double): offset from lower plane
-
+
In all three cases the function returns an extrusion object
-
+
Returns:
Extrusion: extrusion object
"""
def addExtrusionCut(part, *args):
- """Add an ExtrusionCut feature to the Part and return ExtrusionBoolean.
-
- Pass all args to Extrusion __init__ function.
+ """Add an ExtrusionCut feature to the Part.
+
+ .. function:: addExtrusionCut(part, sketch, sketch_selection, boolean_objects, to_size, from_size)
+
+ Args:
+ part (ModelAPI_Document): part document
+ sketch (ModelAPI_Object): sketch feature
+ sketch_selection (Selection): sketch objects
+ boolean_objects (list of Selection): boolean objects
+ to_size (double): upper size of the extrusion
+ from_size (double): lower size of the extrusion
+
+ .. function:: addExtrusionCut(part, sketch, sketch_selection, boolean_objects, to_object, to_offset, from_object, from_offset)
+
+ Args:
+ part (ModelAPI_Document): part document
+ sketch (ModelAPI_Object): sketch feature
+ sketch_selection (Selection): sketch objects
+ boolean_objects (list of Selection): boolean objects
+ to_object (Selection): upper plane
+ to_offset (double): offset from upper plane
+ from_object (Selection): lower plane
+ from_offset (double): offset from lower plane
+
+ Returns:
+ ExtrusionBoolean: extrusion boolean object
"""
assert(args)
feature = part.addFeature("ExtrusionCut")
def addExtrusionFuse(part, *args):
"""Add an ExtrusionFuse feature to the Part and return ExtrusionBoolean.
- Pass all args to Extrusion __init__ function.
+ .. function:: addExtrusionFuse(part, sketch, sketch_selection, boolean_objects, to_size, from_size)
+
+ Args:
+ part (ModelAPI_Document): part document
+ sketch (ModelAPI_Object): sketch feature
+ sketch_selection (Selection): sketch objects
+ boolean_objects (list of Selection): boolean objects
+ to_size (double): upper size of the extrusion
+ from_size (double): lower size of the extrusion
+
+ .. function:: addExtrusionFuse(part, sketch, sketch_selection, boolean_objects, to_object, to_offset, from_object, from_offset)
+
+ Args:
+ part (ModelAPI_Document): part document
+ sketch (ModelAPI_Object): sketch feature
+ sketch_selection (Selection): sketch objects
+ boolean_objects (list of Selection): boolean objects
+ to_object (Selection): upper plane
+ to_offset (double): offset from upper plane
+ from_object (Selection): lower plane
+ from_offset (double): offset from lower plane
+
+ Returns:
+ ExtrusionBoolean: extrusion boolean object
"""
assert(args)
feature = part.addFeature("ExtrusionFuse")
"""Interface class for ExtrusionBoolean features.
Supported features:
- - ExtrusionCut
- - ExtrusionFuse
-
- ExtrusionBoolean(feature) -> feature interface without initialization
- ExtrusionBoolean(feature,
- sketch, sketch_selection, boolean_objects,
- to_size, from_size) ->
- feature interface initialized from arguments:
- - sketch
- - sketch_selection
- - boolean_objects
- - to_size
- - from_size
- ExtrusionBoolean(feature,
- sketch, sketch_selection, boolean_objects,
- to_object, to_offset, from_object, from_offset) ->
- feature interface initialized from arguments:
- - sketch
- - sketch_selection
- - boolean_objects
- - to_object
- - to_offset
- - from_object
- - from_offset
+
+ * ExtrusionCut
+ * ExtrusionFuse
+
+ .. function:: ExtrusionBoolean(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: ExtrusionBoolean(feature, sketch, sketch_selection, boolean_objects, to_size, from_size)
+
+ Create interface for the feature and initialize the feature with arguments.
+
+ .. function:: ExtrusionBoolean(feature, sketch, sketch_selection, boolean_objects, to_object, to_offset, from_object, from_offset)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
def addExtrusionSketch(part, *args):
- """Add an ExtrusionSketch feature to the Part and return ExtrusionSketch.
-
- Pass all args to ExtrusionSketch __init__ function.
+ """Add an ExtrusionSketch feature to the Part.
+
+ .. function:: addExtrusionSketch(part, sketch, sketch_selection, to_size, from_size)
+
+ Args:
+ part (ModelAPI_Document): part document
+ sketch (ModelAPI_Object): sketch feature
+ sketch_selection (Selection): sketch objects
+ to_size (double): upper size of the extrusion
+ from_size (double): lower size of the extrusion
+
+ .. function:: addExtrusionSketch(part, sketch, sketch_selection, to_object, to_offset, from_object, from_offset)
+
+ Args:
+ part (ModelAPI_Document): part document
+ sketch (ModelAPI_Object): sketch feature
+ sketch_selection (Selection): sketch objects
+ to_object (Selection): upper plane
+ to_offset (double): offset from upper plane
+ from_object (Selection): lower plane
+ from_offset (double): offset from lower plane
+
+ Returns:
+ ExtrusionSketch: extrusion sketch object
"""
assert(args)
feature = part.addFeature("ExtrusionSketch")
class ExtrusionSketch(CompositeSketch):
"""Interface class for ExtrusionSketch feature.
- ExtrusionSketch(feature) -> feature interface without initialization
- ExtrusionSketch(feature,
- sketch, sketch_selection,
- to_size, from_size) ->
- feature interface initialized from arguments:
- - sketch
- - sketch_selection
- - to_size
- - from_size
- ExtrusionSketch(feature,
- sketch, sketch_selection,
- to_object, to_offset, from_object, from_offset) ->
- feature interface initialized from arguments:
- - sketch
- - sketch_selection
- - to_object
- - to_offset
- - from_object
- - from_offset
+ .. function:: ExtrusionSketch(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: ExtrusionSketch(feature, sketch, sketch_selection, to_size, from_size)
+
+ Create interface for the feature and initialize the feature with arguments.
+
+ .. function:: ExtrusionSketch(feature, sketch, sketch_selection, to_object, to_offset, from_object, from_offset)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
"""x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
def addGroup(part, *args):
- """Add an Group feature to the Part and return Group.
+ """Add a Group feature to the Part.
- Pass all args to Group __init__ function.
+ .. function:: addGroup(part, group_list)
+
+ Args:
+ part (ModelAPI_Document): part document
+ group_list (list of Selection): list of objects
+
+ Returns:
+ Group: group object
"""
assert(args)
feature = part.addFeature("Group")
class Group(Interface):
"""Interface class for Group feature.
- Group(feature) -> feature interface without initialization
- Group(feature, group_list) ->
- feature interface initialized from arguments:
- - group_list
+ .. function:: Group(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: Group(feature, group_list)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
def addPartition(part, *args):
- """Add a Partition feature to the Part and return Partition.
+ """Add a Partition feature to the Part.
- Pass all args to Partition __init__ function.
+ .. function:: addPartition(part, main_objects, tool_objects, partition_combine)
+
+ Args:
+ part (ModelAPI_Document): part document
+ main_objects (list of Selection): main objects
+ tool_objects (list of Selection): tool objects
+ partition_combine (boolean):
+ If True combines all results to one. If False builds separate result for each object.
+
+ Returns:
+ Partition: partition object
"""
assert(len(args) > 0 and args[0] is not None)
feature = part.addFeature("Partition")
class Partition(Interface):
"""Interface class for Partition feature.
- Partition(feature) -> feature interface without initialization
- Partition(feature, main_objects, tool_objects, partition_combine) ->
- feature interface initialized from arguments:
- - main_objects -- list of solids
- - tool_objects -- list of solids
- - partition_combine -- boolean value
+ .. function:: Partition(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: Partition(feature, main_objects, tool_objects, partition_combine)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
def addPlacement(part, *args):
- """Add an Placement feature to the Part and return Placement.
+ """Add a Placement feature to the Part.
- Pass all args to Placement __init__ function.
+ .. function:: addPlacement(part, objects_list, start_shape, end_shape, reverse_direction, centering)
+
+ Args:
+ part (ModelAPI_Document): part document
+ objects_list (list of Selection): solid objects
+ start_shape (Selection): start face, edge or vertex
+ end_shape (Selection): end face, edge or vertex
+ reverse_direction (boolean): reverse placement direction
+ centering (boolean): center faces under placement
+
+ Returns:
+ Placement: placement object
"""
assert(args)
feature = part.addFeature("Placement")
class Placement(Interface):
"""Interface class for Placement feature.
- Placement(feature) -> feature interface without initialization
- Placement(feature, objects_list, start_shape, end_shape,
- reverse_direction, centering) ->
- feature interface initialized from arguments:
- - objects_list
- - start_shape
- - end_shape
- - reverse_direction
- - centering
+ .. function:: Placement(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: Placement(feature, objects_list, start_shape, end_shape, reverse_direction, centering)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
def addRevolution(part, *args):
- """Add an Revolution feature to the Part and return Revolution.
-
- Pass all args to Revolution __init__ function.
+ """Add a Revolution feature to the Part.
+
+ .. function:: addRevolution(part, base, axis_object, to_angle, from_angle)
+
+ Args:
+ part (ModelAPI_Document): part document
+ base (list of Selection): base objects
+ axis_object (Selection): axis object
+ to_angle (double): to angle
+ from_angle (double): from angle
+
+ .. function:: addRevolution(feature, base, axis_object, to_object, to_offset, from_object, from_offset)
+
+ Args:
+ part (ModelAPI_Document): part document
+ base (list of Selection): base objects
+ axis_object (Selection): axis object
+ to_object (plane): upper plane
+ to_offset (double): offset from upper object
+ from_object (plane): lower plane
+ from_offset (double): offset from lower plane
+
+ Returns:
+ Revolution: revolution object
"""
assert(len(args) > 0 and args[0] is not None)
feature = part.addFeature("Revolution")
class Revolution(Interface):
"""Interface class for Revolution features.
- Revolution(feature) -> feature interface without initialization
- Revolution(feature, base, axis_object, to_angle, from_angle) ->
- feature interface initialized from arguments:
- - base -- name, sketch or list of names and sketches
- - axis_object -- name, edge for axis
- - to_angle -- upper angle
- - from_angle -- lower angle
- Revolution(feature, base, axis_object,
- to_object, to_offset, from_object, from_offset) ->
- feature interface initialized from arguments:
- - base -- name, sketch or list of names and sketches
- - axis_object -- name, edge for axis
- - to_object -- upper object (plane)
- - to_offset -- offset from upper object
- - from_object -- lower object (plane)
- - from_offset -- offset from lower object
+ .. function:: Revolution(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: Revolution(feature, base, axis_object, to_angle, from_angle)
+
+ Create interface for the feature and initialize the feature with arguments.
+
+ .. function:: Revolution(feature, base, axis_object, to_object, to_offset, from_object, from_offset)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
def addRevolutionCut(part, *args):
- """Add an RevolutionCut feature to the Part and return RevolutionBoolean.
-
- Pass all args to RevolutionCut __init__ function.
+ """Add a RevolutionCut feature to the Part.
+
+ .. function:: addRevolutionCut(part, sketch, sketch_selection, boolean_objects, axis_object, to_angle, from_angle)
+
+ Args:
+ part (ModelAPI_Document): part document
+ sketch (ModelAPI_Object): sketch feature
+ sketch_selection (Selection): sketch objects
+ boolean_objects (list of Selection): boolean objects
+ axis_object (Selection): axis object
+ to_size (double): upper size of the extrusion
+ from_size (double): lower size of the extrusion
+
+ .. function:: addRevolutionCut(part, sketch, sketch_selection, boolean_objects, axis_object, to_object, to_offset, from_object, from_offset)
+
+ Args:
+ part (ModelAPI_Document): part document
+ sketch (ModelAPI_Object): sketch feature
+ sketch_selection (Selection): sketch objects
+ boolean_objects (list of Selection): boolean objects
+ axis_object (Selection): axis object
+ to_object (Selection): upper plane
+ to_offset (double): offset from upper plane
+ from_object (Selection): lower plane
+ from_offset (double): offset from lower plane
+
+ Returns:
+ RevolutionBoolean: revolution boolean object
"""
assert(args)
feature = part.addFeature("RevolutionCut")
return RevolutionBoolean(feature, *args)
def addRevolutionFuse(part, *args):
- """Add an RevolutionFuse feature to the Part and return RevolutionBoolean.
+ """Add a RevolutionFuse feature to the Part.
+
+ .. function:: addRevolutionFuse(part, sketch, sketch_selection, boolean_objects, axis_object, to_angle, from_angle)
+
+ Args:
+ part (ModelAPI_Document): part document
+ sketch (ModelAPI_Object): sketch feature
+ sketch_selection (Selection): sketch objects
+ boolean_objects (list of Selection): boolean objects
+ axis_object (Selection): axis object
+ to_size (double): upper size of the extrusion
+ from_size (double): lower size of the extrusion
+
+ .. function:: addRevolutionFuse(part, sketch, sketch_selection, boolean_objects, axis_object, to_object, to_offset, from_object, from_offset)
+
+ Args:
+ part (ModelAPI_Document): part document
+ sketch (ModelAPI_Object): sketch feature
+ sketch_selection (Selection): sketch objects
+ boolean_objects (list of Selection): boolean objects
+ axis_object (Selection): axis object
+ to_object (Selection): upper plane
+ to_offset (double): offset from upper plane
+ from_object (Selection): lower plane
+ from_offset (double): offset from lower plane
+
Pass all args to RevolutionFuse __init__ function.
+
+ Returns:
+ RevolutionBoolean: revolution boolean object
"""
assert(args)
feature = part.addFeature("RevolutionFuse")
"""Interface class for RevolutionBoolean features.
Supported features:
- - RevolutionCut
- - RevolutionFuse
-
- RevolutionBoolean(feature) -> feature interface without initialization
- RevolutionBoolean(feature,
- sketch, sketch_selection, boolean_objects,
- to_angle, from_angle) ->
- feature interface initialized from arguments:
- - sketch
- - sketch_selection
- - boolean_objects
- - to_angle
- - from_angle
- RevolutionBoolean(feature,
- sketch, sketch_selection, boolean_objects,
- to_object, to_offset, from_object, from_offset) ->
- feature interface initialized from arguments:
- - sketch
- - sketch_selection
- - boolean_objects
- - to_object
- - to_offset
- - from_object
- - from_offset
+
+ * RevolutionCut
+ * RevolutionFuse
+
+ .. function:: RevolutionBoolean(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: RevolutionBoolean(feature, sketch, sketch_selection, boolean_objects, axis_object, to_angle, from_angle)
+
+ Create interface for the feature and initialize the feature with arguments.
+
+ .. function:: RevolutionBoolean(feature, sketch, sketch_selection, boolean_objects, axis_object, to_object, to_offset, from_object, from_offset)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
def addRevolutionSketch(part, *args):
- """Add an RevolutionSketch feature to the Part and return RevolutionSketch.
-
- Pass all args to RevolutionSketch __init__ function.
+ """Add a RevolutionSketch feature to the Part.
+
+ .. function:: addRevolutionSketch(part, sketch, sketch_selection, axis_object, to_angle, from_angle)
+
+ Args:
+ part (ModelAPI_Document): part document
+ sketch (ModelAPI_Object): sketch feature
+ sketch_selection (Selection): sketch objects
+ axis_object (Selection): axis object
+ to_size (double): upper size of the extrusion
+ from_size (double): lower size of the extrusion
+
+ .. function:: addRevolutionSketch(part, sketch, sketch_selection, axis_object, to_object, to_offset, from_object, from_offset)
+
+ Args:
+ part (ModelAPI_Document): part document
+ sketch (ModelAPI_Object): sketch feature
+ sketch_selection (Selection): sketch objects
+ axis_object (Selection): axis object
+ to_object (Selection): upper plane
+ to_offset (double): offset from upper plane
+ from_object (Selection): lower plane
+ from_offset (double): offset from lower plane
+
+ Returns:
+ RevolutionSketch: revolution sketch object
"""
assert(args)
feature = part.addFeature("RevolutionSketch")
class RevolutionSketch(CompositeSketch):
"""Interface class for RevolutionSketch features.
- RevolutionSketch(feature) -> feature interface without initialization
- RevolutionSketch(feature,
- sketch, sketch_selection,
- to_angle, from_angle) ->
- feature interface initialized from arguments:
- - sketch
- - sketch_selection
- - to_angle
- - from_angle
- RevolutionSketch(feature,
- sketch, sketch_selection,
- to_object, to_offset, from_object, from_offset) ->
- feature interface initialized from arguments:
- - sketch
- - sketch_selection
- - to_object
- - to_offset
- - from_object
- - from_offset
+ .. function:: RevolutionSketch(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: RevolutionSketch(feature, sketch, sketch_selection, to_size, from_size)
+
+ Create interface for the feature and initialize the feature with arguments.
+
+ .. function:: RevolutionSketch(feature, sketch, sketch_selection, to_object, to_offset, from_object, from_offset)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
def addRotation(part, *args):
- """Add an Rotation feature to the Part and return Rotation.
+ """Add a Rotation feature to the Part.
- Pass all args to Rotation __init__ function.
+ .. function:: addRotation(part, main_objects, axis_object, angle)
+
+ Args:
+ part (ModelAPI_Document): part document
+ main_objects (list of Selection): main objects
+ axis_object (list of Selection): axis object
+ angle (double): angle
+
+ Returns:
+ Rotation: rotation object
"""
assert(args)
feature = part.addFeature("Rotation")
class Rotation(Interface):
"""Interface class for Rotation features.
- Rotation(feature) -> feature interface without initialization
- Rotation(feature, main_objects, axis_object, angle) ->
- feature interface initialized from arguments:
- - main_objects
- - axis_object
- - angle
+ .. function:: Rotation(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: Rotation(feature, main_objects, axis_object, angle)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
def addTranslation(part, *args):
- """Add an Translation feature to the Part and return Translation.
+ """Add a Translation feature to the Part.
- Pass all args to Translation __init__ function.
+ .. function:: addTranslation(part, main_objects, axis_object, distance)
+
+ Args:
+ part (ModelAPI_Document): part document
+ main_objects (list of Selection): main objects
+ axis_object (Selection): axis objects
+ distance (double): distance
+
+ Returns:
+ Translation: translation object
"""
assert(args)
feature = part.addFeature("Translation")
class Translation(Interface):
"""Interface class for Translation features.
- Translation(feature) -> feature interface without initialization
- Translation(feature, main_objects, axis_object, distance) ->
- feature interface initialized from arguments:
- - main_objects
- - axis_object
- - distance
+ .. function:: Translation(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: Translation(feature, main_objects, axis_object, distance)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
def addParameter(part, *args):
"""Add a Parameter feature to the Part and return Parameter.
+ .. function:: addParameter(part, variable, expression)
+
+ Args:
+ part (ModelAPI_Document): part document
+ variable (string): variable name
+ expression (string): Python expression
+
+ Returns:
+ Parameter: parameter object
+
Pass all args to Parameter __init__ function.
"""
assert(args)
class Parameter(Interface):
"""Interface class for Parameter feature.
- Parameter(feature) -> feature interface without initialization
- Parameter(feature, variable, expression) ->
- feature interface initialized from arguments:
- - variable -- variable name
- - expression -- Python expression
+ .. function:: Point(feature)
+
+ Create interface for the feature without initialization.
+
+ .. function:: Point(feature, variable, expression)
+
+ Create interface for the feature and initialize the feature with arguments.
"""
def __init__(self, feature, *args):
def addPart(partset):
"""Add a Part feature to the Part and return Part.
- Pass all args to Part __init__ function.
+ Args:
+ partset (ModelAPI_Document): partset document
+
+ Returns:
+ Part: part object
"""
feature = partset.addFeature("Part")
return Part(feature)
def duplicatePart(part):
- """Create a copy of the Part."""
+ """Create a copy of the Part.
+
+ Args:
+ part (ModelAPI_Document): part document
+
+ Returns:
+ Part: part object
+ """
feature = part.addFeature("Duplicate")
feature.execute()
return Part(feature)
def removePart(part):
- """Remove the Part."""
+ """Remove the Part.
+
+ Args:
+ part (ModelAPI_Document): part document
+ """
feature = part.addFeature("Remove")
feature.execute()
class Part(Interface):
"""Interface class for Part feature.
- Part(feature) -> feature interface without initialization
+ .. function:: Part(feature)
+
+ Create interface for the feature without initialization.
"""
def __init__(self, feature):