BodySelection#

class ansys.geometry.core.selection_builder.body_selection.BodySelection(design: ansys.geometry.core.designer.design.Design, grpc_client: ansys.geometry.core.connection.client.GrpcClient, items: list[ansys.geometry.core.designer.body.Body] = None)#

Bases: ansys.geometry.core.selection_builder.typed_selection.TypedSelection

A builder for creating a body selection.

Overview#

get_all_visible_bodies

Return all visible bodies in the active document.

get_all_bodies

Return all bodies in the active document.

get_all_surface_bodies

Return all surface bodies in the active document.

get_all_solid_bodies

Return all solid bodies in the active document.

get_bodies_from_named_selection

Return bodies belonging to a named selection.

get_bodies_with_name

Return bodies whose name matches a filter.

get_bodies_with_volume

Return bodies whose volume falls within a range.

get_bodies_with_surface_area

Return bodies whose surface area falls within a range.

get_bodies_with_x_location

Return bodies whose X-location centroid falls within a range.

get_bodies_with_y_location

Return bodies whose Y-location centroid falls within a range.

get_bodies_with_z_location

Return bodies whose Z-location centroid falls within a range.

get_bodies_with_color

Return bodies that match a specific color.

invert_body_selection

Return all bodies not in the given selection.

filter_bodies_by_volume

Filter bodies whose volume falls within a range.

filter_bodies_max_volume

Return the body with the maximum volume from the selection.

filter_bodies_min_volume

Return the body with the minimum volume from the selection.

filter_bodies_by_surface_area

Filter bodies whose surface area falls within a range.

filter_bodies_max_surface_area

Return the body with the maximum surface area from the selection.

filter_bodies_min_surface_area

Return the body with the minimum surface area from the selection.

filter_bodies_by_face_count

Filter bodies whose face count falls within a range.

filter_bodies_max_face_count

Return the body with the maximum face count from the selection.

filter_bodies_min_face_count

Return the body with the minimum face count from the selection.

filter_bodies_by_edge_count

Filter bodies whose edge count falls within a range.

filter_bodies_max_edge_count

Return the body with the maximum edge count from the selection.

filter_bodies_min_edge_count

Return the body with the minimum edge count from the selection.

filter_bodies_by_loop_count

Filter bodies whose loop count falls within a range.

filter_bodies_max_loop_count

Return the body with the maximum loop count from the selection.

filter_bodies_min_loop_count

Return the body with the minimum loop count from the selection.

filter_bodies_by_number_surfaces

Filter bodies by the count of a specific surface type they contain.

filter_bodies_by_number_curves

Filter bodies by the count of a specific curve type they contain.

filter_bodies_max_number_surfaces

Return the body with the most surfaces of a given type.

filter_bodies_max_number_curves

Return the body with the most curves of a given type.

filter_bodies_min_number_surfaces

Return the body with the fewest surfaces of a given type.

filter_bodies_min_number_curves

Return the body with the fewest curves of a given type.

filter_bodies_by_number_surfaces_percentile

Filter bodies by the percentile of a surface type count relative to the selection.

filter_bodies_by_number_curves_percentile

Filter bodies by the percentile of a curve type count relative to the selection.

filter_bodies_by_color

Filter bodies that match a specific color.

filter_bodies_by_name

Filter bodies whose name matches a filter.

filter_bodies_containing_surface_types

Filter bodies that contain specific surface types.

filter_bodies_containing_curve_types

Filter bodies that contain specific curve types.

filter_bodies_volume_percentile

Filter bodies by volume percentile relative to the selection.

filter_bodies_surface_area_percentile

Filter bodies by surface area percentile relative to the selection.

filter_bodies_face_count_percentile

Filter bodies by face count percentile relative to the selection.

filter_bodies_edge_count_percentile

Filter bodies by edge count percentile relative to the selection.

filter_bodies_loop_count_percentile

Filter bodies by loop count percentile relative to the selection.

filter_surface_bodies

Keep only surface bodies from the selection.

filter_solid_bodies

Keep only solid bodies from the selection.

