ansys / ansys/pymechanical

[EMBEDDED] ``Model.DeleteParts(geo_part_list)`` giving error

Open
#1,047 1 comment 0 reactions 0 assignees View on GitHub
ansys-mechanical-bug
Dominant language
Python
Stars
83
Forks
37
Avg merge
1d 3m
Merged PRs (30d)
26

Description

This behavior is seen only in embedding but no issues with batch mode or with Mechanical scripting window.
To replicate this after importing a geomtry

```
part_id_list = [3,7]
geo_part_list = [ExtAPI.DataModel.GeoData.GeoPartById(id) for id in part_id_list]
Model.DeleteParts(geo_part_list)
```
```
CRITICAL - - logging - handle_exception - Uncaught exception
Traceback (most recent call last):
File "C:\Users\dkunhamb\Downloads\K18_Board (1)\K18_Board\pymech.py", line 21, in
Model.DeleteParts(geo_part_list)
System.ArgumentException: Argument must be an `IGeoPart` or collection!
Parameter name: parts
at Ansys.ACT.Automation.Mechanical.Model.DeleteParts(Object parts)
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the snippet in pymech.py with the embedded execution path, then compare it with batch mode and the Mechanical scripting window. Investigate the Model.DeleteParts(geo_part_list) entry point and the reported IGeoPart collection exception; done means the same imported parts can be deleted successfully when embedded.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.