[SOLVED] Bug report: CompoundFilter in command line

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
ker
Posts: 3
Joined: Mon Mar 19, 2018 4:09 pm

[SOLVED] Bug report: CompoundFilter in command line

Post by ker »

Hi all,

CompoundFilter does not work in Python script in non-GUI-mode.

The attached macro works OK running in the GUI, but when run with:
FreeCADCmd CompoundFilter_bug_example.FCMacro
in command line, it gives error:
Exception while processing file: CompoundFilter_bug_example.FCMacro ['NoneType' object has no attribute 'Proxy']

The problem is in the file Mod/Part/CompoundTools/CompoundFilter.py, in line 47.
After replacing that line with
------
if obj.ViewObject:
_ViewProviderCompoundFilter(obj.ViewObject)
------
the code works OK in command line, too. Maybe the correction is bad, bus still works.

My installation:
OS: Ubuntu 14.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13407 (Git)
Build type: Release
Branch: master
Hash: 2c2d781aa686b731f2a0e754dc30ebb76f3553e0
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)

Best regards,
Janne Keränen
Attachments
CompoundFilter_bug_example.FCMacro
(1.14 KiB) Downloaded 48 times
Last edited by ker on Fri Jun 01, 2018 1:29 pm, edited 1 time in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bug report: CompoundFilter in command line

Post by Kunda1 »

ker wrote: Tue Mar 20, 2018 4:09 pm
Can you test with the most up to date 0.17 revision ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Bug report: CompoundFilter in command line

Post by DeepSOIC »

Seems like a good fix to me =)
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bug report: CompoundFilter in command line

Post by Kunda1 »

OP opened a ticket for this: issue #3381
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
ker
Posts: 3
Joined: Mon Mar 19, 2018 4:09 pm

Re: Bug report: CompoundFilter in command line

Post by ker »

This bug still exists. Made a pull request today: https://github.com/FreeCAD/FreeCAD/pull/1477
Hopefully made it in the right way...
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bug report: CompoundFilter in command line

Post by Kunda1 »

PR was merged. Thank you. Please mark thread as [Solved]
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply