App Link

From FreeCAD Documentation
Jump to: navigation, search
This page contains changes which are not marked for translation.

Other languages:
Deutsch • ‎English • ‎français • ‎italiano

Introduction

Link.svg

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 Std LinkMake.svg 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:

Inheritance

FreeCAD core objects.svg

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.


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: