GeometryCommands#

class ansys.geometry.core.designer.geometry_commands.GeometryCommands(grpc_client: ansys.geometry.core.connection.client.GrpcClient, _internal_use: bool = False)#

Provides geometry commands for PyAnsys Geometry.

Parameters:
grpc_clientGrpcClient

gRPC client to use for the geometry commands.

_internal_usebool, optional

Internal flag to prevent direct instantiation by users. This parameter is for internal use only.

Raises:
GeometryRuntimeError

If the class is instantiated directly by users instead of through the modeler.

Notes

This class should not be instantiated directly. Use modeler.geometry_commands instead.

Overview#

chamfer

Create a chamfer on an edge or adjust the chamfer of a face.

fillet

Create a fillet on an edge or adjust the fillet of a face.

full_fillet

Create a full fillet betweens a collection of faces.

extrude_faces

Extrude a selection of faces.

extrude_faces_up_to

Extrude a selection of faces up to another object.

extrude_edges

Extrude a selection of edges. Provide either a face or a direction and point.

extrude_edges_up_to

Extrude a selection of edges up to another object.

fill_edge_loops

Fill the surfaces bounded by the given edge loops.

rename_object

Rename an object.

create_linear_pattern

Create a linear pattern. The pattern can be one or two dimensions.

modify_linear_pattern

Modify a linear pattern. Leave an argument at 0 for it to remain unchanged.

create_circular_pattern

Create a circular pattern. The pattern can be one or two dimensions.

modify_circular_pattern

Modify a circular pattern. Leave an argument at 0 for it to remain unchanged.

create_fill_pattern

Create a fill pattern.

update_fill_pattern

Update a fill pattern.

revolve_faces

Revolve face around an axis.

revolve_faces_up_to

Revolve face around an axis up to a certain object.

revolve_faces_by_helix

Revolve face around an axis in a helix shape.

replace_face

Replace a face with another face.

split_body

Split bodies with a plane, slicers, or faces.

get_round_info

Get info on the rounding of a face.

move_translate

Move a selection by a distance in a direction.

move_rotate

Rotate a selection by an angle about a given axis.

offset_faces_set_radius

Offset faces with a radius.

create_align_condition

Create an align condition between two geometry objects.

create_tangent_condition

Create a tangent condition between two geometry objects.

create_orient_condition

Create an orient condition between two geometry objects.

move_imprint_edges

Move the imprint edges in the specified direction by the specified distance.

offset_edges

Offset the specified edges with the specified distance.

sweep_edges

Sweep edges along trajectory curves.

sweep_faces

Sweep faces along trajectory curves.

draft_faces

Draft the specified faces in the specified direction by the specified angle.

thicken_faces

Thicken the specified faces by the specified thickness in the specified direction.

offset_faces

Offset the specified faces by the specified distance in the specified direction.

revolve_edges

Revolve edges around an axis.

intersect_curve_and_surface

Find the intersection points of a curve and a surface.

detach_faces

Detach faces on all the bodies/faces from a list.

revolve_points

Revolve design points around an axis to create curves.

revolve_points_by_helix

Revolve design points around an axis in a helix shape to create curves.

sweep_points

Sweep design points along a trajectory to create curves.

split_edge

Split an edge by a proportion, a point, or a length.

split_face

Split faces by points, curves, or other faces.

project_to_solid

Project faces onto a target body to create new faces on the body.

Import detail#

from ansys.geometry.core.designer.geometry_commands import GeometryCommands

Method detail#

GeometryCommands.chamfer(selection: ansys.geometry.core.designer.edge.Edge | list[ansys.geometry.core.designer.edge.Edge] | ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], distance: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real) bool#

Create a chamfer on an edge or adjust the chamfer of a face.

Parameters:
selectionEdge | list[Edge] | Face | list[Face]

One or more edges or faces to act on.

distanceDistance | Quantity | Real

Chamfer distance.

Returns:
bool

True when successful, False when failed.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.fillet(selection: ansys.geometry.core.designer.edge.Edge | list[ansys.geometry.core.designer.edge.Edge] | ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], radius: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real) bool#

Create a fillet on an edge or adjust the fillet of a face.

Parameters:
selectionEdge | list[Edge] | Face | list[Face]

One or more edges or faces to act on.

radiusDistance | Quantity | Real

Fillet radius.

Returns:
bool

True when successful, False when failed.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.full_fillet(faces: list[ansys.geometry.core.designer.face.Face]) bool#

Create a full fillet betweens a collection of faces.

Parameters:
faceslist[Face]

Faces to round.

Returns:
bool

True when successful, False when failed.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.extrude_faces(faces: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], distance: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real, direction: ansys.geometry.core.math.vector.UnitVector3D = None, extrude_type: ExtrudeType = ExtrudeType.ADD, offset_mode: OffsetMode = OffsetMode.MOVE_FACES_TOGETHER, pull_symmetric: bool = False, copy: bool = False, force_do_as_extrude: bool = False) list[ansys.geometry.core.designer.body.Body]#

Extrude a selection of faces.

Parameters:
facesFace | list[Face]

Faces to extrude.

distanceDistance | Quantity | Real

Distance to extrude.

directionUnitVector3D, default: None

Direction of extrusion. If no direction is provided, it will be inferred.

extrude_typeExtrudeType, default: ExtrudeType.ADD

Type of extrusion to be performed.

offset_modeOffsetMode, default: OffsetMode.MOVE_FACES_TOGETHER

Mode of how to handle offset relationships.

pull_symmetricbool, default: False

Pull symmetrically on both sides if True.

copybool, default: False

Copy the face and move it instead of extruding the original face if True.

force_do_as_extrudebool, default: False

Forces to do as an extrusion if True, if False allows extrusion by offset.

Returns:
list[Body]

Bodies created by the extrusion if any.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.extrude_faces_up_to(faces: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], up_to_selection: ansys.geometry.core.designer.face.Face | ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.designer.body.Body, seed_point: ansys.geometry.core.math.point.Point3D, direction: ansys.geometry.core.math.vector.UnitVector3D, extrude_type: ExtrudeType = ExtrudeType.ADD, offset_mode: OffsetMode = OffsetMode.MOVE_FACES_TOGETHER, pull_symmetric: bool = False, copy: bool = False, force_do_as_extrude: bool = False) list[ansys.geometry.core.designer.body.Body]#

Extrude a selection of faces up to another object.

Parameters:
facesFace | list[Face]

Faces to extrude.

up_to_selectionFace | Edge | Body

The object to pull the faces up to.

seed_pointPoint3D

Origin to define the extrusion.

directionUnitVector3D, default: None

Direction of extrusion. If no direction is provided, it will be inferred.

extrude_typeExtrudeType, default: ExtrudeType.ADD

Type of extrusion to be performed.

offset_modeOffsetMode, default: OffsetMode.MOVE_FACES_TOGETHER

Mode of how to handle offset relationships.

pull_symmetricbool, default: False

Pull symmetrically on both sides if True.

copybool, default: False

Copy the face and move it instead of extruding the original face if True.

force_do_as_extrudebool, default: False

Forces to do as an extrusion if True, if False allows extrusion by offset.

Returns:
list[Body]

Bodies created by the extrusion if any.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.extrude_edges(edges: ansys.geometry.core.designer.edge.Edge | list[ansys.geometry.core.designer.edge.Edge], distance: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real, from_face: ansys.geometry.core.designer.face.Face = None, from_point: ansys.geometry.core.math.point.Point3D = None, direction: ansys.geometry.core.math.vector.UnitVector3D = None, extrude_type: ExtrudeType = ExtrudeType.ADD, pull_symmetric: bool = False, copy: bool = False, natural_extension: bool = False) list[ansys.geometry.core.designer.body.Body]#

Extrude a selection of edges. Provide either a face or a direction and point.

Parameters:
edgesEdge | list[Edge]

Edges to extrude.

distanceDistance | Quantity | Real

Distance to extrude.

from_faceFace, default: None

Face to pull normal from.

from_pointPoint3D, default: None

Point to pull from. Must be used with direction.

directionUnitVector3D, default: None

Direction to pull. Must be used with from_point.

extrude_typeExtrudeType, default: ExtrudeType.ADD

Type of extrusion to be performed.

pull_symmetricbool, default: False

Pull symmetrically on both sides if True.

copybool, default: False

Copy the edge and move it instead of extruding the original edge if True.

natural_extensionbool, default: False

Surfaces will extend in a natural or linear shape after exceeding its original range.

Returns:
list[Body]

Bodies created by the extrusion if any.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.extrude_edges_up_to(edges: ansys.geometry.core.designer.edge.Edge | list[ansys.geometry.core.designer.edge.Edge], up_to_selection: ansys.geometry.core.designer.face.Face | ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.designer.body.Body, seed_point: ansys.geometry.core.math.point.Point3D, direction: ansys.geometry.core.math.vector.UnitVector3D, extrude_type: ExtrudeType = ExtrudeType.ADD) list[ansys.geometry.core.designer.body.Body]#

Extrude a selection of edges up to another object.

Parameters:
edgesEdge | list[Edge]

Edges to extrude.

up_to_selectionFace, default: None

The object to pull the faces up to.

seed_pointPoint3D

Origin to define the extrusion.

directionUnitVector3D, default: None

Direction of extrusion.

extrude_typeExtrudeType, default: ExtrudeType.ADD

Type of extrusion to be performed.

Returns:
list[Body]

Bodies created by the extrusion if any.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.fill_edge_loops(loops: ansys.geometry.core.designer.face.FaceLoop | list[ansys.geometry.core.designer.face.FaceLoop]) list[ansys.geometry.core.designer.body.Body]#

Fill the surfaces bounded by the given edge loops.

Parameters:
loopsFaceLoop | list[FaceLoop]

One or more edge loops defining the boundaries of the surfaces to fill. Each FaceLoop contains the edges that form a closed loop.

Returns:
list[Body]

Bodies created by the fill operation if any.

Raises:
ValueError

If loops is empty or contains no edges.

Warning

This method is only available starting on Ansys release 27R1.

GeometryCommands.rename_object(selection: list[ansys.geometry.core.designer.body.Body] | list[ansys.geometry.core.designer.component.Component], name: str) bool#

Rename an object.

Parameters:
selectionlist[Body] | list[Component]

Selection of the objects to rename.

namestr

New name for the object.

Returns:
bool

True when successful, False when failed.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.create_linear_pattern(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], linear_direction: ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.designer.face.Face, count_x: int, pitch_x: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real, two_dimensional: bool = False, count_y: int = None, pitch_y: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real = None) bool#

Create a linear pattern. The pattern can be one or two dimensions.

Parameters:
selectionFace | list[Face]

Faces to create the pattern out of.

linear_directionEdge | Face

Direction of the linear pattern, determined by the direction of an edge or face normal.

count_xint

How many times the pattern repeats in the x direction.

pitch_xDistance | Quantity | Real

The spacing between each pattern member in the x direction.

two_dimensionalbool, default: False

If True, create a pattern in the x and y direction.

count_yint, default: None

How many times the pattern repeats in the y direction.

pitch_yDistance | Quantity | Real, default: None

The spacing between each pattern member in the y direction.

Returns:
bool

True when successful, False when failed.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.modify_linear_pattern(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], count_x: int = 0, pitch_x: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real = 0.0, count_y: int = 0, pitch_y: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real = 0.0, new_seed_index: int = 0, old_seed_index: int = 0) bool#

Modify a linear pattern. Leave an argument at 0 for it to remain unchanged.

Parameters:
selectionFace | list[Face]

Faces that belong to the pattern.

count_xint, default: 0

How many times the pattern repeats in the x direction.

pitch_xDistance | Quantity | Real, default: 0.0

The spacing between each pattern member in the x direction.

count_yint, default: 0

How many times the pattern repeats in the y direction.

pitch_yDistance | Quantity | Real, default: 0.0

The spacing between each pattern member in the y direction.

new_seed_indexint, default: 0

The new seed index of the member.

old_seed_indexint, default: 0

The old seed index of the member.

Returns:
bool

True when successful, False when failed.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.create_circular_pattern(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], circular_axis: ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.shapes.curves.line.Line, circular_count: int, circular_angle: ansys.geometry.core.misc.measurements.Angle | pint.Quantity | ansys.geometry.core.typing.Real, two_dimensional: bool = False, linear_count: int = None, linear_pitch: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real = None, radial_direction: ansys.geometry.core.math.vector.UnitVector3D = None) bool#

Create a circular pattern. The pattern can be one or two dimensions.

Parameters:
selectionFace | list[Face]

Faces to create the pattern out of.

circular_axisEdge | Line

The axis of the circular pattern.

circular_countint

How many members are in the circular pattern.

circular_angleAngle | Quantity | Real

The angular range of the pattern.

two_dimensionalbool, default: False

If True, create a two-dimensional pattern.

linear_countint, default: None

How many times the circular pattern repeats along the radial lines for a two-dimensional pattern.

linear_pitchDistance | Quantity | Real, default: None

The spacing along the radial lines for a two-dimensional pattern.

radial_directionUnitVector3D, default: None

The direction from the center out for a two-dimensional pattern.

Returns:
bool

True when successful, False when failed.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.modify_circular_pattern(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], circular_count: int = 0, linear_count: int = 0, step_angle: ansys.geometry.core.misc.measurements.Angle | pint.Quantity | ansys.geometry.core.typing.Real = 0.0, step_linear: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real = 0.0) bool#

Modify a circular pattern. Leave an argument at 0 for it to remain unchanged.

Parameters:
selectionFace | list[Face]

Faces that belong to the pattern.

circular_countint, default: 0

How many members are in the circular pattern.

linear_countint, default: 0

How many times the circular pattern repeats along the radial lines for a two-dimensional pattern.

step_angleAngle | Quantity | Real, default: 0.0

Defines the circular angle.

step_linearDistance | Quantity | Real, default: 0.0

Defines the step, along the radial lines, for a pattern dimension greater than 1.

Returns:
bool

True when successful, False when failed.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.create_fill_pattern(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], linear_direction: ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.designer.face.Face, fill_pattern_type: FillPatternType, margin: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real, x_spacing: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real, y_spacing: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real, row_x_offset: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real = 0, row_y_offset: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real = 0, column_x_offset: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real = 0, column_y_offset: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real = 0) bool#

Create a fill pattern.

Parameters:
selectionFace | list[Face]

Faces to create the pattern out of.

linear_directionEdge

Direction of the linear pattern, determined by the direction of an edge.

fill_pattern_typeFillPatternType

The type of fill pattern.

marginDistance | Quantity | Real

Margin defining the border of the fill pattern.

x_spacingDistance | Quantity | Real

Spacing between the pattern members in the x direction.

y_spacingDistance | Quantity | Real

Spacing between the pattern members in the x direction.

row_x_offsetDistance | Quantity | Real, default: 0

Offset for the rows in the x direction. Only used with FillPattern.SKEWED.

row_y_offsetDistance | Quantity | Real, default: 0

Offset for the rows in the y direction. Only used with FillPattern.SKEWED.

column_x_offsetDistance | Quantity | Real, default: 0

Offset for the columns in the x direction. Only used with FillPattern.SKEWED.

column_y_offsetDistance | Quantity | Real, default: 0

Offset for the columns in the y direction. Only used with FillPattern.SKEWED.

Returns:
bool

True when successful, False when failed.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.update_fill_pattern(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face]) bool#

Update a fill pattern.

When the face that a fill pattern exists upon changes in size, the fill pattern can be updated to fill the new space.

Parameters:
selectionFace | list[Face]

Face(s) that are part of a fill pattern.

Returns:
bool

True when successful, False when failed.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.revolve_faces(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], axis: ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.shapes.curves.line.Line, angle: ansys.geometry.core.misc.measurements.Angle | pint.Quantity | ansys.geometry.core.typing.Real, extrude_type: ExtrudeType = ExtrudeType.ADD) list[ansys.geometry.core.designer.body.Body]#

Revolve face around an axis.

Parameters:
selectionFace | list[Face]

Face(s) to revolve.

axisEdge | Line

Axis of revolution.

angleAngle | Quantity | Real

Angular distance to revolve.

extrude_typeExtrudeType, default: ExtrudeType.ADD

Type of extrusion to be performed.

Returns:
list[Body]

Bodies created by the extrusion if any.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.revolve_faces_up_to(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], up_to: ansys.geometry.core.designer.face.Face | ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.designer.body.Body, axis: ansys.geometry.core.shapes.curves.line.Line, direction: ansys.geometry.core.math.vector.UnitVector3D, extrude_type: ExtrudeType = ExtrudeType.ADD) list[ansys.geometry.core.designer.body.Body]#

Revolve face around an axis up to a certain object.

Parameters:
selectionFace | list[Face]

Face(s) to revolve.

up_toFace | Edge | Body

Object to revolve the face up to.

axisLine

Axis of revolution.

directionUnitVector3D

Direction of extrusion.

extrude_typeExtrudeType, default: ExtrudeType.ADD

Type of extrusion to be performed.

Returns:
list[Body]

Bodies created by the extrusion if any.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.revolve_faces_by_helix(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], axis: ansys.geometry.core.shapes.curves.line.Line, direction: ansys.geometry.core.math.vector.UnitVector3D, height: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real, pitch: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real, taper_angle: ansys.geometry.core.misc.measurements.Angle | pint.Quantity | ansys.geometry.core.typing.Real, right_handed: bool, both_sides: bool, extrude_type: ExtrudeType = ExtrudeType.ADD) list[ansys.geometry.core.designer.body.Body]#

Revolve face around an axis in a helix shape.

Parameters:
selectionFace | list[Face]

Face(s) to revolve.

axisLine

Axis of revolution.

directionUnitVector3D

Direction of extrusion.

heightDistance | Quantity | Real,

Height of the helix.

pitchDistance | Quantity | Real,

Pitch of the helix.

taper_angleAngle | Quantity | Real,

Taper angle of the helix.

right_handedbool,

Right-handed helix if True, left-handed if False.

both_sidesbool,

Create on both sides if True, one side if False.

extrude_typeExtrudeType, default: ExtrudeType.ADD

Type of extrusion to be performed.

Returns:
list[Body]

Bodies created by the extrusion if any.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.replace_face(target_selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], replacement_selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face]) bool#

Replace a face with another face.

Parameters:
target_selectionUnion[Face, list[Face]]

The face or faces to replace.

replacement_selectionUnion[Face, list[Face]]

The face or faces to replace with.

Returns:
bool

True when successful, False when failed.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.split_body(bodies: list[ansys.geometry.core.designer.body.Body], plane: ansys.geometry.core.math.plane.Plane, slicers: ansys.geometry.core.designer.edge.Edge | list[ansys.geometry.core.designer.edge.Edge] | ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], faces: list[ansys.geometry.core.designer.face.Face], extendfaces: bool) bool#

Split bodies with a plane, slicers, or faces.

Parameters:
bodieslist[Body]

Bodies to split.

planePlane

Plane to split with

slicersEdge | list[Edge] | Face | list[Face]

Slicers to split with.

faceslist[Face]

Faces to split with.

extendFacesbool

Extend faces if split with faces.

Returns:
bool

True when successful, False when failed.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.get_round_info(face: ansys.geometry.core.designer.face.Face) tuple[bool, ansys.geometry.core.typing.Real]#

Get info on the rounding of a face.

Parameters:
Face

The design face to get round info on.

Returns:
tuple[bool, Real]

True if round is aligned with face’s U-parameter direction, False otherwise. Radius of the round.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.move_translate(selection: ansys.geometry.core.designer.selection.NamedSelection, direction: ansys.geometry.core.math.vector.UnitVector3D, distance: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real) bool#

Move a selection by a distance in a direction.

Parameters:
selectionNamedSelection

Named selection to move.

directionUnitVector3D

Direction to move in.

distanceDistance | Quantity | Real

Distance to move. Default units are meters.

Returns:
bool

True when successful, False when failed.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.move_rotate(selection: ansys.geometry.core.designer.selection.NamedSelection, axis: ansys.geometry.core.shapes.curves.line.Line, angle: ansys.geometry.core.misc.measurements.Angle | pint.Quantity | ansys.geometry.core.typing.Real) dict[str, bool | ansys.geometry.core.typing.Real]#

Rotate a selection by an angle about a given axis.

Parameters:
selectionNamedSelection

Named selection to move.

axisLine

Direction to move in.

AngleAngle | Quantity | Real

Angle to rotate by. Default units are radians.

Returns:
dict[str, Union[bool, Real]]

Dictionary containing the useful output from the command result. Keys are success, modified_bodies, modified_faces, modified_edges.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.offset_faces_set_radius(faces: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], radius: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real, copy: bool = False, offset_mode: OffsetMode = OffsetMode.IGNORE_RELATIONSHIPS, extrude_type: ExtrudeType = ExtrudeType.FORCE_INDEPENDENT) bool#

Offset faces with a radius.

Parameters:
facesFace | list[Face]

Faces to offset.

radiusDistance | Quantity | Real

Radius of the offset.

copybool, default: False

Copy the face and move it instead of offsetting the original face if True.

offset_modeOffsetMode, default: OffsetMode.MOVE_FACES_TOGETHER

Mode of how to handle offset relationships.

extrude_typeExtrudeType, default: ExtrudeType.FORCE_INDEPENDENT

Type of extrusion to be performed.

Returns:
bool

True when successful, False when failed.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.create_align_condition(parent_component: ansys.geometry.core.designer.component.Component, geometry_a: ansys.geometry.core.designer.body.Body | ansys.geometry.core.designer.face.Face | ansys.geometry.core.designer.edge.Edge, geometry_b: ansys.geometry.core.designer.body.Body | ansys.geometry.core.designer.face.Face | ansys.geometry.core.designer.edge.Edge) ansys.geometry.core.designer.mating_conditions.AlignCondition#

Create an align condition between two geometry objects.

This will move the objects to be aligned with each other.

Parameters:
parent_componentComponent

The common ancestor component of the two geometry objects.

geometry_aBody | Face | Edge

The first geometry object to align to the second.

geometry_bBody | Face | Edge

The geometry object to be aligned to.

Returns:
AlignCondition

The persistent align condition that was created.

Warning

This method is only available starting on Ansys release 26R1.

GeometryCommands.create_tangent_condition(parent_component: ansys.geometry.core.designer.component.Component, geometry_a: ansys.geometry.core.designer.body.Body | ansys.geometry.core.designer.face.Face | ansys.geometry.core.designer.edge.Edge, geometry_b: ansys.geometry.core.designer.body.Body | ansys.geometry.core.designer.face.Face | ansys.geometry.core.designer.edge.Edge) ansys.geometry.core.designer.mating_conditions.TangentCondition#

Create a tangent condition between two geometry objects.

This aligns the objects so that they are tangent.

Parameters:
parent_componentComponent

The common ancestor component of the two geometry objects.

geometry_aBody | Face | Edge

The first geometry object to tangent the second.

geometry_bBody | Face | Edge

The geometry object to be tangent with.

Returns:
TangentCondition

The persistent tangent condition that was created.

Warning

This method is only available starting on Ansys release 26R1.

GeometryCommands.create_orient_condition(parent_component: ansys.geometry.core.designer.component.Component, geometry_a: ansys.geometry.core.designer.body.Body | ansys.geometry.core.designer.face.Face | ansys.geometry.core.designer.edge.Edge, geometry_b: ansys.geometry.core.designer.body.Body | ansys.geometry.core.designer.face.Face | ansys.geometry.core.designer.edge.Edge) ansys.geometry.core.designer.mating_conditions.OrientCondition#

Create an orient condition between two geometry objects.

This rotates the objects so that they are oriented in the same direction.

Parameters:
parent_componentComponent

The common ancestor component of the two geometry objects.

geometry_aBody | Face | Edge

The first geometry object to orient with the second.

geometry_bBody | Face | Edge

The geometry object to be oriented with.

Returns:
OrientCondition

The persistent orient condition that was created.

Warning

This method is only available starting on Ansys release 26R1.

GeometryCommands.move_imprint_edges(edges: list[ansys.geometry.core.designer.edge.Edge], direction: ansys.geometry.core.math.vector.UnitVector3D, distance: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real) bool#

Move the imprint edges in the specified direction by the specified distance.

Parameters:
edgeslist[Edge]

The edges to move.

directionUnitVector3D

The direction to move the edges.

distanceDistance | Quantity | Real

The distance to move the edges.

Returns:
bool

Returns True if the edges were moved successfully, False otherwise.

GeometryCommands.offset_edges(edges: list[ansys.geometry.core.designer.edge.Edge], offset: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real) bool#

Offset the specified edges with the specified distance.

Parameters:
edgeslist[Edge]

The edges to offset.

offsetDistance | Quantity | Real

The distance to offset the edges.

Returns:
bool

Returns True if the edges were offset successfully, False otherwise.

GeometryCommands.sweep_edges(edges: ansys.geometry.core.designer.edge.Edge | list[ansys.geometry.core.designer.edge.Edge], trajectories: ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.designer.designcurve.DesignCurve | list[ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.designer.designcurve.DesignCurve], distance: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real | None = None) list[ansys.geometry.core.designer.body.Body]#

Sweep edges along trajectory curves.

Parameters:
edgesEdge | list[Edge]

Edges to sweep.

trajectoriesEdge | DesignCurve | list[Edge | DesignCurve]

Trajectory curve(s) to sweep along.

distanceDistance | Quantity | Real, default: None

Distance to sweep. If not provided, the full trajectory length is used.

Returns:
list[Body]

Bodies modified by the sweep operation.

Warning

This method is only available starting on Ansys release 27R1.

GeometryCommands.sweep_faces(faces: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face], trajectories: ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.designer.designcurve.DesignCurve | list[ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.designer.designcurve.DesignCurve], distance: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real | None = None) list[ansys.geometry.core.designer.body.Body]#

Sweep faces along trajectory curves.

Parameters:
facesFace | list[Face]

Faces to sweep.

trajectoriesEdge | DesignCurve | list[Edge | DesignCurve]

Trajectory curve(s) to sweep along.

distanceDistance | Quantity | Real, default: None

Distance to sweep. If not provided, the full trajectory length is used.

Returns:
list[Body]

Bodies created by the sweep operation.

Warning

This method is only available starting on Ansys release 27R1.

GeometryCommands.draft_faces(faces: list[ansys.geometry.core.designer.face.Face], reference_faces: list[ansys.geometry.core.designer.face.Face], draft_side: DraftSide, angle: ansys.geometry.core.misc.measurements.Angle | pint.Quantity | ansys.geometry.core.typing.Real, extrude_type: ExtrudeType) list[ansys.geometry.core.designer.face.Face]#

Draft the specified faces in the specified direction by the specified angle.

Parameters:
faceslist[Face]

The faces to draft.

reference_faceslist[Face]

The reference faces to use for the draft.

draft_sideDraftSide

The side to draft.

angleAngle | Quantity | Real

The angle to draft the faces.

extrude_typeExtrudeType

The type of extrusion to use.

Returns:
list[Face]

The faces created by the draft operation.

GeometryCommands.thicken_faces(faces: list[ansys.geometry.core.designer.face.Face], direction: ansys.geometry.core.math.vector.UnitVector3D, thickness: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real, extrude_type: ExtrudeType, pull_symmetric: bool, select_direction: bool) bool#

Thicken the specified faces by the specified thickness in the specified direction.

Parameters:
faceslist[Face]

The faces to thicken.

directionUnitVector3D

The direction to thicken the faces.

thicknessDistance | Quantity | Real

The thickness to apply to the faces.

extrude_typeExtrudeType

The type of extrusion to use.

pull_symmetricbool

Whether to pull the faces symmetrically.

