|
88 | 88 | from ansys.geometry.core.math.plane import Plane |
89 | 89 | from ansys.geometry.core.math.point import Point3D |
90 | 90 | from ansys.geometry.core.math.vector import UnitVector3D, Vector3D |
91 | | -from ansys.geometry.core.misc.auxiliary import ( |
92 | | - get_beams_from_ids, |
93 | | - get_bodies_from_ids, |
94 | | - get_edges_from_ids, |
95 | | - get_faces_from_ids, |
96 | | -) |
97 | 91 | from ansys.geometry.core.misc.checks import ensure_design_is_active, min_backend_version |
98 | 92 | from ansys.geometry.core.misc.measurements import DEFAULT_UNITS, Distance |
99 | 93 | from ansys.geometry.core.misc.options import ImportOptions |
@@ -687,6 +681,7 @@ def create_named_selection( |
687 | 681 | """ |
688 | 682 | named_selection = NamedSelection( |
689 | 683 | name, |
| 684 | + self, |
690 | 685 | self._grpc_client, |
691 | 686 | bodies=bodies, |
692 | 687 | faces=faces, |
@@ -1214,29 +1209,11 @@ def __read_existing_design(self) -> None: |
1214 | 1209 |
|
1215 | 1210 | # Create NamedSelections |
1216 | 1211 | for ns in response.named_selections: |
1217 | | - result = self._named_selections_stub.Get(EntityIdentifier(id=ns.id)) |
1218 | | - |
1219 | | - # This works but is slow -- can use improvement for designs with many named selections |
1220 | | - bodies = get_bodies_from_ids(self, [body.id for body in result.bodies]) |
1221 | | - faces = get_faces_from_ids(self, [face.id for face in result.faces]) |
1222 | | - edges = get_edges_from_ids(self, [edge.id for edge in result.edges]) |
1223 | | - beams = get_beams_from_ids(self, [beam.id.id for beam in result.beams]) |
1224 | | - |
1225 | | - design_points = [] |
1226 | | - for dp in result.design_points: |
1227 | | - design_points.append( |
1228 | | - DesignPoint(dp.id, "dp: " + dp.id, grpc_point_to_point3d(dp.points[0]), self) |
1229 | | - ) |
1230 | | - |
1231 | 1212 | new_ns = NamedSelection( |
1232 | 1213 | ns.name, |
| 1214 | + self, |
1233 | 1215 | self._grpc_client, |
1234 | 1216 | preexisting_id=ns.id, |
1235 | | - bodies=bodies, |
1236 | | - faces=faces, |
1237 | | - edges=edges, |
1238 | | - beams=beams, |
1239 | | - design_points=design_points, |
1240 | 1217 | ) |
1241 | 1218 | self._named_selections[new_ns.name] = new_ns |
1242 | 1219 |
|
|
0 commit comments