4545)
4646from ansys .api .geometry .v0 .bodies_pb2_grpc import BodiesStub
4747from ansys .api .geometry .v0 .commands_pb2 import (
48- CreateBeamLineSegmentsRequest ,
48+ CreateBeamSegmentRequest ,
4949 CreateBeamSegmentsRequest ,
5050 CreateDesignPointsRequest ,
5151)
@@ -1191,6 +1191,7 @@ def __create_beams_legacy(self, segments: list[tuple[Point3D, Point3D]], profile
11911191 self ._beams .extend (new_beams )
11921192 return self ._beams [- n_beams :]
11931193
1194+ beams = []
11941195 def __create_beams (self , segments : list [tuple [Point3D , Point3D ]], profile : BeamProfile
11951196 ) -> list [Beam ]:
11961197 """Create beams under the component.
@@ -1207,31 +1208,31 @@ def __create_beams(self, segments: list[tuple[Point3D, Point3D]], profile: BeamP
12071208 list[Beam]
12081209 A list of the created Beams.
12091210 """
1210- request = CreateBeamLineSegmentsRequest (
1211- profile = profile .id ,
1212- parent = self .id ,
1213- )
1214-
12151211 for segment in segments :
1216- request .lines .append (
1217- Line (start = point3d_to_grpc_point (segment [0 ]), end = point3d_to_grpc_point (segment [1 ]))
1212+ request = CreateBeamSegmentRequest (
1213+ profile = profile .id ,
1214+ parent = self .id ,
12181215 )
12191216
1220- self ._grpc_client .log .debug (f"Creating beams on { self .id } ..." )
1221- response = self ._commands_stub .CreateBeamSegments (request )
1222- self ._grpc_client .log .debug ("Beams successfully created." )
1217+ for segment in segments :
1218+ request .lines .append (
1219+ Line (start = point3d_to_grpc_point (segment [0 ]), end = point3d_to_grpc_point (segment [1 ]))
1220+ )
12231221
1224- beams = []
1225- for beam in response .created_beams :
1226- beams .append (
1227- Beam (
1228- id = beam .id ,
1229- start = ,
1230- end = ,
1231- profile = profile ,
1232- parent_component = self ,
1222+ self ._grpc_client .log .debug (f"Creating beams on { self .id } ..." )
1223+ response = self ._commands_stub .CreateBeamSegments (request )
1224+ self ._grpc_client .log .debug ("Beams successfully created." )
1225+
1226+ for beam in response .created_beams :
1227+ beams .append (
1228+ Beam (
1229+ id = beam .id ,
1230+ start = ,
1231+ end = ,
1232+ profile = profile ,
1233+ parent_component = self ,
1234+ )
12331235 )
1234- )
12351236
12361237 return beams
12371238
0 commit comments