Struktura dokumentu

From FreeCAD Documentation
Revision as of 23:47, 27 May 2010 by Kwahoo (talk | contribs) (Created page with 'left Dokument FreeCADa zawiera wszystkie obiekty twojej sceny. Może zawierać grupy i obiekty wykonane w dowolnym warsztacie. Dlatego możesz p…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Screenshot treeview.jpg

Dokument FreeCADa zawiera wszystkie obiekty twojej sceny. Może zawierać grupy i obiekty wykonane w dowolnym warsztacie. Dlatego możesz przełączać się między warsztatami, ciągle pracując z tym samym dokumentem. Dokument jest tym co zostaje zapisane na dysku kiedy zahowujesz swoją pracę. Możesz także uruchomić kilka dokumentów jednocześnie i kilka widoków tego samego dokumentu.

W środku dokumentu obiekty magą być przesunięte do grup i posiadać unikalną nazwę. Zarządzanie grupami, obiektami i nazwami obiektów dokonywane jest głównie przez Drzewo widoku (Tree view). Jak wszystko we FreeCADzie, można dokonać tego przez interpreter Pythona. W Drzewie widoku możesz tworzyć grupy, przesuwać obiekty do grup, usuwać obiekty lub grupy przez kliknięcie prawym przyciskiem na drzewo lub obiekt, zmieniać nazwy przez podwójne kliknięcie na ich nazwy lub dokonywać innych operacji - zależnie od warsztatu.

The objects inside a FreeCAD document can be of different types. Each workbench can create its own types of objects, for example the Mesh Workbench creates mesh objects, the Part Workbench create Part objects, the Draft Workbench also creates Part objects, etc.

If there is at least one document open in FreeCAD, there is always one and only one active document. That's the document that appears in the current 3D view, the document you are currently working on.

Application and User Interface

Like almost everything else in FreeCAD, the user interface part (Gui) is separated from the base application part (App). This is also valid for documents. The documents are also made of two parts: the Application document, which contains our objects, and the View document, which contains the representation on screen of our objects.

Think of it as two spaces, where the objects are defined. Their constructive parameters (is it a cube? a cone? which size?) are stored in the Application document, while their graphical representation (is it drawn with black lines? with blue faces?) are stored in the View document. Why is that? Because FreeCAD can also be used WITHOUT graphical interface, for example inside other programs, and we must still be able to manipulate our objects, even if nothing is drawn on the screen.

Another thing that is contained inside the View document are 3D views. One document can have several views opened, so you can inspect your document from several points of view at the same time. Maybe you would want to see a top view and a front view of your work at the same time? Then, you will have two views of the same document, both stored in the View document. Create new views or close views can be done from the View menu or by right-clicking on a view tab.

Scripting

Documents can be easily created, accessed and modified from the python interpreter. For example:

FreeCAD.ActiveDocument

Will return the current (active) document

FreeCAD.ActiveDocument.Blob

Would access an object called "Blob" inside your document

FreeCADGui.ActiveDocument

Will return the view document associated to the current document

FreeCADGui.ActiveDocument.Blob

Would access the graphical representation (view) part of our Blob object

FreeCADGui.ActiveDocument.ActiveView

Will return the current view