App Link: Difference between revisions

From FreeCAD Documentation
(An App Link is an element that returns a reference to another object in the document or in an external document. This object was introduced in v0.19 in order to re-use previously created objects, which is very useful to create assemblies.)
 
(Marked this version for translation)
Line 2: Line 2:
<translate>
<translate>


== Introduction ==
== Introduction == <!--T:1-->


<!--T:2-->
An [[App_Link|App Link]], or formally an {{incode|App::Link}}, is an element that returns a reference to another object in the document or in an external document. This object was introduced in v0.19 in order to re-use previously created objects, which is very useful to create assemblies.
An [[App_Link|App Link]], or formally an {{incode|App::Link}}, is an element that returns a reference to another object in the document or in an external document. This object was introduced in v0.19 in order to re-use previously created objects, which is very useful to create assemblies.


<!--T:3-->
When a regular copy of an object is created (for example, with [[Part SimpleCopy|Part SimpleCopy]]), an entire new object with its topological shape is duplicated, which consumes a lot of memory. App Link is used to re-use existing data of an existing object, so an entire new object doesn't need to be created; this improves the handling of copies, particularly in the context of mechanical assembly where many duplicates may be needed, or where importing smaller assemblies into bigger assemblies is required.
When a regular copy of an object is created (for example, with [[Part SimpleCopy|Part SimpleCopy]]), an entire new object with its topological shape is duplicated, which consumes a lot of memory. App Link is used to re-use existing data of an existing object, so an entire new object doesn't need to be created; this improves the handling of copies, particularly in the context of mechanical assembly where many duplicates may be needed, or where importing smaller assemblies into bigger assemblies is required.


Line 12: Line 14:
<translate>
<translate>


== How to use ==
== How to use == <!--T:4-->


<!--T:5-->
* App Links can be created by pressing {{Button|[[File:Std_LinkMake.svg|16px]] [[Std_LinkMake|LinkMake]]}}.
* App Links can be created by pressing {{Button|[[File:Std_LinkMake.svg|16px]] [[Std_LinkMake|LinkMake]]}}.


<!--T:6-->
An [[App_Link|App Link]] is an internal object, so it is mostly intended to be used by developers when developing assembly workbenches. For example, the Assembly3 and Assembly4 workbenches make use of this object. See [[External workbenches|External workbenches]].
An [[App_Link|App Link]] is an internal object, so it is mostly intended to be used by developers when developing assembly workbenches. For example, the Assembly3 and Assembly4 workbenches make use of this object. See [[External workbenches|External workbenches]].


==Properties==
==Properties== <!--T:7-->


<!--T:8-->
See [[Property|Property]] for all property types that scripted objects can have.
See [[Property|Property]] for all property types that scripted objects can have.


<!--T:9-->
An {{incode|App::Link}} object is not derived from a [[Part_Feature|Part Feature]], however, if the Link has a reference to an external object, it will show the properties of the latter object.
An {{incode|App::Link}} object is not derived from a [[Part_Feature|Part Feature]], however, if the Link has a reference to an external object, it will show the properties of the latter object.


<!--T:10-->
These are the properties available in the [[property editor|property editor]] for an empty {{incode|App::Link}}.
These are the properties available in the [[property editor|property editor]] for an empty {{incode|App::Link}}.


=== Data ===
=== Data === <!--T:11-->


<!--T:12-->
{{TitleProperty|Link}}
{{TitleProperty|Link}}
* {{PropertyData|Linked Object}}:
* {{PropertyData|Linked Object}}:
Line 36: Line 44:
* {{PropertyData|Scale}}:
* {{PropertyData|Scale}}:


<!--T:13-->
{{TitleProperty|Base}}
{{TitleProperty|Base}}
* {{PropertyData|Label}}:
* {{PropertyData|Label}}:


=== View ===
=== View === <!--T:14-->


<!--T:15-->
{{TitleProperty|Link}}
{{TitleProperty|Link}}
* {{PropertyView|Draw Style}}:
* {{PropertyView|Draw Style}}:
Line 49: Line 59:
* {{PropertyView|Shape Material}}:
* {{PropertyView|Shape Material}}:


<!--T:16-->
{{TitleProperty|Base}}
{{TitleProperty|Base}}
* {{PropertyView|On Top When Selected}}:
* {{PropertyView|On Top When Selected}}:
Line 55: Line 66:
* {{PropertyView|Visibility}}:
* {{PropertyView|Visibility}}:


== Scripting ==
== Scripting == <!--T:17-->


<!--T:18-->
{{Emphasis|See also:}} [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]], and [[scripted objects|scripted objects]].
{{Emphasis|See also:}} [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]], and [[scripted objects|scripted objects]].


<!--T:19-->
See [[Part_Feature|Part Feature]] for the general information.
See [[Part_Feature|Part Feature]] for the general information.


<!--T:20-->
An App Link is created with the {{incode|addObject()}} method of the document.
An App Link is created with the {{incode|addObject()}} method of the document.
</translate>
</translate>
Line 72: Line 86:
<translate>
<translate>


== Further reading ==
== Further reading == <!--T:21-->


<!--T:22-->
The App Link object was introduced after 2 years of development and prototyping. This component was thought and developed almost single-handedly by user {{Emphasis|realthunder}}. The motivations and design implementations behind this project are described in his GitHub page, [https://github.com/realthunder/FreeCAD_assembly3/wiki/Link Link]. In order to accomplish this feature, several core changes to FreeCAD were made; these were also extensively documented in [https://github.com/realthunder/FreeCAD_assembly3/wiki/Core-Changes Core-Changes].
The App Link object was introduced after 2 years of development and prototyping. This component was thought and developed almost single-handedly by user {{Emphasis|realthunder}}. The motivations and design implementations behind this project are described in his GitHub page, [https://github.com/realthunder/FreeCAD_assembly3/wiki/Link Link]. In order to accomplish this feature, several core changes to FreeCAD were made; these were also extensively documented in [https://github.com/realthunder/FreeCAD_assembly3/wiki/Core-Changes Core-Changes].


<!--T:23-->
The App Link project started after the redesign of the [[PartDesign Workbench|PartDesign Workbench]] was complete in v0.17. The history of App Link can be traced to some essential forum threads:
The App Link project started after the redesign of the [[PartDesign Workbench|PartDesign Workbench]] was complete in v0.17. The history of App Link can be traced to some essential forum threads:
* [https://forum.freecadweb.org/viewtopic.php?f=19&t=21505 Why an object can only be inside one App::Part?] (March 2017)
* [https://forum.freecadweb.org/viewtopic.php?f=19&t=21505 Why an object can only be inside one App::Part?] (March 2017)
Line 86: Line 102:
* [https://forum.freecadweb.org/viewtopic.php?f=10&t=29542 Merging of my Link branch] (June 2018)
* [https://forum.freecadweb.org/viewtopic.php?f=10&t=29542 Merging of my Link branch] (June 2018)


<!--T:24-->
Finally, the pull request and merge happened:
Finally, the pull request and merge happened:
* [https://forum.freecadweb.org/viewtopic.php?f=27&t=38621 App::Link: the big merge], old thread (July 2019), [https://github.com/FreeCAD/FreeCAD/pull/2350 pull request #2350] (the BIG merge), [https://github.com/realthunder/FreeCAD/tree/LinkMerge LinkMerge branch].
* [https://forum.freecadweb.org/viewtopic.php?f=27&t=38621 App::Link: the big merge], old thread (July 2019), [https://github.com/FreeCAD/FreeCAD/pull/2350 pull request #2350] (the BIG merge), [https://github.com/realthunder/FreeCAD/tree/LinkMerge LinkMerge branch].
Line 92: Line 109:
* [https://forum.freecadweb.org/viewtopic.php?f=17&t=39672 PR#2559: expose link and navigation actions], an introduction to the Link feature in 0.19 (September 2019).
* [https://forum.freecadweb.org/viewtopic.php?f=17&t=39672 PR#2559: expose link and navigation actions], an introduction to the Link feature in 0.19 (September 2019).


<!--T:25-->
{{Std Base}}
{{Std Base}}
{{Userdocnavi}}
{{Userdocnavi}}

Revision as of 10:22, 26 November 2019

Introduction

An App Link, or formally an App::Link, is an element that returns a reference to another object in the document or in an external document. This object was introduced in v0.19 in order to re-use previously created objects, which is very useful to create assemblies.

When a regular copy of an object is created (for example, with Part SimpleCopy), an entire new object with its topological shape is duplicated, which consumes a lot of memory. App Link is used to re-use existing data of an existing object, so an entire new object doesn't need to be created; this improves the handling of copies, particularly in the context of mechanical assembly where many duplicates may be needed, or where importing smaller assemblies into bigger assemblies is required.

How to use

  • App Links can be created by pressing LinkMake.

An App Link is an internal object, so it is mostly intended to be used by developers when developing assembly workbenches. For example, the Assembly3 and Assembly4 workbenches make use of this object. See External workbenches.

Properties

See Property for all property types that scripted objects can have.

An App::Link object is not derived from a Part Feature, however, if the Link has a reference to an external object, it will show the properties of the latter object.

These are the properties available in the property editor for an empty App::Link.

Data

Link

  • DataLinked Object:
  • DataLink Transform:
  • DataPlacement:
  • DataShow Element:
  • DataElement Count:
  • DataScale:

Base

  • DataLabel:

View

Link

  • ViewDraw Style:
  • ViewLine Width:
  • ViewOverride Material:
  • ViewPoint Size:
  • ViewSelectable:
  • ViewShape Material:

Base

  • ViewOn Top When Selected:
  • ViewSelection Style:
  • ViewShow In Tree:
  • ViewVisibility:

Scripting

See also: FreeCAD Scripting Basics, and scripted objects.

See Part Feature for the general information.

An App Link is created with the addObject() method of the document.

import FreeCAD as App

doc = App.newDocument()
obj = App.ActiveDocument.addObject("App::Link", "Name")
obj.Label = "Custom label"

Further reading

The App Link object was introduced after 2 years of development and prototyping. This component was thought and developed almost single-handedly by user realthunder. The motivations and design implementations behind this project are described in his GitHub page, Link. In order to accomplish this feature, several core changes to FreeCAD were made; these were also extensively documented in Core-Changes.

The App Link project started after the redesign of the PartDesign Workbench was complete in v0.17. The history of App Link can be traced to some essential forum threads:

Finally, the pull request and merge happened: