Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Import shapes from file fails on objects with the same name #652

@vockleya

Description

@vockleya

I've got my install of FreeCAD set up with the "allow duplicate object labels in one document" setting enabled. When using the "add shapes from external file" function, it fails if the selected file contains multiple objects with the same label. I'm doing this with objects split up into multiple nested part container objects, but simple primitives from the Part workbench have the same effect. The stack trace below shows up in the report view when trying to do this.

13:15:33  Running the Python command 'a2p_ImportShapeReferenceCommand' failed:
Traceback (most recent call last):
  File "/Users/aaron/Library/Application Support/FreeCAD/Mod/A2plus/./a2p_importpart.py", line 549, in Activated
    dialog = a2p_multiShapeExtractDialog(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aaron/Library/Application Support/FreeCAD/Mod/A2plus/./a2p_importpart.py", line 105, in __init__
    self.initUI()
  File "/Users/aaron/Library/Application Support/FreeCAD/Mod/A2plus/./a2p_importpart.py", line 111, in initUI
    lzip = sorted(zip(self.labelList, self.iconList))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

'<' not supported between instances of 'PySide2.QtGui.QIcon' and 'PySide2.QtGui.QIcon'

Steps to reproduce:

  1. create a new file
  2. add 2 cubes from Part workbench
  3. change label of second cube to match the first
  4. save file
  5. create a second new file
  6. click "add shapes..." button
  7. choose first file

Please let me know if there is any more information that I can provide that might be helpful.

OS: macOS 15.5
Architecture: arm64
Version: 1.0.1.39285 (Git) Conda
Build type: Release
Branch: (HEAD detached at 1.0.1)
Hash: 878f0b8c9c72c6f215833a99f2762bc3a3cf2abd
Python 3.11.12, Qt 5.15.15, Coin 4.0.3, Vtk 9.3.0, OCC 7.8.1
Locale: C/Default (C)
Stylesheet/Theme/QtStyle: FreeCAD Dark.qss/FreeCAD Dark/Fusion
Installed mods:

  • A2plus 0.4.68

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions