Skip to content

Cannot Import mesh into Mechanical #819

@szilveszter31

Description

@szilveszter31

🔍 Before submitting the issue

  • I have searched among the existing issues
  • 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

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

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

_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"}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions