Operations¶
Public Methods¶
-
pushPull(feature, depth)¶
Push or Pulls a face or edge to specific depth.
| param feature: | Feature to push or pull. |
|---|---|
| type feature: | FeatureArea |
| param depth: | Push or Pull distance. |
| type depth: | float |
-
extract(feature)
Extracts geometry features and transfer them into a new part.
| param feature: | Feature to be extracted. |
|---|---|
| type feature: | Feature |
-
mirror(entity, planeOrigin=None, planeNormal=None, keep=True)
Mirrors part across a symmetry plane.
User needs to provide the planeOrigin and planeNormal if passing in a Part for mirror.
| param entity: | Part from which a mirror part needs to be created or a Planar feature which needs to be mirrored across the plane |
|---|---|
| type entity: | Part, FeaturePlanar |
| param planeOrigin: | |
| origin of the symmetry plane. | |
| type planeOrigin: | |
| Triple | |
| param planeNormal: | |
| normal of the symmetry plane. | |
| type planeNormal: | |
| Triple | |
| param keep: | True to keep the original part, False remove it. |
| type keep: | Bool |
| returns: | New mirrored part created. |
| rtype: | Part |
-
patch(feature)
Creates patches to fill in specified missing surfaces.
| param feature: | Feature to be patched. |
|---|---|
| type feature: | Feature |
-
deleteFaces(feature)¶
Deletes the specified face from the part.
| param feature: | Feature to be removed. |
|---|---|
| type feature: | Feature |
-
move(part, position)
Translates and/or rotates a part.
| param part: | The part to move. |
|---|---|
| type part: | Part |
| param position: | The position to move the part at. |
| type position: | Matrix44 |
-
rotate(part, axis, angle, degrees=True)
Rotates around the specified axis.
This is a body rotation.
| param part: | The part to rotate. |
|---|---|
| type part: | Part |
| param axis: | The rotation axis. Valid choices are “x”, “y”, “z” or any Vector. |
| type axis: | Union[Vector, str] |
| param angle: | The rotation angle. |
| type angle: | float |
| param degrees: | Determines if angles is in degrees or not. |
| type degrees: | bool |
-
scale(part, value=1.1)
Resizes the part to the specified scale value.
This is useful when working with an imported model that is associated with a different default unit system.
| param part: | Part that needs to be scaled. |
|---|---|
| type part: | Part |
| param value: | Specify scale factor. |
| type value: | float |
-
booleanCombine(target, tools=None)¶
Combines the specified parts.
| param target: | Part to be combined with tools. |
|---|---|
| type target: | Part |
| param tools: | Parts to be combined with target. Destroyed after combine. |
| type tools: | list[Part] |
| returns: | The combined part. |
| rtype: | Part |
-
booleanSubtract(targets, tools, deleteOthers=True)¶
Carves out one set of solid objects from another set of solid objects.
| param targets: | The parts being carved. |
|---|---|
| type targets: | list[Part] |
| param tools: | The parts doing the carving. |
| type tools: | list[Part] |
| param deleteOthers: | |
| Specify to delete others. | |
| type deleteOthers: | |
| bool | |
| returns: | The remaining part. |
| rtype: | Part |
-
booleanIntersect(targets, tools, deleteOthers=True, deleteTarget=True)¶
Retains only the intersecting portions of two sets of solid objects.
| param targets: | The first set of parts |
|---|---|
| type targets: | list[Part] |
| param tools: | Part or parts for boolean intersect operation. |
| type tools: | list[Part] |
| param deleteOthers: | |
| Specify to delete others. | |
| type deleteOthers: | |
| bool | |
| param deleteTarget: | |
| Specify to delete target. | |
| type deleteTarget: | |
| bool | |
| returns: | The intersected part. |
| rtype: | Part |
-
slice(targets, cutOrigin=None, cutNormal=None, surfaceFeature=None, extendSurface=True)
Slices a set of solid objects with a cutting plane or cutting surface.
User needs to provide the cutOrigin and cutNormal or the surfaceFeature.
| param targets: | The parts to slice across the cutting plane. |
|---|---|
| type targets: | [Part] |
| param cutOrigin: | |
| The origin of the cutting plane. | |
| type cutOrigin: | math.Point |
| param cutNormal: | |
| The normal of the cutting plane. | |
| type cutNormal: | math.Vector |
| param surfaceFeature: | |
| The surface to slice the enity accross. | |
| type surfaceFeature: | |
| FeatureArea | |
| param extendSurface: | |
| Set Automatic extension On/Off for tool Surface. | |
| type extendSurface: | |
| bool | |
| returns: | The new sliced part created. |
| rtype: | Part |
-
simplifyImprints(entity)¶
Finds and remove imprints from a part.
An imprint is an edge or a point that appears on a surface that can be removed without changing the underlying integrity of the surface, such as scratches or trimmed points.
| param entity: | Part from which you want to remove the Imprints from or FeatureLinear imprint to be removed. |
|---|---|
| type entity: | Part, FeatureLinear |
-
simplifyRounds(entity)¶
Finds and removes both round (convex) and fillet (concave) surfaces from a part.
| param entity: | Part from which you want to remove the Fillets, Chamfers from or a Feature to be removed. |
|---|---|
| type entity: | Part, Feature |
-
simplifyHoles(entity)¶
Finds and removes holes and pockets, and find raised areas such as lettering.
| param entity: | Part from which you want to remove the Holes from or FeatureCircular which needs to be removed. |
|---|---|
| type entity: | Part, Feature |
-
simplifyPlugs(entity)¶
Finds holes and pockets, and plug them by filling the area with a new part
| param entity: | Part from which you want to plug the holes or a Circular feature that needs to be plugged. |
|---|---|
| type entity: | Part, Feature |
-
partition(feature, thickness='1 mm', substractFromTarget=False)
Divides a solid part into design and non-design regions by selecting a hole, pocket, or face to offset.
| param feature: | feature to be partitioned. |
|---|---|
| type feature: | Feature |
| param thickness: | |
| partition thickness consider in mm. | |
| type thickness: | float |
| param substractFromTarget: | |
| Remove the original feature from the part and then create a partition. Defaults to False, | |
| type substractFromTarget: | |
| bool | |
-
midSurface(part, surfaceOptions='Mid')¶
Extracts a midsurface or side faces from thin solids, and determine where surfaces are represented.
Replacing parts with midsurfaces yields better results while increasing speed when running an analysis or optimization.
| param part: | part which needs midsurface extraction. |
|---|---|
| type part: | Part |
| param surfaceOptions: | |
| side options allows you to extract the Mid, Left or Right surface of the part. | |
| type surfaceOptions: | |
| str | |
-
fillet(feature, radius='3 mm')
Creates fillet on a Linear/Planar feature.
| param feature: | feature that needs to be fillet. |
|---|---|
| type feature: | Feature |
| param radius: | Radius of the fillet in string format. |
| type radius: | str |
-
chamferByAngle(feature, angle=45, dist=0.003)¶
Creates chamfer on a Linear/Planar feature.
| param feature: | Feature that needs to be chamfer. |
|---|---|
| type feature: | Feature |
| param angle: | Chamfer angle from the edge. |
| type angle: | float |
| param dist: | Chamfer distance from the edge. |
| type dist: | float |
-
chamferByDistance(feature, dist1=0.003, dist2=0.003)¶
Creates chamfer on a linear or planar feature.
| param feature: | Feature that needs to be chamfer. |
|---|---|
| type feature: | Feature |
| param dist1: | Chamfer distance from the edge. |
| type dist1: | float |
| param dist2: | Chamfer distance from the edge. |
| type dist2: | float |
-
shell(feature, thickness=1)
Removes material and create thin walls to generate a shelled part.
| param feature: | Feature to create a shelled part from. |
|---|---|
| type feature: | FeatureArea |
| param thickness: | |
| Shell thickness consider in mm. | |
| type thickness: | float |
-
referencePlane(features, planeMethod, ratio=0.5, offset=0, rotationAngle=0, flipTangent=False)¶
Reference planes can be used with the Sketch, Slice, and Mirror tools to create or modify geometry, or to create section cuts.
| param features: | Features to create a reference plane. |
|---|---|
| type features: | list[Feature], Feature |
| param planeMethod: | |
| Plane Methods. - OFFSET - THREE_POINTS - MIDPLANE - NORMAL_TO_EDGE - AT_AN_ANGLE - NORMAL_TO_EDGE_AT_POINT - CYLINDER_TANGENT - PARALLEL_TO_SCREEN - UNREFERENCED | |
| type planeMethod: | |
| str | |
| param ratio: | Applicable for MidPlane and CurveNormal method. |
| type ratio: | float |
| param offset: | offset value. Applicable for Offset method. |
| type offset: | float |
| param rotationAngle: | |
| Angle in degree.Applicable for At an angle method. | |
| type rotationAngle: | |
| float | |
| param flipTangent: | |
| If True, flip the tangent for cylinder tangent method. | |
| type flipTangent: | |
| bool | |
-
extrude(features, direction, resultType, parts=None, extrudeAsSolid=True, reference=None, extrudeTo1=1, extrudeTo2=1, angle1=0, angle2=0, extrusionEndCaps=None)
Extrude sketch profile.
| param features: | The features of the sketch to |
|---|---|
| type features: | Union[Feature] |
| param extrude.: | |
| param extrudeAsSolid: | |
| If True extrude as Solid, otherwise extrude as Sheet. | |
| type extrudeAsSolid: | |
| bool | |
| param direction: | |
| The Extrude Direction. Valid choices are: - SINGLE - BOTH - SYMMETRY | |
| type direction: | str |
| param resultType: | |
| The Extrude Result. Valid choices are: - COMBINE - SUBTRACT - INTERSECT - NEW_PART | |
| type resultType: | |
| str | |
| param parts: | Parts you would like to merge the extruded shape with. Defaults to None. That means the extruded shape will be merged with all parts that touch it. |
| type parts: | list[Part] |
| param reference: | |
| Direction vector of extrusion. Defaults to the feature normal. | |
| type reference: | Union[math.Vector, FeatureLinear, System |
| param extrudeTo1: | |
| If extrudeTo1 is a float then its the extrusion length in direction 1 in meters. If extrudeTo1 is a FeautrePoint or a FeaturePlanar then its used to determine the extrusion length in direction 1. Defaults to 1. | |
| type extrudeTo1: | |
| Union[float, FeaturePlanar, FeaturePoint] | |
| param extrudeTo2: | |
| If extrudeTo2 is a float then its the extrusion length in direction 2 in meters. If extrudeTo2 is a FeautrePoint or a FeaturePlanar then its used to determine the extrusion length in direction 2. Defaults to 1. | |
| type extrudeTo2: | |
| Union[float, FeaturePlanar, FeaturePoint] | |
| param angle1: | The draft angle in direction 1 in degree. Defaults to 0. |
| type angle1: | float |
| param angle2: | The draft angle in direction 2 in degree. Defaults to 0. |
| type angle2: | float |
| param extrusionEndCaps: | |
| The Extrusion End Caps. Valid choices are: - NONE - BOTH - START - END | |
| type extrusionEndCaps: | |
| str | |
-
revolve(feature, angle, axis)
Revolve a face, sketch, line, or 2D edge about an axis.
| param feature: | A face, line, or 2D edge. |
|---|---|
| type feature: | Union[FeatureArea, FeatureCurve] |
| param angle: | The angle of revolution. |
| type angle: | float |
| param axis: | An edge, line, cylindrical hole or a System. If it is of type System it has to have systemType Axis. Selecting an edge on another part projects the axis of revolution to the planar face that will be rotated. |
| type axis: | Union[FeatureLinear, FeatureCircular, System] |
-
createPipe(path, section='CIRCLE', size=0.01, width=0.01, thickness=0.0, angle=None, ignoredFeatures=None, propagate=False, resultType='COMBINE')¶
Create Pipe for FeatureCurve.
| param path: | A FeatureCurve or a list of FeatureCurve. |
|---|---|
| type path: | list[FeatureCurve], FeatureCurve |
| param section: | The Pipe Profile Type. Valid choices are: - CIRCLE - SQUARE - TRIANGLE - RECTANGLE |
| type section: | str |
| param size: | Length of the pipe. |
| type size: | float |
| param width: | Width of the pipe, only applicable for Rectangular profile. |
| type width: | float |
| param thickness: | |
| Pipe thickness. If not set or set to zero , it will be solid pipe. | |
| type thickness: | float |
| param angle: | Angle in radians. Only for xy alignment. |
| type angle: | float |
| param ignoredFeatures: | |
| Ignored Features. Not mandatory. In propagated cases, if we need to ignore certain curves. | |
| param propagate: | |
| if True enables propagate option, otherwise disabled. | |
| type propagate: | bool |
| param resultType: | |
| The Result Operation Type. Valid choices are: - COMBINE - SUBTRACT - INTERSECT - NEW_PART | |
| type resultType: | |
| str | |
-
circularPattern(input, axis, angle=60, count=3, equalSpacing=False, instances=False)¶
Circular Pattern parts or faces around an axis.
| param input: | A Part or a list of Parts, or a FeatureArea or a list of FeatureArea. |
|---|---|
| type input: | list[Part], Part, list[FeatureArea], FeatureArea |
| param axis: | Axis is a reference line, edge, or axis to which the pattern will be parallel. |
| type axis: | math.Vector, FeatureCurve, System |
| param angle: | Angle within which the copies are equally spaced. |
| type angle: | float |
| param count: | Number of copies. |
| type count: | int |
| param equalSpacing: | |
| If True, equally space the copies within a specified Angle. | |
| type equalSpacing: | |
| bool | |
| param instances: | |
| If True,any changes to part or face will apply to all instances. | |
| type instances: | bool |
-
linearPattern(input, direction1, direction2=(0, 0, 0), bothDirection=False, spacing1=0.0, count1=3, spacing2=0.0, count2=3, instances=False)¶
Linear Pattern parts or faces along a direction.
| param input: | A Part or a list of Parts. |
|---|---|
| type input: | list[Part], Part |
| param direction1: | |
| Direction can be a reference line, edge, or axis to which the pattern will be parallel. | |
| type direction1: | |
| math.Vector, FeatureCurve, System | |
| param direction2: | |
| Direction can be a reference line, edge, or axis to which the pattern will be parallel. | |
| type direction2: | |
| math.Vector, FeatureCurve, System | |
| param bothDirection: | |
| If True, sets in both direction otherwise single direction. | |
| type bothDirection: | |
| bool | |
| param spacing1: | Distance between two copies. |
| type spacing1: | float |
| param count1: | Number of copies. |
| type count1: | int |
| param spacing2: | Distance between two copies. |
| type spacing2: | float |
| param count2: | Number of copies. |
| type count2: | int |
| param instances: | |
| If True,any changes to part or face will apply to all instances. | |
| type instances: | bool |
-
draft(features, direction, neutralPlane, angle1=3.0, angle2=3.0, flipDrawDirection1=False, flipDrawDirection2=False)
Add draft to one or more faces of a part when designing a product that is manufactured using injection molding.
| param features: | Faces to Draft. |
|---|---|
| type features: | list[FeatureArea], FeatureArea |
| param direction: | |
| The Draft Direction. Valid choices are: - SINGLE - BOTH - SYMMETRY | |
| type direction: | str |
| param neutralPlane: | |
| A reference plane or an existing face in the model. neutralPlane can not be same as draft feature. | |
| type neutralPlane: | |
| FeaturePlanar, System | |
| param angle1: | The angle1 of draft. |
| type angle1: | float |
| param angle2: | The angle2 of draft. This is applicable for BOTH or SYMMETRIC direction. |
| type angle2: | float |
| param flipDrawDirection1: | |
| If True, flips the draw direction of draft in single direction. | |
| type flipDrawDirection1: | |
| bool | |
| param flipDrawDirection2: | |
| If True, flips the draw direction of draft. Applicable for BOTH direction. | |
| type flipDrawDirection2: | |
| bool | |
-
moveFaces(features, position, duplicate=False)¶
Translate, rotate, copy, or extend features.
| param features: | The features to move. |
|---|---|
| type features: | list[FeatureArea], FeatureArea |
| param position: | The position to move the features at. |
| type position: | Matrix44 |
| param duplicate: | |
| If True, copy the features at given position. | |
| type duplicate: | bool |
-
offset(input, value, newPart=False)
Offset surfaces or parts.
Use the Offset to: 1. Proportionally increase or decrease the size of a solid part. 2. Increase or decrease a solid part’s dimension along a line normal to a selected surface (constrained by surrounding surfaces). 3. Create a new solid part proportionally larger or smaller than the original 4. Create a new surface part at specified distance from a part’s selected surface(s) 5. Offset selected surface(s) of a surface part (constrained by surrounding surfaces)
| param input: | A Part or a list of Parts or a Feature or a list of Features. |
|---|---|
| type input: | list[Part], Part, list[Feature], Feature |
| param value: | Desired offset distance. A negative value means inward direction. |
| type value: | float |
| param newPart: | If True, creates a new part. Defaults to False. |
| type newPart: | bool |
| returns: | New part created if newPart was True. |
| rtype: | Part |
-
thicken(parts, value, symmetric=True)
Thicken surface parts and convert them to solids, or thicken and hollow solid parts.
When used on a solid part, the Thicken tool yields a hollow solid. When used on a surface part, the Thicken tool yields a solid part.
| param parts: | A Part or a list of Parts. |
|---|---|
| type parts: | list[Part], Part |
| param value: | Desired offset distance. A negative value means inward direction. |
| type value: | float |
| param symmetric: | |
| If True, offsets symmetrically to both sides of the part’s surface. Defaults to True. | |
| type symmetric: | bool |
-
intersect(parts, createSolids=False, keepSourceParts=False)
Intersect tool that deletes excess faces, edges and vertices.
| param parts: | Parts to intersect. |
|---|---|
| type parts: | list[Part], Part |
| param createSolids: | |
| If True, faces of solid volumes automatically selected. | |
| type createSolids: | |
| bool | |
| param keepSourceParts: | |
| Keep Input Parts yes or no. Default is no. When original parts are not kept, they are deleted from the model at the end of a successful operation. | |
| type keepSourceParts: | |
| bool | |
-
translate(part, x=0, y=None, z=None)
Translates by the specified distance.
If y is None, x is assumed to be a list of 3 floats.
| param part: | The part to translate. |
|---|---|
| type part: | Part |
| param x: | The distance to translate the ‘x’ vector. Defaults to 0. |
| type x: | Union[float, list[float]], optional |
| param y: | The distance to translate the ‘y’ vector. Defaults to None. |
| type y: | float, optional |
| param z: | The distance to translate the ‘z’ vector. Defaults to None. |
| type z: | float, optional |
-
convertToMass(parts, parent=None)¶
Replace Parts to concentrated mass.
| param parts: | Parts to be replaced with concentrated mass. |
|---|---|
| type parts: | list[Part], Part |
| param parent: | Parent for the mass created. |
| type parent: | Part |
-
replaceFromFile(part, filePath)¶
Replace part with the contents of a file.
| param part: | The part to be replaced. |
|---|---|
| type part: | Part |
| param filePath: | The path to the file whose contents will replace the part. |
| type filePath: | str |
-
replaceFromPart(part, toolPart, keepToolPart=False)¶
Replace part with tool part.
| param part: | The part to be replaced. |
|---|---|
| type part: | Part |
| param toolPart: | The part to replace with. |
| type toolPart: | Part |
| param keepToolPart: | |
| Determines whether to keep the toolPart or not after replace. | |
| type keepToolPart: | |
| bool | |
-
convertBodiesToParts(parts)¶
Convert disconnected bodies to parts.
| param parts: | The parts to be converted. |
|---|---|
| type parts: | list[Part] |
| returns: | Newly created parts. |
| rtype: | list[Part] |
-
breakInstance(parts)¶
Break the instances of a part.
| param parts: | Parts for breaking instances. |
|---|---|
| type parts: | list[Part] |