extend_to_same_volume

Extend the selection with bodies that have the same volume.

extend_to_same_surface_area

Extend the selection with bodies that have the same surface area.

extend_to_same_number_of_faces

Extend the selection with bodies that have the same number of faces.

extend_to_same_number_of_edges

Extend the selection with bodies that have the same number of edges.

extend_to_same_color

Extend the selection with bodies that share the same color.

extend_to_same_name

Extend the selection with bodies that share the same name.

extend_nearby_bodies

Extend the selection with bodies within a given distance.

order_bodies_by_volume

Return bodies sorted by volume in ascending order.

order_bodies_by_surface_area

Return bodies sorted by surface area in ascending order.

order_bodies_by_face_count

Return bodies sorted by face count in ascending order.

order_bodies_by_edge_count

Return bodies sorted by edge count in ascending order.

order_bodies_by_loop_count

Return bodies sorted by loop count in ascending order.

order_bodies_by_number_of_surfaces

Return bodies sorted by total surface count in ascending order.

order_bodies_by_number_of_curves

Return bodies sorted by total curve count in ascending order.

group_bodies_by_volume

Group bodies by volume.

group_bodies_by_surface_area

Group bodies by surface area.

group_bodies_by_face_count

Group bodies by face count.

group_bodies_by_edge_count

Group bodies by edge count.

group_bodies_by_loop_count

Group bodies by loop count.

group_bodies_by_color

Group bodies by color.

group_bodies_by_name

Group bodies by name.

__add__

Return a new selection that is the union of this selection and another.

__sub__

Return a new selection that is the difference of this selection and another.

__and__

Return a new selection that is the intersection of this selection and another.

Import detail#

from ansys.geometry.core.selection_builder.body_selection import BodySelection

Method detail#

BodySelection.__add__(other: BodySelection) BodySelection#

Return a new selection that is the union of this selection and another.

BodySelection.__sub__(other: BodySelection) BodySelection#

Return a new selection that is the difference of this selection and another.

BodySelection.__and__(other: BodySelection) BodySelection#

Return a new selection that is the intersection of this selection and another.

BodySelection.get_all_visible_bodies() BodySelection#

Return all visible bodies in the active document.

Returns:
BodySelection

All visible bodies.

BodySelection.get_all_bodies() BodySelection#

Return all bodies in the active document.

Returns:
BodySelection

All bodies.

BodySelection.get_all_surface_bodies() BodySelection#

Return all surface bodies in the active document.

Returns:
BodySelection

All surface bodies.

BodySelection.get_all_solid_bodies() BodySelection#

Return all solid bodies in the active document.

Returns:
BodySelection

All solid bodies.

BodySelection.get_bodies_from_named_selection(name: str) BodySelection#

Return bodies belonging to a named selection.

Parameters:
namestr

Name (or pattern) of the named selection to match.

Returns:
BodySelection

Bodies belonging to the matched named selection.

BodySelection.get_bodies_with_name(name: str, filter_type: ansys.geometry.core.selection_builder.selection_builder.StringFilterType = StringFilterType.STRINGFILTERTYPE_TEXT, ignore_case: bool = False) BodySelection#

Return bodies whose name matches a filter.

Parameters:
namestr

Name pattern to match against body names.

filter_typeStringFilterType, default: StringFilterType.STRINGFILTERTYPE_TEXT

String filter type.

ignore_casebool, default: False

Whether the name match is case-insensitive.

Returns:
BodySelection

Bodies whose name matches the filter.

BodySelection.get_bodies_with_volume(min: ansys.geometry.core.misc.measurements.Volume | pint.Quantity | numbers.Real, max: ansys.geometry.core.misc.measurements.Volume | pint.Quantity | numbers.Real | None = None) BodySelection#

Return bodies whose volume falls within a range.

Parameters:
minVolume | Quantity | Real

Minimum volume (inclusive).

maxVolume | Quantity | Real, optional

Maximum volume (inclusive). If not provided, no upper bound is applied.

Returns:
BodySelection

Bodies whose volume is within the specified range.

BodySelection.get_bodies_with_surface_area(min: ansys.geometry.core.misc.measurements.Area | pint.Quantity | numbers.Real, max: ansys.geometry.core.misc.measurements.Area | pint.Quantity | numbers.Real | None = None) BodySelection#

Return bodies whose surface area falls within a range.

Parameters:
minArea | Quantity | Real

Minimum surface area (inclusive).

maxArea | Quantity | Real, optional

Maximum surface area (inclusive). If not provided, no upper bound is applied.

Returns:
BodySelection

Bodies whose surface area is within the specified range.

BodySelection.get_bodies_with_x_location(range_type: ansys.geometry.core.selection_builder.selection_builder.RangeType = RangeType.RANGETYPE_INTERSECT, min: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | numbers.Real | None = None, max: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | numbers.Real | None = None) BodySelection#

Return bodies whose X-location centroid falls within a range.

Parameters:
range_typeRangeType, default: RangeType.RANGETYPE_INTERSECT

Range type specifier.

minDistance | Quantity | Real, optional

Minimum X-location. If not provided, no lower bound is applied.

maxDistance | Quantity | Real, optional

Maximum X-location. If not provided, no upper bound is applied.

Returns:
BodySelection

Bodies whose X-location is within the specified range.

BodySelection.get_bodies_with_y_location(range_type: ansys.geometry.core.selection_builder.selection_builder.RangeType = RangeType.RANGETYPE_INTERSECT, min: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | numbers.Real | None = None, max: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | numbers.Real | None = None) BodySelection#

Return bodies whose Y-location centroid falls within a range.

Parameters:
range_typeRangeType, default: RangeType.RANGETYPE_INTERSECT

Range type specifier.

minDistance | Quantity | Real, optional

Minimum Y-location. If not provided, no lower bound is applied.

maxDistance | Quantity | Real, optional

Maximum Y-location. If not provided, no upper bound is applied.

Returns:
BodySelection

Bodies whose Y-location is within the specified range.

BodySelection.get_bodies_with_z_location(range_type: ansys.geometry.core.selection_builder.selection_builder.RangeType = RangeType.RANGETYPE_INTERSECT, min: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | numbers.Real | None = None, max: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | numbers.Real | None = None) BodySelection#

Return bodies whose Z-location centroid falls within a range.

Parameters:
range_typeRangeType, default: RangeType.RANGETYPE_INTERSECT

Range type specifier.

minDistance | Quantity | Real, optional

Minimum Z-location. If not provided, no lower bound is applied.

maxDistance | Quantity | Real, optional

Maximum Z-location. If not provided, no upper bound is applied.

Returns:
BodySelection

Bodies whose Z-location is within the specified range.

BodySelection.get_bodies_with_color(color: str | tuple[float, float, float] | tuple[float, float, float, float]) BodySelection#

Return bodies that match a specific color.

Parameters:
colorstr | tuple[float, float, float] | tuple[float, float, float, float]

Color to set the body to. This can be a string representing a color name or a tuple of RGB values in the range [0, 1] (RGBA) or [0, 255] (pure RGB).

Returns:
BodySelection

Bodies with the specified color.

BodySelection.invert_body_selection(scope: ansys.geometry.core.selection_builder.selection_builder.InvertScope = InvertScope.INVERTSCOPE_VISIBLE) BodySelection#

Return all bodies not in the given selection.

Parameters:
scopeInvertScope, default: InvertScope.INVERTSCOPE_VISIBLE

Whether to invert within visible bodies or all bodies.

Returns:
BodySelection

Bodies that are the inverse of the input selection.

BodySelection.filter_bodies_by_volume(min: ansys.geometry.core.misc.measurements.Volume | pint.Quantity | numbers.Real, max: ansys.geometry.core.misc.measurements.Volume | pint.Quantity | numbers.Real | None = None) BodySelection#

Filter bodies whose volume falls within a range.

Parameters:
minVolume | Quantity | Real

Minimum volume (inclusive).

maxVolume | Quantity | Real, optional

