App::Link as a scripted object property.

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
keithsloan52
Veteran
Posts: 2764
Joined: Mon Feb 27, 2012 5:31 pm

App::Link as a scripted object property.

Post by keithsloan52 »

Reading @yorik blog https://yorik.uncreated.net/blog/2020-009-freecad-juneand Kurt Kremitzki https://www.kwk.systems/blog/

Interested in App::Link

If I add a scripted property App::PropertyLink can that be an App::Link?
keithsloan52
Veteran
Posts: 2764
Joined: Mon Feb 27, 2012 5:31 pm

Re: App::Link as a scripted object property.

Post by keithsloan52 »

I see from https://github.com/realthunder/FreeCAD_ ... i/Concepts That App::Link and App::PropertyLink are not related.

In my Workbench I have functions to create a object GDMLGmshTessellated from an Object with a Mesh or Shape. It also offers the option of changing the gmsh options and performing a re-mesh with these options. Rather than store a copy of the original object in the GDMLGmshTessellated Object it would be better to just store a link. Would I be correct that I could use App::Link for this? rather than save a copy of the original object, I guess I can just store an App::Link and access via Proxy rather than use a property. @realthunder
User avatar
fosselius
Posts: 381
Joined: Sat Apr 23, 2016 10:03 am
Contact:

Re: App::Link as a scripted object property.

Post by fosselius »

realthunder wrote:
i think the @user won't ping the user. we use quotes to do that.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: App::Link as a scripted object property.

Post by realthunder »

keithsloan52 wrote: Mon Jul 13, 2020 7:14 am In my Workbench I have functions to create a object GDMLGmshTessellated from an Object with a Mesh or Shape. It also offers the option of changing the gmsh options and performing a re-mesh with these options. Rather than store a copy of the original object in the GDMLGmshTessellated Object it would be better to just store a link. Would I be correct that I could use App::Link for this? rather than save a copy of the original object, I guess I can just store an App::Link and access via Proxy rather than use a property. @realthunder
It depends on your needs. App::Link uses App::PropertyXLink to handle auto opening of external linked file. If that's all you want, than you can just add a property of that type. App::Link provides some additional functionality, such as link array, linked object hierarchy, variants, etc. It handles internal or external linked object mostly the same way. View object linking is handled by Gui::ViewProviderLink to shared the visual representation from linked object.

If you choose to use App::Link, you can either use App::LinkPython just like any other python extendable object, i.e. through Proxy. Or, install App::LinkExtension into some existing object, which is a more advanced way of using it.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
Post Reply