View Issue Details

IDProjectCategoryView StatusLast Update
0002276FreeCADFeaturepublic2016-01-19 02:06
Reporterhamish2014 Assigned Toyorik  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
PlatformLinux x86_64OSUbuntuOS Version14.04 LTS
Fixed in Version0.16 
Summary0002276: Drawing::PythonFeatureView
DescriptionHi,

Would it be possible to either:

a) add a Drawing::PythonFeatureView, which would be an extension of the Drawing::FeatureView base class,
with support for adding properties and using proxies, or

b) modify FreeCAD_sf_master/src/Mod/Drawing/App/FeaturePage.cpp: App::DocumentObjectExecReturn:
 to load contents from ViewResult property from objects in the pages group (relax the isDerivedFrom(Drawing::FeatureView::getClassTypeId() restriction)

?

Either of these changes would greatly facilitate the development parametric functionality in the drawing dimensioning workbench.

Thanks!
TagsNo tags attached.
FreeCAD Information

Activities

yorik

2015-09-25 14:22

administrator   ~0006447

There is one already, called Drawing::FeatureViewPython

yorik

2015-09-25 14:23

administrator   ~0006448

b) is a good idea, I've been meaning to do that some time ago and forgot.

hamish2014

2015-09-25 14:54

reporter   ~0006449

Wow, i can't believe i never new about the Drawing::FeatureViewPython.
Feeling sheepish now:)
Forget about b) the Drawing::FeatureViewPython object looks like it can do everything i need it to for my purposes.

Please close the issue.

yorik

2015-09-25 14:56

administrator   ~0006450

I'll implement b) anyway when I have a minute... It would be useful to have anyway.

hamish2014

2015-09-26 05:33

reporter   ~0006459

Hi,

Played around with the Drawing::FeatureViewPython a little.
I am encountering difficulty with the default view provider for Drawing::FeatureViewPython objects.
Specifically,

1.) t.ViewObject.addProperty:
AttributeError: 'Gui.ViewProviderDocumentObject' object has no attribute 'addProperty'
2.) t.ViewObject.Proxy:
AttributeError: 'Gui.ViewProviderDocumentObject' object has no attribute 'Proxy'

Any ideas?

Perhaps, persueing option b) would be better:
A user could then add a App::FeaturePython under the page group with a ViewResult property whose contents will be loaded into the drawing page.
That way the ViewProviderPythonFeature functionality which does not suffer from 1) and 2) can be leveraged...

hamish2014

2015-09-26 05:52

reporter   ~0006460

Another thought regarding b):

how about modifying FreeCAD_sf_master/src/Mod/Drawing/App/FeaturePage.cpp: App::DocumentObjectExecReturn:
 to load contents from both

 * the ViewResult property from objects DerivedFrom(Drawing::FeatureView::getClassTypeId())

and

 * objects which have a DrawingPageViewResult property.


Where a verbose property name like `DrawingPageViewResult` would almost entirely eliminate the chances of a user accidentally using a property with name for another purpose...

yorik

2015-09-26 15:06

administrator   ~0006464

Indeed as far as I know the view provider of the Drawing::FeatureViewPython doesn't have a python version, it uses the defautl C++ one. Since the drawingview object doesn generate anything in the 3D view, I suppose nobody needed it...

But indeed it could be nice so someone could change the icon and claim children from python code...

Related Changesets

FreeCAD: master 3bbddc86

2015-12-23 20:03:46

yorik

Details Diff
Drawing: Added python feature to ViewProviderDrawingView - fixes 0002276 Affected Issues
0002276
mod - src/Mod/Drawing/App/FeatureView.cpp Diff File
mod - src/Mod/Drawing/Gui/AppDrawingGui.cpp Diff File
mod - src/Mod/Drawing/Gui/ViewProviderView.cpp Diff File
mod - src/Mod/Drawing/Gui/ViewProviderView.h Diff File

Issue History

Date Modified Username Field Change
2015-09-25 09:38 hamish2014 New Issue
2015-09-25 14:22 yorik Note Added: 0006447
2015-09-25 14:23 yorik Note Added: 0006448
2015-09-25 14:23 yorik Assigned To => yorik
2015-09-25 14:23 yorik Status new => assigned
2015-09-25 14:54 hamish2014 Note Added: 0006449
2015-09-25 14:56 yorik Note Added: 0006450
2015-09-26 05:33 hamish2014 Note Added: 0006459
2015-09-26 05:52 hamish2014 Note Added: 0006460
2015-09-26 15:06 yorik Note Added: 0006464
2015-12-23 19:04 yorik Changeset attached => FreeCAD Master master 3bbddc86
2015-12-23 19:04 yorik Status assigned => closed
2015-12-23 19:04 yorik Resolution open => fixed
2016-01-19 02:06 yorik Fixed in Version => 0.16