Maximum volume (inclusive). If not provided, no upper bound is applied.

Returns:
BodySelection

Bodies whose volume is within the specified range.

BodySelection.filter_bodies_max_volume() BodySelection#

Return the body with the maximum volume from the selection.

Returns:
BodySelection

Body with the maximum volume.

BodySelection.filter_bodies_min_volume() BodySelection#

Return the body with the minimum volume from the selection.

Returns:
BodySelection

Body with the minimum volume.

BodySelection.filter_bodies_by_surface_area(min: ansys.geometry.core.misc.measurements.Area | pint.Quantity | numbers.Real, max: ansys.geometry.core.misc.measurements.Area | pint.Quantity | numbers.Real | None = None) BodySelection#

Filter bodies whose surface area falls within a range.

Parameters:
minArea | Quantity | Real

Minimum surface area (inclusive).

maxArea | Quantity | Real, optional

Maximum surface area (inclusive). If not provided, no upper bound is applied.

Returns:
BodySelection

Bodies whose surface area is within the specified range.

BodySelection.filter_bodies_max_surface_area() BodySelection#

Return the body with the maximum surface area from the selection.

Returns:
BodySelection

Body with the maximum surface area.

BodySelection.filter_bodies_min_surface_area() BodySelection#

Return the body with the minimum surface area from the selection.

Returns:
BodySelection

Body with the minimum surface area.

BodySelection.filter_bodies_by_face_count(min: int, max: int = None) BodySelection#

Filter bodies whose face count falls within a range.

Parameters:
minint

Minimum face count (inclusive).

maxint, optional

Maximum face count (inclusive). If not provided, no upper bound is applied.

Returns:
BodySelection

Bodies whose face count is within the specified range.

BodySelection.filter_bodies_max_face_count() BodySelection#

Return the body with the maximum face count from the selection.

Returns:
BodySelection

Body with the maximum face count.

BodySelection.filter_bodies_min_face_count() BodySelection#

Return the body with the minimum face count from the selection.

Returns:
BodySelection

Body with the minimum face count.

BodySelection.filter_bodies_by_edge_count(min: int, max: int = None) BodySelection#

Filter bodies whose edge count falls within a range.

Parameters:
minint

Minimum edge count (inclusive).

maxint, optional

Maximum edge count (inclusive). If not provided, no upper bound is applied.

Returns:
BodySelection

Bodies whose edge count is within the specified range.

BodySelection.filter_bodies_max_edge_count() BodySelection#

Return the body with the maximum edge count from the selection.

Returns:
BodySelection

Body with the maximum edge count.

BodySelection.filter_bodies_min_edge_count() BodySelection#

Return the body with the minimum edge count from the selection.

Returns:
BodySelection

Body with the minimum edge count.

BodySelection.filter_bodies_by_loop_count(min: int, max: int = None) BodySelection#

Filter bodies whose loop count falls within a range.

Parameters:
minint

Minimum loop count (inclusive).

maxint, optional

Maximum loop count (inclusive). If not provided, no upper bound is applied.

Returns:
BodySelection

Bodies whose loop count is within the specified range.

BodySelection.filter_bodies_max_loop_count() BodySelection#

Return the body with the maximum loop count from the selection.

Returns:
BodySelection

Body with the maximum loop count.

BodySelection.filter_bodies_min_loop_count() BodySelection#

Return the body with the minimum loop count from the selection.

Returns:
BodySelection

Body with the minimum loop count.

BodySelection.filter_bodies_by_number_surfaces(surface_type: ansys.geometry.core.designer.face.SurfaceType, min: int, max: int = None) BodySelection#

Filter bodies by the count of a specific surface type they contain.

Parameters:
surface_typeSurfaceType

The surface type to count per body.

minint

Minimum count (inclusive).

maxint, optional

Maximum count (inclusive). If not provided, no upper bound is applied.

Returns:
BodySelection

Bodies with a matching count of the specified surface type.

BodySelection.filter_bodies_by_number_curves(curve_type: ansys.geometry.core.designer.edge.CurveType, min: int, max: int = None) BodySelection#

Filter bodies by the count of a specific curve type they contain.

Parameters:
curve_typeCurveType

The curve type to count per body.

minint

Minimum count (inclusive).

maxint, optional

Maximum count (inclusive). If not provided, no upper bound is applied.

Returns:
BodySelection

Bodies with a matching count of the specified curve type.

BodySelection.filter_bodies_max_number_surfaces(surface_type: ansys.geometry.core.designer.face.SurfaceType) BodySelection#

Return the body with the most surfaces of a given type.

Parameters:
surface_typeSurfaceType

The surface type to count per body.

Returns:
BodySelection

Body with the maximum count of the specified surface type.

BodySelection.filter_bodies_max_number_curves(curve_type: ansys.geometry.core.designer.edge.CurveType) BodySelection#

Return the body with the most curves of a given type.

Parameters:
curve_typeCurveType

The curve type to count per body.

Returns:
BodySelection

Body with the maximum count of the specified curve type.

BodySelection.filter_bodies_min_number_surfaces(surface_type: ansys.geometry.core.designer.face.SurfaceType) BodySelection#

Return the body with the fewest surfaces of a given type.

Parameters:
surface_typeSurfaceType

The surface type to count per body.

Returns:
BodySelection

Body with the minimum count of the specified surface type.

BodySelection.filter_bodies_min_number_curves(curve_type: ansys.geometry.core.designer.edge.CurveType) BodySelection#

Return the body with the fewest curves of a given type.

Parameters:
curve_typeCurveType

The curve type to count per body.

Returns:
BodySelection

Body with the minimum count of the specified curve type.

BodySelection.filter_bodies_by_number_surfaces_percentile(surface_type: ansys.geometry.core.designer.face.SurfaceType, min_percentile: numbers.Real, max_percentile: numbers.Real) BodySelection#

Filter bodies by the percentile of a surface type count relative to the selection.

Parameters:
surface_typeSurfaceType

The surface type to count per body.

min_percentileReal

Minimum percentile threshold (0–100).

max_percentileReal

Maximum percentile threshold (0–100).

Returns:
BodySelection

Bodies within the percentile range for the surface type count.

BodySelection.filter_bodies_by_number_curves_percentile(curve_type: ansys.geometry.core.designer.edge.CurveType, min_percentile: numbers.Real, max_percentile: numbers.Real) BodySelection#

Filter bodies by the percentile of a curve type count relative to the selection.

Parameters:
curve_typeCurveType

The curve type to count per body.

min_percentileReal

Minimum percentile threshold (0–100).

max_percentileReal

Maximum percentile threshold (0–100).

Returns:
BodySelection

Bodies within the percentile range for the curve type count.

BodySelection.filter_bodies_by_color(color: str | tuple[float, float, float] | tuple[float, float, float, float]) BodySelection#

Filter bodies that match a specific color.

Parameters:
colorstr | tuple[float, float, float] | tuple[float, float, float, float]

Color to match. This can be a string representing a color name or a tuple of RGB values in the range [0, 1] (RGBA) or [0, 255] (pure RGB).

Returns:
BodySelection

Bodies with the specified color.

BodySelection.filter_bodies_by_name(name: str, filter_type: ansys.geometry.core.selection_builder.selection_builder.StringFilterType = StringFilterType.STRINGFILTERTYPE_TEXT, ignore_case: bool = False) BodySelection#

Filter bodies whose name matches a filter.

Parameters:
namestr

Name pattern to match.

filter_typeStringFilterType, default: StringFilterType.STRINGFILTERTYPE_TEXT

String filter type.

ignore_casebool, default: False

Whether the name match is case-insensitive.

Returns:
BodySelection

Bodies whose name matches the filter.

BodySelection.filter_bodies_containing_surface_types(surface_type: ansys.geometry.core.designer.face.SurfaceType, exclusive: bool = False) BodySelection#

Filter bodies that contain specific surface types.

Parameters:
surface_typeSurfaceType

Surface type that the body must contain.

exclusivebool, default: False

If True, the body must contain only the specified surface type.

Returns:
BodySelection

Bodies containing the specified surface type.

BodySelection.filter_bodies_containing_curve_types(curve_type: ansys.geometry.core.designer.edge.CurveType, exclusive: bool = False) BodySelection#

Filter bodies that contain specific curve types.

Parameters:
curve_typeCurveType

Curve type that the body must contain.

exclusivebool, default: False

If True, the body must contain only the specified curve type.

Returns:
BodySelection

Bodies containing the specified curve type.

BodySelection.filter_bodies_volume_percentile(min_percentile: numbers.Real, max_percentile: numbers.Real) BodySelection#

Filter bodies by volume percentile relative to the selection.

Parameters:
min_percentileReal

Minimum percentile threshold (0–100).

max_percentileReal

Maximum percentile threshold (0–100).

Returns:
BodySelection

Bodies within the specified volume percentile range.

BodySelection.filter_bodies_surface_area_percentile(min_percentile: numbers.Real, max_percentile: numbers.Real) BodySelection#

Filter bodies by surface area percentile relative to the selection.

Parameters:
min_percentileReal

Minimum percentile threshold (0–100).

max_percentileReal

Maximum percentile threshold (0–100).

Returns:
BodySelection

Bodies within the specified surface area percentile range.

BodySelection.filter_bodies_face_count_percentile(min_percentile: numbers.Real, max_percentile: numbers.Real) BodySelection#

Filter bodies by face count percentile relative to the selection.

Parameters:
min_percentileReal

Minimum percentile threshold (0–100).

max_percentileReal

Maximum percentile threshold (0–100).

Returns:
BodySelection

Bodies within the specified face count percentile range.

BodySelection.filter_bodies_edge_count_percentile(min_percentile: numbers.Real, max_percentile: numbers.Real) BodySelection#

Filter bodies by edge count percentile relative to the selection.

Parameters:
min_percentileReal

Minimum percentile threshold (0–100).

max_percentileReal

Maximum percentile threshold (0–100).

Returns:
BodySelection

Bodies within the specified edge count percentile range.

BodySelection.filter_bodies_loop_count_percentile(min_percentile: numbers.Real, max_percentile: numbers.Real) BodySelection#

Filter bodies by loop count percentile relative to the selection.

Parameters:
min_percentileReal

Minimum percentile threshold (0–100).

max_percentileReal

Maximum percentile threshold (0–100).

Returns:
BodySelection

Bodies within the specified loop count percentile range.

BodySelection.filter_surface_bodies() BodySelection#

Keep only surface bodies from the selection.

Returns:
BodySelection

Only the surface bodies from the input selection.

BodySelection.filter_solid_bodies() BodySelection#

Keep only solid bodies from the selection.

Returns:
BodySelection

Only the solid bodies from the input selection.

BodySelection.extend_to_same_volume(scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) BodySelection#

Extend the selection with bodies that have the same volume.

Parameters:
scopeExtendScope, default: ExtendScope.EXTENDSCOPE_ALL

Whether to search all bodies or only visible ones.

Returns:
BodySelection

Input bodies plus additional bodies with matching volumes.

BodySelection.extend_to_same_surface_area(scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) BodySelection#

Extend the selection with bodies that have the same surface area.

Parameters:
scopeExtendScope, default: ExtendScope.EXTENDSCOPE_ALL

Whether to search all bodies or only visible ones.

Returns:
BodySelection

Input bodies plus additional bodies with matching surface areas.

BodySelection.extend_to_same_number_of_faces(scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) BodySelection#

Extend the selection with bodies that have the same number of faces.

Parameters:
scopeExtendScope, default: ExtendScope.EXTENDSCOPE_ALL

Whether to search all bodies or only visible ones.

Returns:
BodySelection

Input bodies plus additional bodies with the same face count.

BodySelection.extend_to_same_number_of_edges(scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) BodySelection#

Extend the selection with bodies that have the same number of edges.

Parameters:
scopeExtendScope, default: ExtendScope.EXTENDSCOPE_ALL

