@@ -109,12 +109,25 @@ def _get_color(self, shape_id: str | int) -> str:
109
109
return "#808080"
110
110
111
111
def remove (self , name : str ) -> CadDocument :
112
+ """
113
+ Remove an object from the document.
114
+
115
+ :param name: The name of the object to remove.
116
+ :return: The document itself.
117
+ """
112
118
index = self ._get_yobject_index_by_name (name )
113
119
if self ._objects_array and index != - 1 :
114
120
self ._objects_array .pop (index )
115
121
return self
116
122
117
123
def rename (self , old_name : str , new_name : str ) -> CadDocument :
124
+ """
125
+ Rename an object in the document.
126
+
127
+ :param old_name: The current name of the object.
128
+ :param new_name: The new name for the object.
129
+ :return: The document itself.
130
+ """
118
131
if new_name == old_name :
119
132
return self
120
133
new_obj = self .get_object (old_name )
@@ -727,6 +740,12 @@ def _get_boolean_operands(self, shape1: str | int | None, shape2: str | int | No
727
740
return shape1 , shape2
728
741
729
742
def set_visible (self , name : str , value ):
743
+ """
744
+ Set the visibility of an object.
745
+
746
+ :param name: The name of the object.
747
+ :param value: The visibility value (True or False).
748
+ """
730
749
obj : Optional [Map ] = self ._get_yobject_by_name (name )
731
750
732
751
if obj is None :
@@ -735,6 +754,12 @@ def set_visible(self, name: str, value):
735
754
obj ["visible" ] = value
736
755
737
756
def set_color (self , name : str , value : str ):
757
+ """
758
+ Set the color of an object.
759
+
760
+ :param name: The name of the object.
761
+ :param value: The color in hex format (e.g., "#FF5733").
762
+ """
738
763
obj : Optional [Map ] = self ._get_yobject_by_name (name )
739
764
740
765
if obj is None :
0 commit comments