@@ -161,12 +161,25 @@ def _get_color(self, shape_id: str | int) -> str:
161
161
return "#808080"
162
162
163
163
def remove (self , name : str ) -> CadDocument :
164
+ """
165
+ Remove an object from the document.
166
+
167
+ :param name: The name of the object to remove.
168
+ :return: The document itself.
169
+ """
164
170
index = self ._get_yobject_index_by_name (name )
165
171
if self ._objects_array and index != - 1 :
166
172
self ._objects_array .pop (index )
167
173
return self
168
174
169
175
def rename (self , old_name : str , new_name : str ) -> CadDocument :
176
+ """
177
+ Rename an object in the document.
178
+
179
+ :param old_name: The current name of the object.
180
+ :param new_name: The new name for the object.
181
+ :return: The document itself.
182
+ """
170
183
if new_name == old_name :
171
184
return self
172
185
new_obj = self .get_object (old_name )
@@ -779,6 +792,12 @@ def _get_boolean_operands(self, shape1: str | int | None, shape2: str | int | No
779
792
return shape1 , shape2
780
793
781
794
def set_visible (self , name : str , value ):
795
+ """
796
+ Set the visibility of an object.
797
+
798
+ :param name: The name of the object.
799
+ :param value: The visibility value (True or False).
800
+ """
782
801
obj : Optional [Map ] = self ._get_yobject_by_name (name )
783
802
784
803
if obj is None :
@@ -787,6 +806,12 @@ def set_visible(self, name: str, value):
787
806
obj ["visible" ] = value
788
807
789
808
def set_color (self , name : str , value : str ):
809
+ """
810
+ Set the color of an object.
811
+
812
+ :param name: The name of the object.
813
+ :param value: The color in hex format (e.g., "#FF5733").
814
+ """
790
815
obj : Optional [Map ] = self ._get_yobject_by_name (name )
791
816
792
817
if obj is None :
0 commit comments