@@ -132,7 +132,7 @@ def __init__(
132
132
CreateRequest (name = name , parent = parent_component .id , template = template_id )
133
133
)
134
134
# Remove this method call once we know Service sends correct ObjectPath id
135
- self ._id = self . __remove_duplicate_ids ( new_component .component .id )
135
+ self ._id = new_component .component .id
136
136
self ._name = new_component .component .name
137
137
else :
138
138
self ._name = name
@@ -246,26 +246,6 @@ def __create_children(self, template: "Component") -> None:
246
246
)
247
247
self .components .append (new )
248
248
249
- def __remove_duplicate_ids (self , path : str ) -> str :
250
- """
251
- Remove duplicate entries in the ID path.
252
-
253
- Notes
254
- -----
255
- This is a safeguard, as the server is known to have issues sometimes.
256
-
257
- Examples
258
- --------
259
- This method converts "0:26/0:44/0:44/0:53" to "0:26/0:44/0:53".
260
- """
261
- # Split the string into a list -> convert list into a set but maintain order
262
- res = []
263
- [res .append (x ) for x in path .split ("/" ) if x not in res ]
264
- id = "/" .join (res )
265
- if id != path :
266
- print ("Removed duplicate!" )
267
- return id
268
-
269
249
def get_world_transform (self ) -> Matrix44 :
270
250
"""
271
251
Get the full transformation matrix of this Component in world space.
@@ -423,9 +403,7 @@ def extrude_sketch(
423
403
response = self ._bodies_stub .CreateExtrudedBody (request )
424
404
tb = TemplateBody (response .master_id , name , self ._grpc_client , is_surface = False )
425
405
self ._transformed_part .part .bodies .append (tb )
426
- # TODO: fix when DMS ObjectPath is fixed - previously we return the body with response.id
427
- body_id = f"{ self .id } /{ tb .id } " if self .parent_component else tb .id
428
- return Body (body_id , response .name , self , tb )
406
+ return Body (response .id , response .name , self , tb )
429
407
430
408
@protect_grpc
431
409
@check_input_types
@@ -472,9 +450,7 @@ def extrude_face(self, name: str, face: Face, distance: Union[Quantity, Distance
472
450
473
451
tb = TemplateBody (response .master_id , name , self ._grpc_client , is_surface = False )
474
452
self ._transformed_part .part .bodies .append (tb )
475
- # TODO: fix when DMS ObjectPath is fixed - previously we return the body with response.id
476
- body_id = f"{ self .id } /{ tb .id } " if self .parent_component else tb .id
477
- return Body (body_id , response .name , self , tb )
453
+ return Body (response .id , response .name , self , tb )
478
454
479
455
@protect_grpc
480
456
@check_input_types
@@ -511,9 +487,7 @@ def create_surface(self, name: str, sketch: Sketch) -> Body:
511
487
512
488
tb = TemplateBody (response .master_id , name , self ._grpc_client , is_surface = True )
513
489
self ._transformed_part .part .bodies .append (tb )
514
- # TODO: fix when DMS ObjectPath is fixed - previously we return the body with response.id
515
- body_id = f"{ self .id } /{ tb .id } " if self .parent_component else tb .id
516
- return Body (body_id , response .name , self , tb )
490
+ return Body (response .id , response .name , self , tb )
517
491
518
492
@protect_grpc
519
493
@check_input_types
@@ -553,9 +527,7 @@ def create_surface_from_face(self, name: str, face: Face) -> Body:
553
527
554
528
tb = TemplateBody (response .master_id , name , self ._grpc_client , is_surface = True )
555
529
self ._transformed_part .part .bodies .append (tb )
556
- # TODO: fix when DMS ObjectPath is fixed - previously we return the body with response.id
557
- body_id = f"{ self .id } /{ tb .id } " if self .parent_component else tb .id
558
- return Body (body_id , response .name , self , tb )
530
+ return Body (response .id , response .name , self , tb )
559
531
560
532
@check_input_types
561
533
def create_coordinate_system (self , name : str , frame : Frame ) -> CoordinateSystem :
0 commit comments