App Link

From FreeCAD Documentation
Revision as of 00:30, 11 September 2020 by Vocx (talk | contribs) (See the Std LinkMake page for the complete information, including its use in Scripting.)

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.

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

  1. Select an object in the tree view or 3D view for which you wish to create a Link.
  2. Press the Std LinkMake button. The produced object has the same icon as the original object, but has an arrow overlay indicating it is a Link.

See the Std LinkMake page for the complete information, including its use in Scripting.

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: