I would like to delete all the passives from a STEP exported by KiCAD. How do I go about doing this?
I started with this code:
Code: Select all
doc = FreeCAD.ActiveDocument
for obj in FreeCAD.ActiveDocument.Objects:
if "R_0402" in obj.Name:
doc.removeObject(obj.Name)
if "C_0603" in obj.Name:
doc.removeObject(obj.Name)
Code: Select all
<class 'ReferenceError'>: Cannot access attribute 'Name' of deleted object
Code: Select all
OS: Ubuntu 20.04.4 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.
Build type: Release
Branch: unknown
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, Vtk 7.1.1, OCC 7.5.2
Locale: English/United States (en_US)
Installed mods:
* Assembly4 0.12.0
* fasteners 0.3.44
* sheetmetal 0.2.49
* Defeaturing
* Lithophane
* Curves 0.4.4
* Behave-Dark-Colors 0.0.1
* Assembly3 0.11.3
* kicadStepUpMod 10.13.0
* PieMenu
* ProDarkThemePreferencePack 1.0.0