App Link: Difference between revisions

From FreeCAD Documentation
(Shorter introduction)
(Move the image to the introduction; remove the properties, as these are included in the Std_LinkMake page)
Line 11: Line 11:


<!--T:3-->
<!--T:3-->
When a regular copy of an object is created, for example, with {{Button|[[File:Part_SimpleCopy.svg|16px]] [[Part_SimpleCopy‎|Part SimpleCopy‎]]}}, an entire new object with its [[Part_TopoShape|Part TopoShape]] is duplicated, which consumes a lot of memory and may slow down the responsiveness of the software. [[App_Link|App Link]] is intended to re-use existing data of an existing object, so creating copies in this way is more efficient.
When a regular copy of an object is created, for example, with {{Button|[[File:Part_SimpleCopy.svg|16px]] [[Part_SimpleCopy‎|Part SimpleCopy‎]]}}, an entire new object with its [[Part_TopoShape|Part TopoShape]] is duplicated, which consumes a lot of memory and may slow down the responsiveness of the software. [[App_Link|App Link]] is intended to re-use existing data from existing objects, so creating copies in this way is more efficient.

<!--T:27-->
[[File:FreeCAD_core_objects.svg|800px]]

<!--T:28-->
{{Caption|Simplified diagram of the relationships between the core objects in the program. The {{incode|App::Link}} object is a core component of the system, it does not depend on any workbench, but it can be used with most objects created in all workbenches.}}


== Usage == <!--T:4-->
== Usage == <!--T:4-->
Line 20: Line 26:
<!--T:6-->
<!--T:6-->
{{Emphasis|Note:}} 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_Workbench|Assembly3]] and [[Assembly4_Workbench|Assembly4]] workbenches make use of this object.
{{Emphasis|Note:}} 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_Workbench|Assembly3]] and [[Assembly4_Workbench|Assembly4]] workbenches make use of this object.

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

<!--T:8-->
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.

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

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

<!--T:12-->
{{TitleProperty|Link}}
* {{PropertyData|Linked Object}}:
* {{PropertyData|Link Transform}}:
* {{PropertyData|Placement}}:
* {{PropertyData|Show Element}}:
* {{PropertyData|Element Count}}:
* {{PropertyData|Scale}}:

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

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

<!--T:15-->
{{TitleProperty|Link}}
* {{PropertyView|Draw Style}}:
* {{PropertyView|Line Width}}:
* {{PropertyView|Override Material}}:
* {{PropertyView|Point Size}}:
* {{PropertyView|Selectable}}:
* {{PropertyView|Shape Material}}:

<!--T:16-->
{{TitleProperty|Base}}
* {{PropertyView|On Top When Selected}}:
* {{PropertyView|Selection Style}}:
* {{PropertyView|Show In Tree}}:
* {{PropertyView|Visibility}}:

== Inheritance == <!--T:26-->

<!--T:27-->
[[File:FreeCAD_core_objects.svg|800px]]

<!--T:28-->
{{Caption|Simplified diagram of the relationships between the core objects in the program. The {{incode|App::Link}} object is a core component of the system, it does not depend on any workbench, but it can be used with most objects created in all workbenches.}}


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

Revision as of 00:22, 11 September 2020

Introduction

An App Link, or formally an App::Link, is a type of object that references or links to another object, in the same document, or in another document. It is especially designed to efficiently duplicate a single object multiple times, which helps with the creation of complex assemblies from smaller subassemblies, and from multiple reusable components like screws, nuts, and similar fasteners.

When a regular copy of an object is created, for example, with Part SimpleCopy‎, an entire new object with its Part TopoShape is duplicated, which consumes a lot of memory and may slow down the responsiveness of the software. App Link is intended to re-use existing data from existing objects, so creating copies in this way is more efficient.

Simplified diagram of the relationships between the core objects in the program. The App::Link object is a core component of the system, it does not depend on any workbench, but it can be used with most objects created in all workbenches.

Usage

  • App Links can be created by pressing LinkMake.

Note: 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.

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: