View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0003381 | Part | Bug | public | 2018-03-20 16:13 | 2018-05-28 14:58 |
| Reporter | ker | Assigned To | |||
| Priority | normal | Severity | tweak | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | Virtual machine | OS | Ubuntu 14.04.5 LTS | OS Version | 14.04.5 LTS |
| Product Version | 0.17 | ||||
| Fixed in Version | 0.18 | ||||
| Summary | 0003381: CompoundFilter do not work in command line | ||||
| Description | 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) Described in Developers corner (after my post is accepted by an admin). | ||||
| Steps To Reproduce | Run the attached macro in command line. | ||||
| Tags | App::Part | ||||
| FreeCAD Information | |||||
|
|
CompoundFilter_bug_example.FCMacro (1,169 bytes)
# Open new document
doc = App.newDocument("Beams")
#
# Generate geometry in Part module
import Part
beam_obj1 = doc.addObject('Part::Box', 'Beam1')
beam_obj1.Height = beam_obj1.Width = 10
beam_obj1.Length = 40
beam_obj2 = doc.addObject('Part::Box', 'Beam2')
beam_obj2.Height = beam_obj2.Width = 10
beam_obj2.Length = 30
beam_obj2.Placement.Base = FreeCAD.Vector(40,0,0)
# Combine the geometric objects to Compsolid
import BOPTools.SplitFeatures
beam_comp_obj = BOPTools.SplitFeatures.makeBooleanFragments(name= 'Beam_Compsolid')
beam_comp_obj.Objects = [beam_obj1,beam_obj2]
beam_comp_obj.Mode = "CompSolid"
beam_comp_obj.Proxy.execute(beam_comp_obj)
beam_comp_obj.purgeTouched()
#Generate a CompoundFilter from the Compsolid
import CompoundTools.CompoundFilter
beam_obj = CompoundTools.CompoundFilter.makeCompoundFilter(name = 'Beam')
beam_obj.Base = beam_comp_obj
beam_obj.FilterType = 'window-volume' #???
beam_obj.Proxy.execute(beam_obj) #???
App.ActiveDocument.recompute()
# If GUI available, see how our part looks like
if FreeCAD.GuiUp:
import FreeCADGui
FreeCADGui.ActiveDocument.activeView().viewAxonometric()
FreeCADGui.SendMsgToActiveView("ViewFit") |
|
|
https://forum.freecadweb.org/viewtopic.php?f=10&t=27593 |
|
|
https://github.com/FreeCAD/FreeCAD/commit/6781a8167fbe7a2fc508f60f85e34fddfc155927 |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2018-03-20 16:13 | ker | New Issue | |
| 2018-03-20 16:13 | ker | File Added: CompoundFilter_bug_example.FCMacro | |
| 2018-03-20 16:13 | ker | Tag Attached: App::Part | |
| 2018-03-21 16:19 | ker | Note Added: 0011050 | |
| 2018-05-28 14:58 | wmayer | Status | new => closed |
| 2018-05-28 14:58 | wmayer | Resolution | open => fixed |
| 2018-05-28 14:58 | wmayer | Fixed in Version | => 0.18 |
| 2018-05-28 14:58 | wmayer | Note Added: 0011290 |
FreeCAD