Skip to content

Import a FCStd file with a built-in assembly object #658

@nodtem66

Description

@nodtem66

A2Plus failed to import the FCStd file that contains assembly object. I've attached the test file here:
Test_exclude_assembly.FCStd.txt

This is the error found in the report panel:

Running the Python command 'a2p_ImportPart' failed:
Traceback (most recent call last):
  File "C:\Users\User\AppData\Roaming\FreeCAD\v1-1\Mod\A2plus\.\a2p_importpart.py", line 725, in Activated
    importedObject = importPartFromFile(doc, filename)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Roaming\FreeCAD\v1-1\Mod\A2plus\.\a2p_importpart.py", line 372, in importPartFromFile
    topoMapper.createTopoNames()
  File "C:\Users\User\AppData\Roaming\FreeCAD\v1-1\Mod\A2plus\.\a2p_topomapper.py", line 640, in createTopoNames
    shapeCol = ob.Color
               ^^^^^^^^

'App.DocumentObject' object has no attribute 'Color'

Step to reproduce

  • A2Plus > Add a part from external file (a2p_ImportPart)
  • Select Test_exclude_assembly.FCStd

Expected

A2Plus should exclude the assembly objects during the import process.

Current status

  • Patched a2plib.filterShapeObs to exlude the object with TypeId Assembly::*
  • I'm preparing the PR for this issue

Envs

OS: Windows 11 build 26200
Architecture: x86_64
Version: 1.1.0.20260325 (Git shallow)
Build date: 2026/03/25 02:17:53
Build type: Release
Branch: (HEAD detached at 34a971666)
Hash: 34a9716668b1ddeb55b914f1c5be644826bdbbbf
Python 3.11.15, Qt 6.8.3, Coin 4.0.3, Vtk 9.3.1, boost 1_86, Eigen3 3.4.0, PySide 6.8.3
shiboken 6.8.3, xerces-c 3.3.0, IfcOpenShell 0.8.4, OCC 7.8.1
Locale: English/Europe (en_150)
Navigation Style/Orbit Style/Rotation Mode: Blender/Trackball/Drag at cursor
Stylesheet/Theme/QtStyle: OpenDark.qss/OpenDark/
Logical DPI/Physical DPI/Pixel Ratio: 96/94.1104/1
Installed mods:

  • A2plus 0.4.68
  • fasteners 0.5.50
  • fasteners-backup-before-zip-migration 0.5.44 (Disabled)
  • OpenTheme 2025.5.20

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