# File Format FCStd ## Overview The **FreeCAD Standard file format** (**.FCStd**) is FreeCAD\'s main file format. It is a compound format, supports compression and embedding of different kinds of data. ## Internals of .FCStd files FCStd is a [standard zip file containing one or more files in a specific structure](#Typical_structure.md). As such, it is possible to unpack a **.FCStd** file using a regular zip decompression tool, but care needs to be taken while packing the contents of a **.FCStd** file. FreeCAD contains a \"Project Utility\" to re-pack **.FCStd** files, it\'s use is described in [Change the source of the file .FCStd](#Change_the_source_of_the_file_.FCStd.md) below. ### Document.xml This is the main **.xml** file describing all the objects inside a FreeCAD document, that is, only the geometric and parametric definition of the objects, not their visual representation. If FreeCAD is ran in console mode (without the GUI), only this **Document.xml** will be used. #### Example Document.xml {{Code|lang=xml|code= }} ### GuiDocument.xml This is the GUI counterpart of the **Document.xml** file. For each object described in the **Document.xml**, there is one corresponding object in **GuiDocument.xml**, describing the visual representation of that object (color, linewidth, etc). ### Thumbnails/thumbnail.png This is a 128x128 pixels thumbnail image of the document, which is a screenshot of the 3D view at save time. Thumbnails are generated only if the corresponding option is enabled in the FreeCAD preferences. ### \*.brep These are the [B-rep](wikipedia_Boundary_representation.md) shapes of all objects that have a Part shape in the **Document.xml**. Each object, even if it is parametric, has its shape stored as an individual **.brep** file, so it can be accessed by components without the need to recalculate the shape. ### \*.svg These are the template svg files used in [TechDraw](TechDraw_Workbench.md) pages. ### Typical structure Structure of a typical **.FCStd** file. The extension can be changed to **.zip** to explore it like a normal directory. The **Document.xml** and **GuiDocument.xml** are at the root of the archive, together with any number of **.brp** (BREP) files. One subdirectory may hold the thumbnail, and another the SVG templates used by [TechDraw](TechDraw_Workbench.md). File.FCStd (File.zip) | |--thumbnails/ | | | :--Thumbnail.png | :--Document.xml :--GuiDocument.xml :--Shape1.brp :--Shape2.brp :--MyPage.svg :--etc. ## Embedding other files In order to embed other file types inside a FCStd file, you must first create a [scripted object](Scripted_objects.md) from the [Python console](Python_console.md), and give it an `App::PropertyFileIncluded` property. Then in the [property editor](Property_editor.md) you can go to the added property and choose a file in the computer. Once the FCStd file is saved, the file assigned to the **PropertyFileIncluded** property will be packed inside the `.FCStd`. When the document is restored, the same file will be restored with the **PropertyFileIncluded** property. ```python custom_obj = App.ActiveDocument.addObject("App::FeaturePython", "CustomObject") custom_obj.addProperty("App::PropertyFileIncluded", "AttachedFile") ``` See the forum thread, [PDF inside the project](https://forum.freecadweb.org/viewtopic.php?t=38201). ## Change the source of the file .FCStd - See [Std ProjectUtil](Std_ProjectUtil.md). --- ⏵ [documentation index](../README.md) > [Developer](Category_Developer.md) > [Developer Documentation](Category_Developer%20Documentation.md) > [File_Formats](Category_File_Formats.md) > File Format FCStd