Std LinkMake/it: Difference between revisions

From FreeCAD Documentation
No edit summary
No edit summary
Line 57: Line 57:
* {{PropertyData|Proxy|PythonObject|Hidden}}: a custom class associated with this object. This only exists for the [[Python|Python]] version. See [[Std_LinkMake#Scripting|Scripting]].
* {{PropertyData|Proxy|PythonObject|Hidden}}: a custom class associated with this object. This only exists for the [[Python|Python]] version. See [[Std_LinkMake#Scripting|Scripting]].


L'oggetto [[App_Link/it|App Link]] mostra inoltre le proprietà del {{PropertyData|Linked Object}} originale, quindi l'[[property_editor/it|editor delle proprietà]] può avere gruppi di proprietà come {{TitleProperty|Attachment}} , {{TitleProperty|Box}}, {{TitleProperty|Draft}} e così via.
<div class="mw-translate-fuzzy">
Mostra inoltre le proprietà Dati dell'originale {{PropertyData|Linked Object}}.
</div>


===Vista===
===Vista===

Revision as of 19:45, 11 September 2020

Crea link

Posizione nel menu
None
Ambiente
Tutti
Avvio veloce
Nessuno
Introdotto nella versione
0.19
Vedere anche
Std Part, Std Group, PartDesign Body

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.

I collegamenti si riferiscono al corpo completo. Per creare schiere di funzioni all'interno dello stesso Corpo di PartDesign, usare Serie rettangolare, Serie polare, e Multi trasformazione.

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.

Utilizzo

Con selezione:

  1. Selezionare un oggetto nella vista ad albero o nella vista 3D per il quale si desidera creare un link.
  2. 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.

Without selection:

  1. If no object is selected, press the Std LinkMake button to create an empty Link.
  2. Go to the property editor, then click on the DatiLinked Object property to open the Link selection dialog to choose an object, then press OK.
  3. 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.

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.

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

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("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()

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:

Finally, the pull request and merge happened: