ansys / ansys/pyacp

Cannot Import mesh into Mechanical

Open
#819 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
9
Forks
1
Avg merge
2d 9h
Merged PRs (30d)
10

Description

### 🔍 Before submitting the issue

- [x] I have searched among the existing issues
- [x] I am using a Python virtual environment

### 🐞 Description of the bug

Dear all,

I could create the composite layer structure on my shell in PyACP but when I'm trying to Import the final mesh with the composite properties into Mechanical it gives me this error:

![Image](https://github.com/user-attachments/assets/b8152b23-0d51-4cd4-a204-db5bf4b1cf37)

I have checked my working folder, and everything was sucsessfully exported (.cdb, .h5, .mat). The example I am using is from the website (From title: Import mesh, materials and plies into Mechanical):
https://acp.docs.pyansys.com/version/stable/examples/workflows/06-cdb-to-pymechanical-workflow.html

and my modell is this:

![Image](https://github.com/user-attachments/assets/12123d13-4533-46be-be0e-19f7639e1742)

Please let me know if you have any idea how to solve this.

Thanks in advance.

### 📝 Steps to reproduce

pyacp.mechanical_integration_helpers.import_acp_mesh_from_cdb(
mechanical=mechanical, cdb_path=working_dir_path / cdb_filename
)

### 💻 Which operating system are you using?

Windows

### 📀 Which ANSYS version are you using?

24R2

### 🐍 Which Python version are you using?

3.9

### 📦 Installed packages

```shell
_MultiThreadedRendezvous Traceback (most recent call last)
Cell In[19], line 1
----> 1 pyacp.mechanical_integration_helpers.import_acp_mesh_from_cdb(
2 mechanical=mechanical, cdb_path=working_dir_path / cdb_filename
3 )

File c:\AppData\Local\Programs\Python\Python312\Lib\site-packages\ansys\acp\core\mechanical_integration_helpers.py:94, in import_acp_mesh_from_cdb(mechanical, cdb_path)
91 raise ValueError(f"The CDB file extension must be '.cdb', not '{cdb_path.suffix}'.")
92 cdb_path_str = str(cdb_path)
---> 94 mechanical.run_python_script(
95 textwrap.dedent(
96 f"""\
97 initial_geometry_ids = {{obj.ObjectId for obj in Model.Geometry.Children}}
98
99 model_import = Model.AddGeometryImportGroup().AddModelImport()
100 model_import.ModelImportSourceFilePath = {cdb_path_str!r}
101 model_import.ProcessValidBlockedCDBFile = False
102 model_import.ProcessModelData = False
103 model_import.Import()
104
105 final_geometry_ids = {{obj.ObjectId for obj in Model.Geometry.Children}}
106 new_geometry_ids = final_geometry_ids - initial_geometry_ids
107 if len(new_geometry_ids) != 1:
108 raise ValueError("Expected 1 new geometry object, but found {{}}.".format(len(new_geometry_ids)))
...
_MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.UNKNOWN
details = "Expected 1 new geometry object, but found 3."
debug_error_string = "UNKNOWN:Error received from peer {grpc_message:"Expected 1 new geometry object, but found 3.", grpc_status:2, created_time:"2025-04-16T10:30:26.2652229+00:00"}"
```

Contributor guide

Open the contributing guide

Research direction

Start with ansys/acp/core/mechanical_integration_helpers.py around import_acp_mesh_from_cdb(), then reproduce the linked Import mesh, materials and plies into Mechanical workflow on Windows with the reported ANSYS and Python versions. Investigate why the import reports three new geometry objects instead of one; done means the cause and expected import behavior are established, with a regression check or clear documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.