@@ -148,7 +148,12 @@ def name(self) -> str:
148
148
149
149
@abstractmethod
150
150
def set_name (self , str ) -> None :
151
- """Set the name of the body."""
151
+ """Set the name of the body.
152
+
153
+ Warnings
154
+ --------
155
+ This method is only available starting on Ansys release 25R1.
156
+ """
152
157
return
153
158
154
159
@abstractmethod
@@ -158,17 +163,32 @@ def fill_style(self) -> FillStyle:
158
163
159
164
@abstractmethod
160
165
def set_fill_style (self , fill_style : FillStyle ) -> None :
161
- """Set the fill style of the body."""
166
+ """Set the fill style of the body.
167
+
168
+ Warnings
169
+ --------
170
+ This method is only available starting on Ansys release 25R1.
171
+ """
162
172
return
163
173
164
174
@abstractmethod
165
175
def is_suppressed (self ) -> bool :
166
- """Get the body suppression state."""
176
+ """Get the body suppression state.
177
+
178
+ Warnings
179
+ --------
180
+ This method is only available starting on Ansys release 25R2.
181
+ """
167
182
return
168
183
169
184
@abstractmethod
170
185
def set_suppressed (self , suppressed : bool ) -> None :
171
- """Set the body suppression state."""
186
+ """Set the body suppression state.
187
+
188
+ Warnings
189
+ --------
190
+ This method is only available starting on Ansys release 25R2.
191
+ """
172
192
return
173
193
174
194
@abstractmethod
@@ -182,14 +202,20 @@ def opacity(self) -> float:
182
202
return
183
203
184
204
@abstractmethod
185
- def set_color (self , color : str | tuple [float , float , float ]) -> None :
205
+ def set_color (
206
+ self , color : str | tuple [float , float , float ] | tuple [float , float , float , float ]
207
+ ) -> None :
186
208
"""Set the color of the body.
187
209
188
210
Parameters
189
211
----------
190
- color : str | tuple[float, float, float]
212
+ color : str | tuple[float, float, float] | tuple[float, float, float, float]
191
213
Color to set the body to. This can be a string representing a color name
192
214
or a tuple of RGB values in the range [0, 1] (RGBA) or [0, 255] (pure RGB).
215
+
216
+ Warnings
217
+ --------
218
+ This method is only available starting on Ansys release 25R1.
193
219
"""
194
220
return
195
221
@@ -272,6 +298,10 @@ def bounding_box(self) -> BoundingBox:
272
298
-------
273
299
BoundingBox
274
300
Bounding box of the body.
301
+
302
+ Warnings
303
+ --------
304
+ This method is only available starting on Ansys release 25R2.
275
305
"""
276
306
return
277
307
@@ -430,10 +460,6 @@ def translate(self, direction: UnitVector3D, distance: Quantity | Distance | Rea
430
460
Direction of the translation.
431
461
distance: ~pint.Quantity | Distance | Real
432
462
Distance (magnitude) of the translation.
433
-
434
- Returns
435
- -------
436
- None
437
463
"""
438
464
return
439
465
@@ -455,57 +481,63 @@ def rotate(
455
481
angle: ~pint.Quantity | Angle | Real
456
482
Angle (magnitude) of the rotation.
457
483
458
- Returns
459
- -------
460
- None
484
+ Warnings
485
+ --------
486
+ This method is only available starting on Ansys release 24R2.
461
487
"""
462
488
return
463
489
464
490
@abstractmethod
465
491
def scale (self , value : Real ) -> None :
466
492
"""Scale the geometry body by the given value.
467
493
494
+ The calling object is directly modified when this method is called.
495
+ Thus, it is important to make copies if needed.
496
+
468
497
Parameters
469
498
----------
470
499
value: Real
471
500
Value to scale the body by.
472
501
473
- Notes
474
- -----
475
- The calling object is directly modified when this method is called.
476
- Thus, it is important to make copies if needed.
502
+ Warnings
503
+ --------
504
+ This method is only available starting on Ansys release 24R2.
477
505
"""
478
506
return
479
507
480
508
@abstractmethod
481
509
def map (self , frame : Frame ) -> None :
482
510
"""Map the geometry body to the new specified frame.
483
511
512
+ The calling object is directly modified when this method is called.
513
+ Thus, it is important to make copies if needed.
514
+
484
515
Parameters
485
516
----------
486
517
frame: Frame
487
518
Structure defining the orientation of the body.
488
519
489
- Notes
490
- -----
491
- The calling object is directly modified when this method is called.
492
- Thus, it is important to make copies if needed.
520
+ Warnings
521
+ --------
522
+ This method is only available starting on Ansys release 24R2.
493
523
"""
494
524
return
495
525
496
526
@abstractmethod
497
527
def mirror (self , plane : Plane ) -> None :
498
528
"""Mirror the geometry body across the specified plane.
499
529
530
+ The calling object is directly modified when this method is called.
531
+ Thus, it is important to make copies if needed.
532
+
500
533
Parameters
501
534
----------
502
535
plane: Plane
503
536
Represents the mirror.
504
537
505
- Notes
506
- -----
507
- The calling object is directly modified when this method is called.
508
- Thus, it is important to make copies if needed.
538
+ Warnings
539
+ --------
540
+ This method is only available starting on Ansys release 24R2.
509
541
"""
510
542
return
511
543
@@ -522,6 +554,10 @@ def get_collision(self, body: "Body") -> CollisionType:
522
554
-------
523
555
CollisionType
524
556
Enum that defines the collision state between bodies.
557
+
558
+ Warnings
559
+ --------
560
+ This method is only available starting on Ansys release 24R2.
525
561
"""
526
562
return
527
563
@@ -615,6 +651,10 @@ def shell_body(self, offset: Real) -> bool:
615
651
-------
616
652
bool
617
653
``True`` when successful, ``False`` when failed.
654
+
655
+ Warnings
656
+ --------
657
+ This method is only available starting on Ansys release 25R2.
618
658
"""
619
659
return
620
660
@@ -633,6 +673,10 @@ def remove_faces(self, selection: Face | Iterable[Face], offset: Real) -> bool:
633
673
-------
634
674
bool
635
675
``True`` when successful, ``False`` when failed.
676
+
677
+ Warnings
678
+ --------
679
+ This method is only available starting on Ansys release 25R2.
636
680
"""
637
681
return
638
682
@@ -1097,16 +1141,14 @@ def set_fill_style( # noqa: D102
1097
1141
def set_suppressed ( # noqa: D102
1098
1142
self , suppressed : bool
1099
1143
) -> None :
1100
- """Set the body suppression state."""
1101
1144
self ._grpc_client .log .debug (f"Setting body { self .id } , as suppressed: { suppressed } ." )
1102
1145
self ._grpc_client .services .bodies .set_suppressed (bodies = [self .id ], is_suppressed = suppressed )
1103
1146
1104
1147
@check_input_types
1105
1148
@min_backend_version (25 , 1 , 0 )
1106
- def set_color (
1149
+ def set_color ( # noqa: D102
1107
1150
self , color : str | tuple [float , float , float ] | tuple [float , float , float , float ]
1108
1151
) -> None :
1109
- """Set the color of the body."""
1110
1152
self ._grpc_client .log .debug (f"Setting body color of { self .id } to { color } ." )
1111
1153
color = convert_color_to_hex (color )
1112
1154
self ._grpc_client .services .bodies .set_color (id = self .id , color = color )
@@ -1115,7 +1157,12 @@ def set_color(
1115
1157
@check_input_types
1116
1158
@min_backend_version (25 , 2 , 0 )
1117
1159
def set_opacity (self , opacity : float ) -> None :
1118
- """Set the opacity of the body."""
1160
+ """Set the opacity of the body.
1161
+
1162
+ Warnings
1163
+ --------
1164
+ This method is only available starting on Ansys release 25R2.
1165
+ """
1119
1166
self ._grpc_client .log .debug (f"Setting body opacity of { self .id } to { opacity } ." )
1120
1167
opacity = convert_opacity_to_hex (opacity )
1121
1168
new_color = self .color [0 :7 ] + opacity
@@ -1686,7 +1733,9 @@ def set_suppressed(self, suppressed: bool) -> None: # noqa: D102
1686
1733
return self ._template .set_suppressed (suppressed )
1687
1734
1688
1735
@ensure_design_is_active
1689
- def set_color (self , color : str | tuple [float , float , float ]) -> None : # noqa: D102
1736
+ def set_color ( # noqa: D102
1737
+ self , color : str | tuple [float , float , float ] | tuple [float , float , float , float ]
1738
+ ) -> None :
1690
1739
return self ._template .set_color (color )
1691
1740
1692
1741
@ensure_design_is_active
0 commit comments