Crea link
Crea link |
Posizione nel menu |
---|
None |
Ambiente |
Tutti |
Avvio veloce |
Nessuno |
Introdotto nella versione |
0.19 |
Vedere anche |
Parte standard, Gruppo standard, Corpo di PartDesign |
Descrizione
Crea link crea un App Link (classe App::Link
), che è un tipo di oggetto che fa riferimento o collega ad un altro oggetto, nello stesso documento o in un altro documento. È appositamente progettato per duplicare in modo efficiente un singolo oggetto più volte, il che aiuta nella creazione di assemblaggi complessi da sottoassiemi più piccoli e da più componenti riutilizzabili come viti, dadi e dispositivi di fissaggio simili.
L'oggetto App Link è stato introdotto di recente nella versione 0.19; in passato, si poteva ottenere una semplice duplicazione di oggetti con Clona di Draft, ma questa è una soluzione meno efficiente a causa della sua implementazione che essenzialmente crea una copia della Forma (Shape) interna dell'oggetto sorgente. Invece, un link fa riferimento direttamente alla forma originale, quindi è più efficiente in termini di memoria.
Di per sé l'oggetto Link può comportarsi come un array, duplicando più volte il suo oggetto base; questo può essere fatto impostando la sua proprietà DatiElement Count su 1
o più grande. Questo oggetto "Link_Array" può essere creato anche con i diversi strumenti dell'array Ambiente Draft, per esempio, Draft Serie ortogonale, Draft Serie polare, and Draft Serie circolare.
Quando si lavora con l' Ambiente Part Design, i link sono destinati ad essere utilizzati con i Corpo di Part Design, quindi si consiglia di impostare la modalità VistaDisplay Mode Body su Tip
per selezionare le caratteristiche dell'intero corpo, e non le singole caratteristiche.
Per creare array di elementi interni Funzioni di PartDesign, utilizzare PartDesign Serie lineare, PartDesign Serie polare, e PartDesign Multitransformazione.
Lo strumento Crea link non è definito da un particolare banco di lavoro, ma dal sistema di base, quindi si trova nella Struttura della barra degli strumenti che è disponibile in tutti gli ambienti di lavoro. L'oggetto Link, usato insieme a Parte standard per raggruppare vari oggetti, costituisce la base di Assembly3 e Assembly4 Workbenches.
Utilizzo
Con selezione:
- Selezionare un oggetto nella vista ad albero o nella vista 3D per il quale si desidera creare un link.
- Premere il pulsante Crea link. L'oggetto prodotto ha la stessa icona dell'oggetto originale, ma ha una freccia sovrapposta che indica che è un collegamento.
Senza selezione:
- Se non viene selezionato alcun oggetto, premere il pulsante Crea link per creare un link vuoto .
- Vai all'editor delle proprietà, quindi clicca sulla proprietà DatiLinked Object per aprire metodi di selezione e scegliere un oggetto, poi premi OK.
- Invece di scegliere un intero oggetto nella vista ad albero, è anche possibile scegliere i sottoelementi (vertici, bordi o facce) di un singolo oggetto nella vista 3D. In questo caso, il Link duplicherà solo questi sottoelementi, e la sovrapposizione delle frecce sarà diversa. Questo può essere fatto anche con crea un link relativo.
(1) Un oggetto, (2) Un Link vuoto, (3) un Link completo del primo oggetto (con materiale di rivestimento), (4) un collegamento solo ad alcuni sottoelementi dell'oggetto. Il Link vuoto non è legato all'oggetto reale, quindi non viene visualizzato nella vista 3D.
Utilizzo: documenti esterni
- Iniziare con un documento che ha almeno un oggetto che sarà la fonte del Link.
- Aprire un nuovo documento o un documento esistente. Per una più facile gestione, usare Visualizza Multi documento per mostrare entrambi i documenti nella vista ad albero. Prima di procedere, salva entrambi i documenti. Il Link non sarà in grado di trovare la sua fonte e la sua destinazione a meno che entrambi i documenti non siano salvati su disco.
- Nel primo documento, selezionare l'oggetto che si desidera collegare; poi passare alle schede nell'area della vista principale per passare al secondo documento.
- Premere Crea link. L'oggetto prodotto ha la stessa icona dell'oggetto originale, ma ha una freccia aggiuntiva che indica che si tratta di un link proveniente da un documento esterno.
Notes:
- Quando si salva il documento con il Link, verrà anche chiesto di salvare il documento di origine che contiene l'oggetto originale.
- Per includere l'oggetto originale nel documento con il Link, utilizzare Importa un link oppure Importa tutti i link.
- Crea link può essere utilizzato su un oggetto Link esistente, al fine di creare un Link ad un Link che si risolve in definitiva con l'oggetto originale nel documento di origine. Questo può essere utlizato con Crea un link relativo per scegliere anche solo alcuni sotto elementi.
(1, 2) Due oggetti di un documento sorgente collegati in un documento di destinazione, (3) un Link al secondo Link (con materiale di sovrascrittura), e (4) un Link ai sotto elementi del secondo Link.
Drag and drop
Invece di passare da una scheda all'altra del documento, è possibile creare dei Links eseguendo un'operazione di drag and drop nella vista ad albero: selezionare l'oggetto sorgente dal primo documento, trascinarlo, quindi rilasciarlo nel nome del secondo documento tenendo premuto il tasto Alt della tastiera.
Il trascinamento porta ad azioni diverse a seconda della tasto di modifica che si sta utilizzando.
- Senza il tasto di modifica si sposta semplicemente l'oggetto da un documento all'altro; una freccia inclinata viene mostrata nel cursore.
- Tenendo premuto il tasto Ctrl si copia l'oggetto; nel cursore viene mostrato un segno più.
- Tenendo premuto il tasto Alt si crea un collegamento; una coppia di maglie di catena viene mostrata nel cursore.
Per i modificatori Ctrl e Alt, il trascinamento può essere fatto anche con un singolo documento. Ovvero, trascinando un oggetto e rilasciandolo nel nome dello stesso documento si possono creare più copie o più link ad esso.
Gruppi
Crea link può essere usato su Parte standard al fine di duplicare rapidamente gruppi di oggetti posizionati nello spazio, cioè assemblaggi.
Link creato da una Parte standard; gli oggetti non sono duplicati, ma sono elencati sotto il contenitore originale e sotto il Link contenitore.
Un regolare Gruppo standard non possiede una proprietà DatiPlacement, quindi non può controllare la posizione degli oggetti al suo interno. Tuttavia, quando Crea link è usato con Gruppo standard, il Link risultante si comporta essenzialmente come una Parte standard e può anche essere spostata nello spazio.
Link creato da un Gruppo standard; gli oggetti non sono duplicati ma sono elencati sotto il contenitore originale e sotto il contenitore Link. Il Link (con materiale di sovrascrittura) può essere spostato nello spazio, proprio come una Parte standard.
Un collegamento a una Parte standard manterrà la visibilità degli oggetti sincronizzati con la Parte originale; quindi se si nasconde un oggetto in un Link, esso sarà nascosto in tutti i Link e nell'oggetto originale. Invece un Link ad un Gruppo standard consentirà il controllo indipendente delle visibilità.
Sinistra: Parte standard con due oggetti, e due Links alla Parte; la visibilità degli oggetti è sincronizzata. Destra: Gruppo Standard con due oggetti, e due Links al Gruppo; la visibilità degli oggetti è controllata indipendentemente in ogni gruppo.
Aspetto dominante
Quando viene creato un Link, di default la VistaOverride Material è false
, quindi il Link avrà lo stesso aspetto dell'originale DatiLinked Object.
Quando la VistaOverride Material è impostato su true
, la proprietà VistaShape Material controllerà l'aspetto del Link.
Indipendentemente dallo stato della VistaOverride Material, è possibile impostare individualmente l'aspetto dei sottoelementi (vertici, bordi, facce) di un Link.
- Selezionare il Link nella vista ad albero. Aprire il menu contestuale (tasto destro del mouse) e scegliere Template:MenuCommand/it.
- Ora scegliere i singoli sottoelementi che si desidera nella vista 3D, premere Edit, e modificare le proprietà, inclusa la trasparenza.
- Per rimuovere gli attributi personalizzati, selezionare gli elementi nella lista, e premere Remove.
- Quando si è soddisfatti del risultato, premere OK per chiudere la finestra di dialogo.
Nota: A partire dalla v0.19, la colorazione dei sottoelementi è soggetta al problema di denominazione topologica, quindi dovrebbe essere fatta come ultima fase di modellazione, quando il modello non è più soggetto a modifiche.
(1) Un oggetto originale, (2) un Link con materiale di sovrascrittura e (3) un secondo Link con singoli sottoelementi modificati.
Link Array
Vedi anche: Draft: Serie ortogonale.
Quando viene creato un Link, di default il suo DatiElement Count è 0
, quindi solo un singolo oggetto Link sarà visibile nella vista ad albero.
Dato che DatiShow Element è true
di default, quando DatiElement Count è impostato su 1
o più, automaticamente verranno creati più Link sotto il primo; ogni nuovo Link può essere posizionato nella posizione desiderata cambiando la proprietà DatiPlacement.
In modo simile, ogni elemento dell'array può avere il proprio aspetto modificato, sia con le proprietà VistaOverride Material e VistaShape Material, sia usando il menu Template:MenuCommand/it sull'intero array e quindi selezionando le singole facce; questo è descritto in Aspetto dominante.
(1) Oggetto di origine, e (2, 3, 4) un Link array con tre elementi, ciascuno in una posizione diversa. Il primo Link ha il materiale sovrascritto e le facce trasparenti, gli altri due hanno colori personalizzati per le facce.
Una volta che si è soddisfatti del posizionamento e delle proprietà degli elementi di collegamento nell'array, si può cambiare DatiShow Element in false
per nascondere i singoli collegamenti nella vista ad albero; questo ha il vantaggio di rendere il sistema più reattivo, soprattutto se si hanno molti oggetti nel documento.
Quando si crea questo tipo di array Link, è necessario posizionare manualmente ciascuno degli elementi; tuttavia, se si desidera utilizzare modelli specifici per posizionare le copie, è possibile utilizzare gli strumenti di array del Draft Workbench, come Draft OrthoArray, Draft PolarArray, e Draft CircularArray; questi comandi possono creare copie normali o copie Link a seconda delle opzioni al momento della creazione.
Visibility
When DatiShow Element is true
and individual elements are listed in the tree view in a Link Array, each Link can be shown or hidden by pressing the Space bar in the keyboard.
Another way to hide the individual elements is using the Override colors menu.
- Select the array, open the Override colors menu (right click).
- In the 3D view, pick any subelement from any Link in the array.
- Press Hide. An icon of an eye should appear, indicating that this element has been hidden from the 3D view. The object will temporarily show itself when the cursor hovers over the icon.
- You can click OK to confirm the operation and close the dialog. The Link will remain hidden even if it is shown as visible in the tree view.
Element color dialog that is available when opening the context menu of a Link object in the tree view.
If you wish to restore the visibility of this array element, enter the dialog once more, pick the eye icon, then click on Remove to remove the hidden status, and click OK to confirm and close the dialog. The element will be visible in the 3D view again.
When the Link is for a Std Part or a Std Group, the Override colors menu works in similar way as with arrays; it allows controlling the face color, entire object color, and visibility of the objects in the group.
A Std Part containing three objects, and a Link to that Part; in the Link, (1) the first object is made invisible, (2) the second object has some subelements with different colors, (3) the entire third object has a different color and level of transparency.
Proprietà
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 DatiLabel and DatiLabel2.
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.
Dati
Link
- DatiLinked Object:
- DatiLink Transform:
- DatiPlacement:
- DatiSub Elements:
- DatiShow Elements:
- DatiElement Count:
- DatiScale:
Base
- Dati (Hidden)Proxy (
PythonObject
): a custom class associated with this object. This only exists for the Python version. See Scripting.
L'oggetto App Link mostra inoltre le proprietà del DatiLinked Object originale, quindi l'editor delle proprietà può avere gruppi di proprietà come Attachment , Box, Draft e così via.
Vista
Link
- VistaDraw Style:
- VistaLine Width:
- VistaOverride Material:
- VistaPoint Size:
- VistaSelectable:
- VistaShape Material:
- VistaShape Material (
Material
): this property includes sub-properties that describe the appearance of the object.- VistaDiffuse Color, it defaults to
(0.4, 1.0, 1.0)
, which is displayed as[102, 255, 255]
on base 255, light blue . - VistaAmbient Color, it defaults to
(0.2, 0.2, 0.2)
, which is displayed as[51, 51, 51]
on base 255, dark gray . - VistaSpecular Color, it defaults to
(0.0, 0.0, 0.0)
, which is displayed as[0, 0, 0]
on base 255, black . - VistaEmissive Color, it defaults to
(0.0, 0.0, 0.0)
, which is displayed as[0, 0, 0]
on base 255, black . - VistaShininess, it defaults to
0.2
- VistaTransparency, it defaults to
0.0
.
- VistaDiffuse Color, it defaults to
Base
- Vista (Hidden)Child View Provider (
PersistentObject
): - Vista (Hidden)Material List (
MaterialList
): (read-only) if individual materials have been added, they will be listed here. - Vista (Hidden)Override Color List (
ColorList
): (read-only) if the individual faces or edges of the link have been overridden they will be listed here. - Vista (Hidden)Override Material List (
BoolList
): (read-only) if the individual materials of the link have been overridden they will be listed here.
Display Options
- VistaDisplay Mode (
Enumeration
):'Link'
or'ChildView'
. - VistaShow In Tree (
Bool
): see the information in App FeaturePython. - VistaVisibility (
Bool
): see the information in App FeaturePython.
Selection
- VistaOn Top When Selected (
Enumeration
): see the information in App FeaturePython. - VistaSelection Style (
Enumeration
): see the information in App FeaturePython.
Mostra inoltre le proprietà Vista dell'originale DatiLinked 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 DatiLinked Object by overriding its LinkedObject
attribute, or by using its setLink
method.
import FreeCAD as App
doc = App.newDocument()
bod1 = App.ActiveDocument.addObject("Part::Box", "Box")
bod2 = App.ActiveDocument.addObject("Part::Cylinder", "Cylinder")
bod1.Placement.Base = App.Vector(10, 0, 0)
bod2.Placement.Base = App.Vector(0, 10, 0)
obj1 = App.ActiveDocument.addObject("App::Link", "Link")
obj2 = App.ActiveDocument.addObject("App::Link", "Link")
obj1.LinkedObject = bod1
obj2.setLink(bod2)
obj1.Placement.Base = App.Vector(-10, -10, 0)
obj2.Placement.Base = App.Vector(10, -10, 0)
obj1.ViewObject.OverrideMaterial = True
App.ActiveDocument.recompute()
The basic App::Link
doesn't have a Proxy object so it can't be fully used for sub-classing.
Therefore, for Python subclassing, you should create the App::LinkPython
object.
import FreeCAD as App
doc = App.newDocument()
obj = App.ActiveDocument.addObject("App::LinkPython", "Link")
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:
- 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, Toggle measurement, Clear measurement
- 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, Arch, Assembly, 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