Edytor właściwości

From FreeCAD Documentation
Revision as of 19:10, 9 December 2019 by Kaktus (talk | contribs) (Created page with "===Widok===")

Wprowadzenie

Edytor property editor pojawia się, gdy aktywna jest zakładka Model widoku łączonego. Umożliwia zarządzanie publicznie eksponowanymi właściwościami obiektów w dokumencie.

Ogólnie rzecz biorąc, edytor właściwości jest przeznaczony do obsługi tylko jednego obiektu w tym samym czasie. Wartości wyświetlane w edytorze właściwości należą do wybranego obiektu aktywnego dokumentu. Mimo to, niektóre właściwości, takie jak kolory, mogą być ustawione dla wielu zaznaczonych obiektów. Jeśli nie ma zaznaczonych elementów, edytor właściwości będzie pusty.

Nie wszystkie właściwości mogą być zawsze modyfikowane. W zależności od określonego statusu właściwości, niektóre z nich będą niewidoczne (nie wymienione) lub będą tylko do odczytu (nie edytowalne).

File:FreeCAD Properties empty.png

Pusty edytor właściwości, gdy żaden obiekt nie jest zaznaczony.

Typy właściwości

Właściwość jest informacją taką jak numer lub ciąg znaków dołączony do dokumentu FreeCAD lub obiektu w dokumencie.

Własny obiekt skryptowy może używać dowolnych typów właściwości zdefiniowanych w systemie bazowym. Zobacz pełną listę Właściwości.

Niektóre z najczęściej używanych typów właściwości to właśnie:

App::PropertyBool
App::PropertyFloat
App::PropertyAngle
App::PropertyDistance
App::PropertyInteger
App::PropertyString
App::PropertyMatrix
App::PropertyVector
App::PropertyPlacement

Różne obiekty mogą mieć różne typy właściwości. Jednak wiele obiektów ma te same typy, ponieważ pochodzą one z tej samej klasy wewnętrznej. Na przykład, większość obiektów opisujących kształty geometryczne (linie, okręgi, prostokąty, bryły, importowane części itp.) ma właściwość Położenie, która określa ich położenie w widoku 3D.

Właściwości widoku i danych

Istnieją dwie klasy właściwości obiektu dostępne poprzez zakładki w edytorze właściwości:

  • View właściwości związane z wizualnym wyglądem obiektu. Właściwości View są związane z ViewProvider (atrybut obiektu ViewObject) i są dostępne tylko wtedy, gdy załadowany jest graficzny interfejs użytkownika (GUI). Nie są one dostępne przy korzystaniu z FreeCAD w trybie konsolowym lub jako biblioteka zasobów własnych.
  • Data właściwości związane z parametrami "fizycznymi" obiektu. Właściwości Data definiują podstawowe właściwości obiektu. Istnieją przez cały czas, nawet gdy FreeCAD jest używany w trybie konsolowym lub jako biblioteka. Oznacza to, że jeśli załadujesz dokument w trybie konsolowym, możesz edytować promień okręgu lub długość linii, nawet jeśli nie widzisz wyniku na ekranie.

Z tego powodu właściwości Data są uważane za bardziej realne, ponieważ naprawdę definiują geometrię kształtu. Z drugiej strony, właściwości View są mniej ważne, ponieważ wpływają jedynie na wygląd geometrii. Na przykład okrąg o promieniu 10mm różni się od okręgu o promieniu 5mm. Kolor okręgu (właściwość widoku) nie ma wpływu na jego kształt, ale promień ma (właściwość danych). W wielu przypadkach w niniejszej dokumentacji słowo właściwość jest rozumiane jako odnoszące się do Właściwości danych.

Własności podstawowe

Najprostszy obiekt skryptowy nie pokaże żadnej właściwości Data w edytorze właściwości, z wyjątkiem atrybutu Label. Label jest edytowalnym łańcuchem użytkownika, który identyfikuje obiekt w widoku drzewa. Z drugiej strony, atrybut Name obiektu jest przypisany w momencie jego utworzenia i nie może być zmieniony. Atrybut ten jest tylko do odczytu i również nie jest wyświetlany w edytorze właściwości.

Podstawowy obiekt parametryczny jest tworzony w następujący sposób.

obj = App.ActiveDocument.addObject("App::FeaturePython")
obj.Label = "Plain_object"
print(obj.Name)

File:FreeCAD Properties View basic.png File:FreeCAD Properties Data basic.png

Zakładki Widok i Dane edytora właściwości, dla podstawowego obiektu skryptowego App::FeaturePython.

Most geometrical objects that can be created and displayed in the 3D view are derived from a Part::Feature. See Part Feature for the most basic properties that these objects have.

For 2D geometry, most objects are derived from Part::Part2DObject (itself derived from Part::Feature) which is the base of Sketches, and most Draft elements. See Part Part2DObject for the most basic properties that these objects have.

Actions

Actions in the property view were implemented in 0.19.

Right clicking in an empty space of the view, or with a property selected, shows only one command:

  • Show all: if active, in addition to the standard properties that appear already, it shows all the hidden Data and View properties in their respective tabs.
    • Data: "Proxy", "Label2", "Expression Engine", and "Visibility".
    • View: "Proxy".

When the Show all option is active, and one property is selected, more actions are available with a second right click:

  • Show all: deactivates the Show all command, hiding the additional Data and View properties.
  • Add Property: adds a dynamic property to the object; this works with both C++ and Python scripted objects.
  • Expression: brings up the formula editor, which allows using expressions in the property value.
  • Hidden: if active, sets the property as hidden, meaning that it will only be displayed if Show all is active.
  • Output: if active, sets the property as output.
  • NoRecompute: if active, sets the property as not recomputed when the document is recomputed; this is useful when a property should be kept unaffected by other updates.
  • ReadOnly: if active, sets the property to be read-only; it won't be editable any more until this switch is turned off.
  • Transient: if active, sets the property as transient.
  • Touched: if active, it becomes touched, and ready for recompute.
  • EvalOnRestore: if active, it is evaluated when the document is restored.

Przykładowe właściwości obiektu z PartDesign

Widok

Base

  • WIDOKBounding Box: Indicates if a box showing the overall extent of the object is to be displayed. Value False, or True (Default, False).
  • WIDOKControl Point: Indicates if the feature control points are to be displayed. Value False, or True (Default, False).
  • WIDOKDeviation: Sets the accuracy of the polygonal representation of the model in the 3d view (tessellation). Lower values = better quality. The value is in percent of object's size (deviation in mm = (w+h+d)/3*valueInPercent/100, where w,h,d are the bounding box dimensions).
  • WIDOKDisplay Mode: Display mode of the feature, Flat lines, Shaded, Wireframe, Points . (Default, Flat lines).
  • WIDOKLighting: Lighting One side, Two side . (Default, Two side).
  • WIDOKLine Color: Gives the color of the line (edges) (Default, 25, 25, 25).
  • WIDOKLine Width: Gives the thickness of the line (edges) (Default, 2).
  • WIDOKPoint Color: Gives the color of the points (ends of the feature) (Default, 25, 25, 25).
  • WIDOKPoint Size: Gives the size of the points (Default, 2).
  • WIDOKSelectable: Allows selection of the feature. Value False, ou True (Default, True).
  • WIDOKShape Color: Give the color shape (default, 204, 204, 204).
  • WIDOKTransparency: Sets the degree of transparency in the feature of 0 to 100 (Default, 0).
  • WIDOKVisibility: Determines the visibility of the feature (like the bar SPACE). Value False, or True (Default, True).

Data

Base

  • DANEPlacement:

Summary of the data below. Every feature has a placement that can be controlled through the Data Properties table. It controls the placement of the part with respect to the coordinate system. NOTE: The placement properties do not affect the physical dimensions of the feature, but merely its position in space!
If you select the title Placement Options Placement, a button with three small points appears to the right. Clicking this button ..., opens the Tasks_Placement options window.

  • DANEAngle:

Specifies the angle to be used with the axis property (below). An angle is set here, and the axis that the angle acts upon is set with the axis property. The feature is rotated by the specified angle, about the specified axis. A usage example might be if you created a revolution feature as required, but then needed to rotate the whole feature by some amount, in order to allow it to line-up with another pre-existing feature.

  • DANEAxis:

This property specifies the axis/axes about which the feature is to be rotated. The exact value of rotation comes from the angle property (above). This property takes three arguments, which are passed as numbers in the x, y, and z boxes in the tool. Setting a value for more than one of the axes will cause the part to be rotated in each axis, by the angle value multiplied by the value for the axis. For example, with an angle of 15° set, specifying a value of 1.0 for x, and 2.0 for y will cause the finished part to be rotated 15° in the x-axis AND 30° in the y-axis.

  • DANEPosition:

This property specifies the base point to which all dimensions refer. This takes three arguments, which are passed as numbers to the x, y, and z boxes in the tool. Setting a value for more than one of the boxes will cause the part to be translated by the number of units along the corresponding axis.

  • DANELabel:

The Label is the name given to the object (feature), this name can be changed as desired.


Template:Interface