select_directionbool

Whether to select the direction.

Returns:
bool

Returns True if the faces were thickened successfully, False otherwise.

GeometryCommands.offset_faces(faces: list[ansys.geometry.core.designer.face.Face], distance: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real, direction: ansys.geometry.core.math.vector.UnitVector3D, extrude_type: ExtrudeType) None#

Offset the specified faces by the specified distance in the specified direction.

Parameters:
faceslist[Face]

The faces to offset.

distanceDistance | Quantity | Real

The distance to offset the faces.

directionUnitVector3D

The direction to offset the faces.

extrude_typeExtrudeType

The type of extrusion to use.

Warning

This method is only available starting on Ansys release 26R1.

GeometryCommands.revolve_edges(edges: ansys.geometry.core.designer.edge.Edge | list[ansys.geometry.core.designer.edge.Edge], axis: ansys.geometry.core.shapes.curves.line.Line, angle: ansys.geometry.core.misc.measurements.Angle | pint.Quantity | ansys.geometry.core.typing.Real, symmetric: bool) None#

Revolve edges around an axis.

Parameters:
edgesEdge | list[Edge]

Edge(s) to revolve.

axisLine

Axis of revolution.

angleAngle | Quantity | Real

Angular distance to revolve.

symmetricbool

Revolve symmetrically if True, one side if False.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.intersect_curve_and_surface(curve: ansys.geometry.core.shapes.curves.curve.Curve, surface: ansys.geometry.core.shapes.surfaces.surface.Surface) list[ansys.geometry.core.math.point.Point3D]#

Find the intersection points of a curve and a surface.

Parameters:
curveCurve

Curve to intersect.

surfaceSurface

Surface to intersect.

Returns:
list[Point3D]

Points of intersection.

Warning

This method is only available starting on Ansys release 26R1. Nurbs curves and surfaces are not supported until Ansys release 27R1.

GeometryCommands.detach_faces(selection: ansys.geometry.core.designer.body.Body | list[ansys.geometry.core.designer.body.Body] | ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face]) list[ansys.geometry.core.designer.body.Body]#

Detach faces on all the bodies/faces from a list.

This method will result in a list of new surface bodies:

  • If the input is a body, all faces on the body will be detached and the original body will be modified to have only the non-detached faces. The detached faces will be returned as new bodies.

  • If the input is a list of faces:
    • All the connected faces from the same body will be detached together to form a body.

    • If some of the faces in the list are not connected or are not from the same body, they will be detached separately to form separate bodies.

    • The original body will be modified to have only the non-detached faces. The detached faces will be returned as new bodies.

Parameters:
selectionBody | list[Body] | Face | list[Face]

Bodies or faces from which we want to detach faces.

Returns:
list[Body]

Bodies created by the detach if any.

Warning

This method is only available starting on Ansys release 27R1.

GeometryCommands.revolve_points(selection: ansys.geometry.core.designer.designpoint.DesignPoint | list[ansys.geometry.core.designer.designpoint.DesignPoint], axis: ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.shapes.curves.line.Line, angle: ansys.geometry.core.misc.measurements.Angle | pint.Quantity | ansys.geometry.core.typing.Real) list[ansys.geometry.core.designer.designcurve.DesignCurve]#

Revolve design points around an axis to create curves.

Parameters:
selectionDesignPoint | list[DesignPoint]

Design point(s) to revolve.

axisEdge | Line

Axis of revolution.

angleAngle | Quantity | Real

Angular distance to revolve.

Returns:
list[DesignCurve]

Curves created by the revolve operation.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.revolve_points_by_helix(selection: ansys.geometry.core.designer.designpoint.DesignPoint | list[ansys.geometry.core.designer.designpoint.DesignPoint], axis: ansys.geometry.core.shapes.curves.line.Line, height: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real, pitch: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real, taper_angle: ansys.geometry.core.misc.measurements.Angle | pint.Quantity | ansys.geometry.core.typing.Real, right_handed: bool, pull_symmetric: bool) list[ansys.geometry.core.designer.designcurve.DesignCurve]#

Revolve design points around an axis in a helix shape to create curves.

Parameters:
selectionDesignPoint | list[DesignPoint]

Design point(s) to revolve.

axisLine

Axis of the helix.

heightDistance | Quantity | Real

Height of the helix.

pitchDistance | Quantity | Real

Pitch of the helix (distance between turns).

taper_angleAngle | Quantity | Real

Taper angle of the helix.

right_handedbool

True for a right-handed helix, False for left-handed.

pull_symmetricbool

True to pull symmetrically on both sides, False for one side.

Returns:
list[DesignCurve]

Curves created by the helix revolve operation.

Warning

This method is only available starting on Ansys release 25R2.

GeometryCommands.sweep_points(selection: ansys.geometry.core.designer.designpoint.DesignPoint | list[ansys.geometry.core.designer.designpoint.DesignPoint], trajectories: ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.designer.designcurve.DesignCurve | ansys.geometry.core.shapes.curves.trimmed_curve.TrimmedCurve | list[ansys.geometry.core.designer.edge.Edge | ansys.geometry.core.designer.designcurve.DesignCurve] | list[ansys.geometry.core.shapes.curves.trimmed_curve.TrimmedCurve], distance: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real) list[ansys.geometry.core.designer.designcurve.DesignCurve]#

Sweep design points along a trajectory to create curves.

Parameters:
selectionDesignPoint | list[DesignPoint]

Design point(s) to sweep.

trajectoriesEdge | DesignCurve | list[Edge | DesignCurve] | TrimmedCurve | list[TrimmedCurve]

Trajectory curve(s) to sweep along. Provide either a list of Edge / DesignCurve objects (resolved by entity ID) or a list of TrimmedCurve objects (sent as explicit geometry). These two types of trajectory are mutually exclusive and cannot be mixed.

distanceDistance | Quantity | Real

Distance to sweep the points.

Returns:
list[DesignCurve]

Curves created by the sweep operation.

Raises:
ValueError

If trajectories mixes TrimmedCurve with Edge or DesignCurve.

Warning

This method is only available starting on Ansys release 25R2. TrimmedCurve trajectories require Ansys release 27R1 and are not supported when using v0 protos.

GeometryCommands.split_edge(edge: ansys.geometry.core.designer.edge.Edge, split_type: SplitEdgeType, proportion: float | None = None, point: ansys.geometry.core.math.point.Point3D | None = None, length: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | ansys.geometry.core.typing.Real | None = None, reference: SplitEdgeReference = SplitEdgeReference.START) bool#

Split an edge by a proportion, a point, or a length.

Parameters:
edgeEdge

Edge to split.

split_typeSplitEdgeType

Type of split to perform.

proportionfloat, default: None

Proportion to split the edge by. Value should be between 0 and 1 and will be applied along the edge. Required if split_type is SplitEdgeType.BY_PROPORTION.

pointPoint3D, default: None

Point to split the edge by. Required if split_type is SplitEdgeType.BY_POINT.

lengthDistance | Quantity | Real, default: None

Length to split the edge by. Required if split_type is SplitEdgeType.BY_LENGTH.

referenceSplitEdgeReference, default: SplitEdgeReference.START

Reference point for splitting by lengths. Ignored for other split types.

Returns:
bool

True when successful, False when failed.

GeometryCommands.split_face(face: ansys.geometry.core.designer.face.Face, split_type: SplitFaceType, split_parameter: ansys.geometry.core.math.point.Point3D | None = None, split_start: ansys.geometry.core.math.point.Point3D | None = None, split_end: ansys.geometry.core.math.point.Point3D | None = None, face_cutter: ansys.geometry.core.designer.face.Face | None = None, split_curves: list[ansys.geometry.core.shapes.curves.trimmed_curve.TrimmedCurve] | None = None, parameter_type: SplitFaceParameterType = SplitFaceParameterType.UV) bool#

Split faces by points, curves, or other faces.

Parameters:
faceFace

Face to split.

split_typeSplitFaceType

Type of split to perform.

split_parameterPoint3D, default: None

Parameter to split the face by. Required if split_type is SplitFaceType.BY_PARAMETER.

split_startPoint3D, default: None

Start point to split the face by. Required if split_type is SplitFaceType.BY_TWO_POINTS.

split_endPoint3D, default: None

End point to split the face by. Required if split_type is SplitFaceType.BY_TWO_POINTS.

face_cutterFace, default: None

Face to split the original face with. Required if split_type is SplitFaceType.BY_CUTTER.

split_curveslist[TrimmedCurve], default: None

Curves to split the face by. Required if split_type is SplitFaceType.BY_CURVES.

parameter_typeSplitFaceParameterType, default: SplitFaceParameterType.UV

Type of the split parameter. Required if split_type is SplitFaceType.BY_PARAMETER.

Returns:
bool

True when successful, False when failed.

GeometryCommands.project_to_solid(selection: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face] | ansys.geometry.core.designer.edge.Edge | list[ansys.geometry.core.designer.edge.Edge], target_faces: ansys.geometry.core.designer.face.Face | list[ansys.geometry.core.designer.face.Face]) bool#

Project faces onto a target body to create new faces on the body.

Parameters:
selectionFace | list[Face] | Edge | list[Edge]

Face(s) or edge(s) to project onto the target faces.

target_facesFace | list[Face]

Face(s) to project the selection onto.

Returns:
bool

True when successful, False when failed.