@@ -125,6 +125,8 @@ def create_circular_pattern(self, **kwargs) -> dict: # noqa: D102
125125
126126 from ansys .geometry .core .shapes .curves .line import Line
127127
128+ from .conversions import from_line_to_grpc_line , from_unit_vector_to_grpc_direction
129+
128130 # Create direction if not None
129131 radial_direction = (
130132 from_unit_vector_to_grpc_direction (kwargs ["radial_direction" ])
@@ -152,68 +154,84 @@ def create_circular_pattern(self, **kwargs) -> dict: # noqa: D102
152154 CircularPatternCreationRequestData (
153155 selection_ids = [build_grpc_id (id ) for id in kwargs ["selection_ids" ]],
154156 circular_count = kwargs ["circular_count" ],
155- circular_axis = circular_axis ,
157+ edge_axis_id = circular_axis ,
156158 circular_angle = from_angle_to_grpc_quantity (kwargs ["circular_angle" ]),
157159 two_dimensional = kwargs ["two_dimensional" ],
158160 linear_count = kwargs ["linear_count" ],
159- linear_pitch = linear_pitch ,
161+ linear_pitch = from_length_to_grpc_quantity ( linear_pitch ) ,
160162 radial_direction = radial_direction ,
161- axis = axis ,
163+ line_axis = axis ,
162164 )
163165 ]
164166 )
165167
166168 # Call the gRPC service
167- response = self .stub .CreateCircularPattern (request )
169+ response = self .stub .CreateCircular (request )
168170
169171 # Return the response - formatted as a dictionary
170172 return {
171- "success" : response .result .success ,
173+ "success" : response .tracked_creation_response . creation_response .success ,
172174 }
173175
174176 @protect_grpc
175177 def modify_circular_pattern (self , ** kwargs ) -> dict : # noqa: D102
178+ from ansys .api .discovery .v1 .design .relationships .pattern_pb2 import (
179+ SetCircularPatternDataRequest ,
180+ SetCircularPatternDataRequestData ,
181+ )
182+
176183 # Create the request - assumes all inputs are valid and of the proper type
177- request = ModifyCircularPatternRequest (
178- selection = [build_grpc_id (id ) for id in kwargs ["selection_ids" ]],
179- circular_count = kwargs ["circular_count" ],
180- linear_count = kwargs ["linear_count" ],
181- step_angle = from_angle_to_grpc_quantity (kwargs ["step_angle" ]),
182- step_linear = from_angle_to_grpc_quantity (kwargs ["step_linear" ]),
184+ request = SetCircularPatternDataRequest (
185+ request_data = [
186+ SetCircularPatternDataRequestData (
187+ selection_ids = [build_grpc_id (id ) for id in kwargs ["selection_ids" ]],
188+ circular_count = kwargs ["circular_count" ],
189+ linear_count = kwargs ["linear_count" ],
190+ step_angle = from_angle_to_grpc_quantity (kwargs ["step_angle" ]),
191+ step_linear = from_angle_to_grpc_quantity (kwargs ["step_linear" ]),
192+ )
193+ ]
183194 )
184195
185196 # Call the gRPC service
186- response = self .stub .ModifyCircularPattern (request )
197+ response = self .stub .SetCircularData (request )
187198
188199 # Return the response - formatted as a dictionary
189200 return {
190- "success" : response .result .success ,
201+ "success" : response .tracked_set_response . set_response .success ,
191202 }
192203
193204 @protect_grpc
194205 def create_fill_pattern (self , ** kwargs ) -> dict : # noqa: D102
195- from ansys .api .geometry .v0 .commands_pb2 import CreateFillPatternRequest
206+ from ansys .api .discovery .v1 .design .relationships .pattern_pb2 import (
207+ FillPatternCreationRequest ,
208+ FillPatternCreationRequestData ,
209+ )
196210
197211 # Create the request - assumes all inputs are valid and of the proper type
198- request = CreateFillPatternRequest (
199- selection = [build_grpc_id (id ) for id in kwargs ["selection_ids" ]],
200- linear_direction = build_grpc_id (kwargs ["linear_direction_id" ]),
201- fill_pattern_type = kwargs ["fill_pattern_type" ].value ,
202- margin = from_length_to_grpc_quantity (kwargs ["margin" ]),
203- x_spacing = from_length_to_grpc_quantity (kwargs ["x_spacing" ]),
204- y_spacing = from_length_to_grpc_quantity (kwargs ["y_spacing" ]),
205- row_x_offset = from_length_to_grpc_quantity (kwargs ["row_x_offset" ]),
206- row_y_offset = from_length_to_grpc_quantity (kwargs ["row_y_offset" ]),
207- column_x_offset = from_length_to_grpc_quantity (kwargs ["column_x_offset" ]),
208- column_y_offset = from_length_to_grpc_quantity (kwargs ["column_y_offset" ]),
212+ request = FillPatternCreationRequest (
213+ request_data = [
214+ FillPatternCreationRequestData (
215+ selection_ids = [build_grpc_id (id ) for id in kwargs ["selection_ids" ]],
216+ linear_direction_id = build_grpc_id (kwargs ["linear_direction_id" ]),
217+ fill_pattern_type = kwargs ["fill_pattern_type" ].value ,
218+ margin = from_length_to_grpc_quantity (kwargs ["margin" ]),
219+ x_spacing = from_length_to_grpc_quantity (kwargs ["x_spacing" ]),
220+ y_spacing = from_length_to_grpc_quantity (kwargs ["y_spacing" ]),
221+ row_x_offset = from_length_to_grpc_quantity (kwargs ["row_x_offset" ]),
222+ row_y_offset = from_length_to_grpc_quantity (kwargs ["row_y_offset" ]),
223+ column_x_offset = from_length_to_grpc_quantity (kwargs ["column_x_offset" ]),
224+ column_y_offset = from_length_to_grpc_quantity (kwargs ["column_y_offset" ]),
225+ )
226+ ]
209227 )
210228
211229 # Call the gRPC service
212- response = self .stub .CreateFillPattern (request )
230+ response = self .stub .CreateFill (request )
213231
214232 # Return the response - formatted as a dictionary
215233 return {
216- "success" : response .result .success ,
234+ "success" : response .tracked_creation_response . creation_response .success ,
217235 }
218236
219237 @protect_grpc
@@ -226,10 +244,10 @@ def update_fill_pattern(self, **kwargs) -> dict: # noqa: D102
226244 )
227245
228246 # Call the gRPC service
229- response = self .stub .UpdateFillPattern (request )
247+ response = self .stub .UpdateFill (request )
230248
231249 # Return the response - formatted as a dictionary
232250 return {
233- "success" : response .result .success ,
251+ "success" : response .tracked_command_response . command_response .success ,
234252 }
235253
0 commit comments