Whether to search all bodies or only visible ones.

Returns:
BodySelection

Input bodies plus additional bodies with the same edge count.

BodySelection.extend_to_same_color(scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) BodySelection#

Extend the selection with bodies that share the same color.

Parameters:
scopeExtendScope, default: ExtendScope.EXTENDSCOPE_ALL

Whether to search all bodies or only visible ones.

Returns:
BodySelection

Input bodies plus additional bodies with matching colors.

BodySelection.extend_to_same_name(scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) BodySelection#

Extend the selection with bodies that share the same name.

Parameters:
scopeExtendScope, default: ExtendScope.EXTENDSCOPE_ALL

Whether to search all bodies or only visible ones.

Returns:
BodySelection

Input bodies plus additional bodies with matching names.

BodySelection.extend_nearby_bodies(distance: ansys.geometry.core.misc.measurements.Distance | pint.Quantity | numbers.Real, scope: ansys.geometry.core.selection_builder.selection_builder.ExtendScope = ExtendScope.EXTENDSCOPE_ALL) BodySelection#

Extend the selection with bodies within a given distance.

Parameters:
distanceDistance | Quantity | Real

Maximum proximity distance.

scopeExtendScope, default: ExtendScope.EXTENDSCOPE_ALL

Whether to search all bodies or only visible ones.

Returns:
BodySelection

Input bodies plus additional bodies within the specified distance.

Warning

This is not currently supported for CoreService backends.

BodySelection.order_bodies_by_volume() BodySelection#

Return bodies sorted by volume in ascending order.

Returns:
BodySelection

Bodies ordered from smallest to largest volume.

BodySelection.order_bodies_by_surface_area() BodySelection#

Return bodies sorted by surface area in ascending order.

Returns:
BodySelection

Bodies ordered from smallest to largest surface area.

BodySelection.order_bodies_by_face_count() BodySelection#

Return bodies sorted by face count in ascending order.

Returns:
BodySelection

Bodies ordered from fewest to most faces.

BodySelection.order_bodies_by_edge_count() BodySelection#

Return bodies sorted by edge count in ascending order.

Returns:
BodySelection

Bodies ordered from fewest to most edges.

BodySelection.order_bodies_by_loop_count() BodySelection#

Return bodies sorted by loop count in ascending order.

Returns:
BodySelection

Bodies ordered from fewest to most loops.

BodySelection.order_bodies_by_number_of_surfaces() BodySelection#

Return bodies sorted by total surface count in ascending order.

Returns:
BodySelection

Bodies ordered from fewest to most surfaces.

BodySelection.order_bodies_by_number_of_curves() BodySelection#

Return bodies sorted by total curve count in ascending order.

Returns:
BodySelection

Bodies ordered from fewest to most curves.

BodySelection.group_bodies_by_volume() list[BodySelection]#

Group bodies by volume.

Returns:
list[BodySelection]

Bodies partitioned into groups of equal volume.

BodySelection.group_bodies_by_surface_area() list[BodySelection]#

Group bodies by surface area.

Returns:
list[BodySelection]

Bodies partitioned into groups of equal surface area.

BodySelection.group_bodies_by_face_count() list[BodySelection]#

Group bodies by face count.

Returns:
list[BodySelection]

Bodies partitioned into groups with the same face count.

BodySelection.group_bodies_by_edge_count() list[BodySelection]#

Group bodies by edge count.

Returns:
list[BodySelection]

Bodies partitioned into groups with the same edge count.

BodySelection.group_bodies_by_loop_count() list[BodySelection]#

Group bodies by loop count.

Returns:
list[BodySelection]

Bodies partitioned into groups with the same loop count.

BodySelection.group_bodies_by_color() list[BodySelection]#

Group bodies by color.

Returns:
list[BodySelection]

Bodies partitioned into groups sharing the same color.

BodySelection.group_bodies_by_name() list[BodySelection]#

Group bodies by name.

Returns:
list[BodySelection]

Bodies partitioned into groups sharing the same name.