From 8aa75ddcee91ec9295a7e5639bff0e6d33ad39d0 Mon Sep 17 00:00:00 2001 From: Dominik Gresch Date: Thu, 28 Nov 2024 10:02:47 +0100 Subject: [PATCH] Add 'analysis_plies' property to solid model Add a read-only 'analysis_plies' collection to the solid model. This collection contains only the AnalysisPly objects, the InterfaceLayer objects are not included. Partially addresses #711. --- examples/modeling_features/020-solid_model.py | 7 +------ src/ansys/acp/core/_tree_objects/solid_model.py | 6 ++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/modeling_features/020-solid_model.py b/examples/modeling_features/020-solid_model.py index 9a62941a45..1224b323ee 100644 --- a/examples/modeling_features/020-solid_model.py +++ b/examples/modeling_features/020-solid_model.py @@ -189,12 +189,7 @@ def plot_model_with_geometry(cad_geometry: CADGeometry, cad_geom_opacity: float # %% # Get the analysis ply of interest -ap = ( - model.modeling_groups["modeling_group"] - .modeling_plies["ply"] - .production_plies["ProductionPly.2"] - .analysis_plies["P2L1__ply"] -) +ap = solid_model.analysis_plies["P2L1__ply"] # %% # Plot fiber directions diff --git a/src/ansys/acp/core/_tree_objects/solid_model.py b/src/ansys/acp/core/_tree_objects/solid_model.py index 3e279efe4f..7b106ec93a 100644 --- a/src/ansys/acp/core/_tree_objects/solid_model.py +++ b/src/ansys/acp/core/_tree_objects/solid_model.py @@ -27,6 +27,7 @@ from typing import Any from ansys.api.acp.v0 import ( + analysis_ply_pb2_grpc, cut_off_geometry_pb2_grpc, extrusion_guide_pb2_grpc, snap_to_geometry_pb2_grpc, @@ -59,6 +60,7 @@ mark_grpc_properties, ) from ._solid_model_export import SolidModelExportMixin +from .analysis_ply import AnalysisPly from .base import ( CreatableTreeObject, IdTreeObject, @@ -525,5 +527,9 @@ def _create_stub(self) -> solid_model_pb2_grpc.ObjectServiceStub: CutOffGeometry, cut_off_geometry_pb2_grpc.ObjectServiceStub ) + analysis_plies = get_read_only_collection_property( + AnalysisPly, analysis_ply_pb2_grpc.ObjectServiceStub + ) + elemental_data = elemental_data_property(SolidModelElementalData) nodal_data = nodal_data_property(SolidModelNodalData)