using Extension

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
damian
Posts: 583
Joined: Sun May 31, 2015 6:16 pm

using Extension

Postby damian » Sat Oct 08, 2016 1:29 pm

Hello:

Code: Select all

>>> doc=App.newDocument()
>>> App.setActiveDocument("Unnamed")
>>> App.ActiveDocument=App.getDocument("Unnamed")
>>> Gui.ActiveDocument=Gui.getDocument("Unnamed")
>>> obj=doc.addObject("App::DocumentObject")
>>> obj.addExtension("App::OriginGroupExtensionPython", obj)
>>> obj.PropertiesList
['ExpressionEngine', 'ExtensionProxy', 'Group', 'Label', 'Origin', 'Placement']
>>> 
Please, how could I consult the available Extensions? I suppose that there are more types, in addition to "App::OriginGroupExtensionPython"
I was reading the code, but I don't understand anything (¡ni papa! )

Thank you

OS: Ubuntu 14.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.8647 (Git)
Build type: Unknown
Branch: master
Hash: 8a21cd4daa8cb705a42030bf8b7ac2f340a154c7
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.9.1
ickby
Posts: 2891
Joined: Wed Oct 05, 2011 7:36 am

Re: using Extension

Postby ickby » Sat Oct 08, 2016 3:22 pm

currently there are only 3 Which are the 3 grouping mechanisms:

App::GroupExtensionPython: Grouping only
App::GeoFeatureGroupExtensionPython: Local Coordinate System
App::OriginGroupExtensionPython: Local Coordinate System with visible Origin

but note that just adding the extension like you do will not work with save/load mechanism. The whole concept is intended for creation of custom types and should be used like dynamic properties.
damian
Posts: 583
Joined: Sun May 31, 2015 6:16 pm

Re: using Extension

Postby damian » Sat Oct 08, 2016 3:37 pm

perfect!
User avatar
DeepSOIC
Posts: 6581
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: using Extension

Postby DeepSOIC » Sun Oct 09, 2016 8:21 pm

ickby wrote:but note that just adding the extension like you do will not work with save/load mechanism. The whole concept is intended for creation of custom types and should be used like dynamic properties.
Can you provide an example that will work, please?