Std LinkMake
Std LinkMake |
Menu location |
---|
None |
Workbenches |
All |
Default shortcut |
None |
Introduced in version |
0.19 |
See also |
Std Part, Std Group, PartDesign Body |
Description
Std LinkMake creates an App Link (App::Link
class), 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.
The App Link object was newly introduced in v0.19; in the past, simple duplication of objects could be achieved with Draft Clone, but this is a less efficient solution due to its implementation which essentially creates a copy of the internal Shape of the source object. On the other hand, a Link references directly the original Shape, so it is more memory efficient.
By itself the Link object can behave like an array, duplicating its base object many times; this can be done by setting its DataElement Count property to 1
or larger. This "Link array" object can also be created with the different array tools of the Draft Workbench, for example, Draft OrthoArray, Draft PolarArray, and Draft CircularArray.
When used with the PartDesign Workbench, Links are intended to be used with full PartDesign Bodies; to create arrays of features, use PartDesign LinearPattern, PartDesign PolarPattern, and PartDesign MultiTransform.
The Std LinkMake tool is not defined by a particular workbench, but by the base system, thus it is found in the structure toolbar that is available in all workbenches. The Link object, used in conjunction with Std Part to group various objects, forms the basis of the Assembly3 and Assembly4 Workbenches.
Usage
With selection:
- Select an object in the tree view or 3D view for which you wish to create a Link.
- 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.
Without selection:
- If no object is selected, press the Std LinkMake button to create an empty Link.
- Go to the property editor, then click on the DataLinked Object property to open the Link selection dialog to choose an object, then press OK.
- Instead of choosing an entire object in the tree view, you can also pick subelements (vertices, edges, or faces) of a single object in the 3D view. In this case, the Link will duplicate only these subelements, and the arrow overlay will be different.
Properties
An App Link (App::Link
class) is derived from the basic App DocumentObject (App::DocumentObject
class), therefore it has the latter's basic properties like DataLabel and DataLabel2.
The following are the specific properties available in the property editor. Hidden properties can be shown by using the Show all command in the context menu of the property editor.
Data
Link
- DataLinked Object (
XLink
): it indicates the source object of the App Link; this can be an entire object, or a subelement of it (vertex, edge, or face). - DataLink Transform (
Bool
): it defaults tofalse
, in which case the Link will override the DataLinked Object's own placement. If it is set totrue
, the Link will be placed in the same position as the DataLinkedObject. - DataPlacement (
Placement
): the placement of the Link.
- This property will change to DataLink Placement if DataLink Transform is set to
true
; in this case, the DataLink Placement constitutes an offset applied on top of the DataPlacement of the DataLinked Object.
- DataShow Element (
Bool
): it defaults totrue
, in which case the tree view will show the individual Link copies, as long as DataElement Count is1
or larger. - DataElement Count (
IntegerConstraint
): it defaults to0
. If it is1
or larger, the App Link will behave like an array, and will duplicate the same DataLinked Object many times. If DataShow Elements istrue
, each element in the array will be displayed in the tree view, and each can have its own DataPlacement modified. Each Link copy will have a name based on the Link's Name, augmented by_iN
, whereN
is a number starting from0
. For example, with a singleLink
, the copies will be namedLink_i0
,Link_i1
,Link_i2
, etc. - DataLink Execute (
String
): name of the execute function that will run for this particular Link object. It defaults to'appLinkExecute'
. Set it to'None'
to disable it. - Data (Hidden)Colored Elements (
LinkSubHidden
): list of Link elements that have had their color overriden. - DataScale (
Float
): it defaults to1.0
. It is a factor for uniform scaling in each directionX
,Y
, andZ
. For example, a cube of2 mm
x2 mm
x2 mm
, that is scaled by2.0
, will result in a shape with dimensions4 mm
x4 mm
x4 mm
. - Data (Hidden)Scale Vector (
Vector
): the scale factor for each component(X, Y, Z)
for all Link elements when DataElement Count is1
or larger. If DataScale is other than1.0
, this same value will be used in the three components. - DataScale List (
VectorList
): the scale factor for each Link element. - Data (Hidden)Visibility List (
BoolList
): (read-only) the visibility state of each Link element, eithertrue
orfalse
. - Data (Hidden)Placement List (
PlacementList
): (read-only) the placement for each Link element. - Data (Hidden)Element List (
LinkList
): the list of Link elements. - Data (Hidden)_LinkTouched (
Bool
): - Data (Hidden)_ChildCache (
LinkList
):
Base
- Data (Hidden)Proxy (
PythonObject
): a custom class associated with this object. This only exists for the Python version. See Scripting.
The App Link object will additionally show the properties of the original DataLinked Object, so the property editor may have groups of properties like Attachment, Box, Draft, etc.
View
Link
- ViewDraw Style (
Enumeration
): it defaults toNone
; it can beSolid
,Dashed
,Dotted
,Dashdot
. - ViewLine Width (
FloatConstraint
): - ViewOverride Material (
Bool
): it defaults tofalse
; if set totrue
it will override the DataLinked Object's material. - ViewPoint Size (
FloatConstraint
): - ViewSelectable (
Bool
): - ViewShape Material (
Material
): this property includes sub-properties that describe the ViewDiffuse Color, ViewAmbient Color, ViewSpecular Color, ViewEmissive Color, ViewShininess, and ViewTransparency.
Base
- View (Hidden)Child View Provider (
PersistentObject
): - View (Hidden)Material List (
MaterialList
): - View (Hidden)Override Color List (
ColorList
): - View (Hidden)Override Material List (
BoolList
):
Display Options
- ViewDisplay Mode (
Enumeration
):Link
orChildView
.
It will additionally show the view properties of the original DataLinked Object.
Inheritance
An App Link is formally an instance of the class App::Link
, whose parent is the basic App DocumentObject (App::DocumentObject
class). It is a very low level object, which can be used with most other document objects.
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. It can define its DataLinked Object by overriding its LinkedObject
attribute, or by using its setLink
method.
import FreeCAD as App
doc = App.newDocument()
bod1 = App.ActiveDocument.addObject("PartDesign::Body", "Body")
bod2 = App.ActiveDocument.addObject("Part::Box", "Box")
obj1 = App.ActiveDocument.addObject("App::Link", "Link")
obj2 = App.ActiveDocument.addObject("App::Link", "Link")
obj1.LinkedObject = bod1
obj2.setLink(bod2)
App.ActiveDocument.recompute()
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:
- Why an object can only be inside one App::Part? (March 2017)
- Introducing App::Link/XLink (March 2017)
- Links (May 2017)
- Realthunder Link implementation: Architecture discussion (June 2017)
- PR #876: Link, stage one, context aware selection (July 2017)
- Preview: Link, stage two, API groundwork (July 2017)
- Assembly3 preview (December 2017)
- Merging of my Link branch (June 2018)
Finally, the pull request and merge happened:
- App::Link: the big merge, old thread (July 2019), pull request #2350 (the BIG merge), LinkMerge branch.
- App::Link: the big merge, main thread (July 2019)
- A simple path description of Link, 019, Link stage, Asm3, merge? (August 2019)
- PR#2559: expose link and navigation actions, an introduction to the Link feature in 0.19 (September 2019).
- File: New, Open, Close, Close All, Save, Save As, Save a Copy, Save All, Revert, Import, Export,Merge project, Project information, Print, Print preview, Export PDF, Recent files, Exit
- Edit: Undo, Redo, Cut, Copy, Paste, Duplicate selection, Refresh, Box selection, Box element selection, Select All, Delete, Send to Python Console, Placement, Transform, Alignment, Toggle Edit mode, Edit mode, Preferences
- View:
- Miscellaneous: Create new view, Orthographic view, Perspective view, Fullscreen, Bounding box, Toggle axis cross, Clipping plane, Texture mapping, Toggle navigation/Edit mode, Appearance, Random color, Workbench, Status bar
- Standard views: Fit all, Fit selection, Isometric, Dimetric, Trimetric, Home, Front, Top, Right, Rear, Bottom, Left, Rotate Left, Rotate Right
- Freeze display: Save views, Load views, Freeze view, Clear views
- Draw style: As is, Points, Wireframe, Hidden line, No shading, Shaded, Flat lines
- Stereo: Stereo red/cyan, Stereo quad buffer, Stereo Interleaved Rows, Stereo Interleaved Columns, Stereo Off, Issue camera position
- Zoom: Zoom In, Zoom Out, Box zoom
- Document window: Docked, Undocked, Fullscreen
- Visibility: Toggle visibility, Show selection, Hide selection, Select visible objects, Toggle all objects, Show all objects, Hide all objects, Toggle selectability
- Toolbars: File, Edit, Clipboard, Workbench, Macro, View, Structure, Help
- Panels: Tree view, Property view, Selection view, Tasks, Python console, DAG view, Model, Report view
- Link navigation: Go to linked object, Go to the deepest linked object, Select all links
- Tree view actions: Sync view, Sync selection, Sync placement, Pre-selection, Record selection, Single document, Multi document, Collapse/Expand, Initiate dragging, Go to selection, Selection Back, Selection Forward
- Tools: Edit parameters, Save image, Load image, Scene inspector, Dependency graph, Project utility, Measure distance, Add text document, View turntable, Units calculator, Customize, Addon manager
- Macro: Macro recording, Macros, Recent macros, Execute macro, Attach to remote debugger, Debug macro, Stop debugging, Step over, Step into, Toggle breakpoint
- Help: Help, FreeCAD Website, Donate, Users documentation, Python scripting documentation, Automatic Python modules documentation, FreeCAD Forum, FreeCAD FAQ, Report a bug, About FreeCAD, What's This
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Assembly, BIM, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
- Hubs: User hub, Power users hub, Developer hub