File Format FCStd/fr: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 1: Line 1:
Un projet FreeCAD, est en fait une série de fichiers texte normaux, qui contiennent toujours un fichier document '''[http://fr.wikipedia.org/wiki/Extensible_Markup_Language .xml]''', '''GuiDocument.xml Document.xml ''' et, éventuellement plusieurs fichiers de données '''PartShape3.brp Points3 . . .''', plus une vignette au format [http://fr.wikipedia.org/wiki/Portable_Network_Graphics .PNG] le tout étant compressé en un fichier [http://fr.wikipedia.org/wiki/ZIP_(format_de_fichier) .zip] auquel on remplace l'extension en '''.FCStd'''.
Un projet FreeCAD, est en fait une série de fichiers texte normaux, qui contiennent toujours un fichier document '''[http://fr.wikipedia.org/wiki/Extensible_Markup_Language .xml]''', '''GuiDocument.xml Document.xml ''' et, éventuellement plusieurs fichiers de données '''PartShape3.brp Points3 . . .''', plus une vignette au format [http://fr.wikipedia.org/wiki/Portable_Network_Graphics .PNG] le tout étant compressé en un fichier [http://fr.wikipedia.org/wiki/ZIP_(format_de_fichier) .zip] auquel on remplace l'extension en '''.FCStd'''.


Après avoir fait une '''copie''' de votre projet, procédez comme suit :
==Structure du Document.xml==

FCStd is a standard zip file, containing [[#Contents |one or more]] files in a specific [[#structure |Structure]]. 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]] below.

===Contents===
====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 xml document will be used.=

===== Example Document.xml=====
<syntaxhighlight>
<syntaxhighlight>
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
Line 95: Line 103:
</Document>
</Document>
</syntaxhighlight>
</syntaxhighlight>
==Change the source of the file .FCStd==
{{VeryImportantMessage|'''ATTENTION ALWAYS WORK ON A COPY OF YOUR PROJECT !'''}}

Il est possible de modifier le source d'un fichier .FCStd mais la procédure n'est pas sans risques c'est pour cela qu'il faut travailler sur une '''copie'''.

Après avoir fait une '''copie''' de votre projet, procédez comme suit :

Créez un nouveau répertoire et placez votre copie dans ce répertoire (il peut y avoir beaucoup de fichiers dans votre FCStd).
Créez un nouveau répertoire et placez votre copie dans ce répertoire (il peut y avoir beaucoup de fichiers dans votre FCStd).


Line 112: Line 113:
*'''GuiDocument.xml''' : contient tous les renseignements de votre projet relatifs à l'interface, affichage dans la Vue combinée, la configuration de FreeCAD . . .
*'''GuiDocument.xml''' : contient tous les renseignements de votre projet relatifs à l'interface, affichage dans la Vue combinée, la configuration de FreeCAD . . .
**Exemple avec '''Text004'''
**Exemple avec '''Text004'''

*'''Document.xml''' : contient tous les renseignements relatifs aux objets constituants votre projet.
**Exemple avec '''Text004'''

* ainsi que d'autres définitions contenants '''file=''' sont reliées a un fichier et si vous modifiez par exemple "'''DiffuseColor'''" dans '''<ColorList file="DiffuseColor"/>''' vous devez aussi modifier le nom du fichier pour la correspondance.
* Une fois que le mot à modifier est repéré, faites "'''Recherche'''" (votre mot) et "'''Remplacer par'''" (votre nouveau mot) et cliquez sur {{KEY|Remplacez dans tous les documents ouverts}} et votre changement se fera de la même manière dans les deux fichiers '''GuiDocument.xml''' et '''Document.xml'''.
* Quand les modification sont terminées, retournez à l'outil '''Menu > Outils > Utilitaire de projet... Créer un projet'''
* Source : Donnez le chemin du fichier que vous venez de modifier et qui est à reconstituer.
* Destination : Donnez le chemin du fichier FCStd à reconstituer.
* Cliquez sur {{KEY|...}} dans la nouvelle fenêtre cliquez sur {{KEY|Créez un nouveau dossier}} (pour éviter les erreurs de réécriture du fichier) et vous validez. Cliquez sur {{KEY|Créer}} vous pouvez cocher la case "Charger le fichier de projet après la création".
* Si vous avez coché la case "Charger le fichier de projet après la création" votre projet se chargera dans FreeCAD.
* '''PS :''' Il faut absolument qu'il y ai concordance entre les documents GuiDocument.xml, Document.xml et les fichiers sans quoi il y aura des erreurs dans votre fichier FCStd. Cest pour celà qu'il faut toujours travailler sur une copie de votre projet.

===Structure===
Structure of a typical FCStd file:
<syntaxhighlight>
--File.fcstd
|
--Document.xml
--GuiDocument.xml
|
--Thumbnails
|
--thumbnail.png
|
--Templates
|
--MyPage.svg
--Shape1.brep
--Shape2.brep
--etc...
</syntaxhighlight>
==Change the source of the file .FCStd==
{{VeryImportantMessage|'''ATTENTION ALWAYS WORK ON A COPY OF YOUR PROJECT !'''}}

Il est possible de modifier le source d'un fichier .FCStd mais la procédure n'est pas sans risques c'est pour cela qu'il faut travailler sur une '''copie'''.

After having made an '''copy''' of your project, follow these steps :

Create a new directory and place your copy in that directory (there may be many files in your FCStd).

* Go in '''Menu > tools > Project utility... Project utility'''
[[File:Project utility en.png|240px]]
* Source : Give your copy to unpack path.
* Destination : Give the path to the unzipped files.
* Click {{KEY|Extract}}
* Go to your directory and open both files '''GuiDocument.xml''' andt '''Document.xml''' using [http://notepad-plus-plus.org/ Notepad++] (Windows) (Notepad++ to modify a word in all open documents).
*'''GuiDocument.xml''' : contains all your project information to the interface, display in the Combo view, the configuration of FreeCAD . . .
**Example with '''Text004'''
<syntaxhighlight>
<syntaxhighlight>
<ViewProvider name="Text004">
<ViewProvider name="Text004">
Line 145: Line 195:
</ViewProvider>
</ViewProvider>
</syntaxhighlight>
</syntaxhighlight>

*'''Document.xml''' : contient tous les renseignements relatifs aux objets constituants votre projet.
*'''Document.xml''' : contains all information relating to the constituent objects your project.
**Exemple avec '''Text004'''
**Example with '''Text004'''
<syntaxhighlight>
<syntaxhighlight>
<Object type="App::Annotation" name="Text004" />
<Object type="App::Annotation" name="Text004" />
Line 178: Line 229:
. . . .
. . . .
</syntaxhighlight>
</syntaxhighlight>

* ainsi que d'autres définitions contenants '''file=''' sont reliées a un fichier et si vous modifiez par exemple "'''DiffuseColor'''" dans '''<ColorList file="DiffuseColor"/>''' vous devez aussi modifier le nom du fichier pour la correspondance.
* as well as other definitions containers '''file=''' relate has a file and if you change example "'''DiffuseColor'''" in '''<ColorList file="DiffuseColor"/>''' You must also change the name of the file for correspondence.
* Une fois que le mot à modifier est repéré, faites "'''Recherche'''" (votre mot) et "'''Remplacer par'''" (votre nouveau mot) et cliquez sur {{KEY|Remplacez dans tous les documents ouverts}} et votre changement se fera de la même manière dans les deux fichiers '''GuiDocument.xml''' et '''Document.xml'''.
* Once the Word change is identified, '''search''' (your Word) and '''Replace by''' (your new word) and click on {{KEY|Replace in all open documents}} and your change will be the same in both files '''GuiDocument.xml''' and '''Document.xml'''.
* Quand les modification sont terminées, retournez à l'outil '''Menu > Outils > Utilitaire de projet... Créer un projet'''
* When changes are complete, return to the tool '''Menu > Tools > Project utility... Create project'''
* Source : Donnez le chemin du fichier que vous venez de modifier et qui est à reconstituer.
* Source : Give the path of the file that you just changed and that is to restore.
* Destination : Donnez le chemin du fichier FCStd à reconstituer.
* Destination : Give the path of the FCStd file to restore.
* Cliquez sur {{KEY|...}} dans la nouvelle fenêtre cliquez sur {{KEY|Créez un nouveau dossier}} (pour éviter les erreurs de réécriture du fichier) et vous validez. Cliquez sur {{KEY|Créer}} vous pouvez cocher la case "Charger le fichier de projet après la création".
* Click {{KEY|...}} In the new window click on {{KEY|Create a new folder}} (to avoid errors by rewriting the file) and you post. Click on {{KEY|Create}} you can check the "Load project file after creation".
* Si vous avez coché la case "Charger le fichier de projet après la création" votre projet se chargera dans FreeCAD.
* If you have checked "Load project file after creation" your project will load in FreeCAD.
* '''PS :''' Il faut absolument qu'il y ai concordance entre les documents GuiDocument.xml, Document.xml et les fichiers sans quoi il y aura des erreurs dans votre fichier FCStd. Cest pour celà qu'il faut toujours travailler sur une copie de votre projet.
* '''PS :''' It is imperative that it have concordance GuiDocument.xml, Document.xml documents and files without which there will be errors in your .FCStd file. To do this should always work on a copy of your project.


==Liens intéressants==
==Liens intéressants==

Revision as of 19:53, 6 April 2015

Un projet FreeCAD, est en fait une série de fichiers texte normaux, qui contiennent toujours un fichier document .xml, GuiDocument.xml Document.xml et, éventuellement plusieurs fichiers de données PartShape3.brp Points3 . . ., plus une vignette au format .PNG le tout étant compressé en un fichier .zip auquel on remplace l'extension en .FCStd.

Après avoir fait une copie de votre projet, procédez comme suit :

FCStd is a standard zip file, containing one or more files in a specific Structure. 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 below.

Contents

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 xml document will be used.=

Example Document.xml
 <?xml version='1.0' encoding='utf-8'?>
 <!--
 FreeCAD Document, see http://free-cad.sourceforge.net for more informations...
 -->
 <Document SchemaVersion="4">
    <Properties Count="9">
       <Property name="Comment" type="App::PropertyString">
          <String value=""/>
       </Property>
       <Property name="Company" type="App::PropertyString">
          <String value=""/>
       </Property>
       <Property name="CreatedBy" type="App::PropertyString">
          <String value=""/>
       </Property>
       <Property name="CreationDate" type="App::PropertyString">
          <String value="Fri Jan 29 15:14:38 2010 "/>
       </Property>
       <Property name="FileName" type="App::PropertyString">
          <String value="/tmp/test.FCStd"/>
       </Property>
       <Property name="Id" type="App::PropertyString">
          <String value="201b746f-a1ed-4297-bf3d-65d5ec11abe0"/>
       </Property>
       <Property name="Label" type="App::PropertyString">
          <String value="names"/>
       </Property>
       <Property name="LastModifiedBy" type="App::PropertyString">
          <String value=""/>
       </Property>
       <Property name="LastModifiedDate" type="App::PropertyString">
          <String value="Fri Jan 29 15:15:21 2010 "/>
       </Property>
    </Properties>
    <Objects Count="2">
       <Object type="Mesh::Cube" name="Cube" />
       <Object type="Part::Box" name="Box" />
    </Objects>
    <ObjectData Count="2">
       <Object name="Cube">
          <Properties Count="7">
             <Property name="Height" type="App::PropertyFloatConstraint">
                <Float value="10"/>
             </Property>
             <Property name="Label" type="App::PropertyString">
                <String value="Cube"/>
             </Property>
             <Property name="Length" type="App::PropertyFloatConstraint">
                <Float value="10"/>
             </Property>
             <Property name="Mesh" type="Mesh::PropertyMeshKernel">
                <Mesh file="MeshKernel.bms"/>
             </Property>
             <Property name="Placement" type="App::PropertyPlacement">
                <PropertyPlacement Px="0" Py="0" Pz="0" Q0="0" Q1="0" Q2="0" Q3="1"/>
             </Property>
             <Property name="Pos" type="App::PropertyPlacementLink">
                <Link value=""/>
             </Property>
             <Property name="Width" type="App::PropertyFloatConstraint">
                <Float value="10"/>
             </Property>
          </Properties>
       </Object>
       <Object name="Box">
          <Properties Count="7">
             <Property name="Height" type="App::PropertyLength">
                <Float value="10"/>
             </Property>
             <Property name="Label" type="App::PropertyString">
                <String value="Box2"/>
             </Property>
             <Property name="Length" type="App::PropertyLength">
                <Float value="10"/>
             </Property>
             <Property name="Placement" type="App::PropertyPlacement">
                <PropertyPlacement Px="0" Py="0" Pz="0" Q0="0" Q1="0" Q2="0" Q3="1"/>
             </Property>
             <Property name="Pos" type="App::PropertyPlacementLink">
                <Link value=""/>
             </Property>
             <Property name="Shape" type="Part::PropertyPartShape">
                <Part file="PartShape.brp2"/>
             </Property>
             <Property name="Width" type="App::PropertyLength">
                <Float value="10"/>
             </Property>
          </Properties>
       </Object>
    </ObjectData>
 </Document>

Créez un nouveau répertoire et placez votre copie dans ce répertoire (il peut y avoir beaucoup de fichiers dans votre FCStd).

  • Allez dans Menu > Outils > Utilitaire de projet... Extraire le projet

  • Source : Donnez le chemin de votre copie à décompresser.
  • Destination : Donnez le chemin pour les fichiers décompressés.
  • Cliquez sur Extraire
  • Allez dans votre répertoire et ouvrez les deux fichiers GuiDocument.xml et Document.xml à l'aide de Notepad++ (Windows) (Notepad permet de modifier un mot dans tous les documents ouverts).
  • GuiDocument.xml : contient tous les renseignements de votre projet relatifs à l'interface, affichage dans la Vue combinée, la configuration de FreeCAD . . .
    • Exemple avec Text004
  • Document.xml : contient tous les renseignements relatifs aux objets constituants votre projet.
    • Exemple avec Text004
  • ainsi que d'autres définitions contenants file= sont reliées a un fichier et si vous modifiez par exemple "DiffuseColor" dans <ColorList file="DiffuseColor"/> vous devez aussi modifier le nom du fichier pour la correspondance.
  • Une fois que le mot à modifier est repéré, faites "Recherche" (votre mot) et "Remplacer par" (votre nouveau mot) et cliquez sur Remplacez dans tous les documents ouverts et votre changement se fera de la même manière dans les deux fichiers GuiDocument.xml et Document.xml.
  • Quand les modification sont terminées, retournez à l'outil Menu > Outils > Utilitaire de projet... Créer un projet
  • Source : Donnez le chemin du fichier que vous venez de modifier et qui est à reconstituer.
  • Destination : Donnez le chemin du fichier FCStd à reconstituer.
  • Cliquez sur ... dans la nouvelle fenêtre cliquez sur Créez un nouveau dossier (pour éviter les erreurs de réécriture du fichier) et vous validez. Cliquez sur Créer vous pouvez cocher la case "Charger le fichier de projet après la création".
  • Si vous avez coché la case "Charger le fichier de projet après la création" votre projet se chargera dans FreeCAD.
  • PS : Il faut absolument qu'il y ai concordance entre les documents GuiDocument.xml, Document.xml et les fichiers sans quoi il y aura des erreurs dans votre fichier FCStd. Cest pour celà qu'il faut toujours travailler sur une copie de votre projet.

Structure

Structure of a typical FCStd file:

 --File.fcstd
  |
  --Document.xml
  --GuiDocument.xml
   |
   --Thumbnails
    |
    --thumbnail.png
   |
   --Templates
    |
    --MyPage.svg
  --Shape1.brep
  --Shape2.brep
  --etc...

Change the source of the file .FCStd

ATTENTION ALWAYS WORK ON A COPY OF YOUR PROJECT !

Il est possible de modifier le source d'un fichier .FCStd mais la procédure n'est pas sans risques c'est pour cela qu'il faut travailler sur une copie.

After having made an copy of your project, follow these steps :

Create a new directory and place your copy in that directory (there may be many files in your FCStd).

  • Go in Menu > tools > Project utility... Project utility

  • Source : Give your copy to unpack path.
  • Destination : Give the path to the unzipped files.
  • Click Extract
  • Go to your directory and open both files GuiDocument.xml andt Document.xml using Notepad++ (Windows) (Notepad++ to modify a word in all open documents).
  • GuiDocument.xml : contains all your project information to the interface, display in the Combo view, the configuration of FreeCAD . . .
    • Example with Text004
		<ViewProvider name="Text004">
			<Properties Count="9">
				<Property name="DisplayMode" type="App::PropertyEnumeration">
					<Integer value="1"/>
				</Property>
				<Property name="FontName" type="App::PropertyString">
					<String value="Arial"/>
				</Property>
				<Property name="FontSize" type="App::PropertyFloat">
					<Float value="5.199999809265"/>
				</Property>
				<Property name="Justification" type="App::PropertyEnumeration">
					<Integer value="0"/>
				</Property>
				<Property name="LineSpacing" type="App::PropertyFloat">
					<Float value="0.600000023842"/>
				</Property>
				<Property name="Rotation" type="App::PropertyAngle">
					<Float value="0.000000000000"/>
				</Property>
				<Property name="RotationAxis" type="App::PropertyEnumeration">
					<Integer value="2"/>
				</Property>
				<Property name="TextColor" type="App::PropertyColor">
					<PropertyColor value="4294901760"/>
				</Property>
				<Property name="Visibility" type="App::PropertyBool">
					<Bool value="true"/>
				</Property>
			</Properties>
		</ViewProvider>
  • Document.xml : contains all information relating to the constituent objects your project.
    • Example with Text004
		<Object type="App::Annotation" name="Text004" />


		<Object name="Text004">
			<Properties Count="3">
				<Property name="Label" type="App::PropertyString">
					<String value="Text004"/>
				</Property>
				<Property name="LabelText" type="App::PropertyStringList">
					<StringList count="1">
						<String value="135"/>
					</StringList>
				</Property>
				<Property name="Position" type="App::PropertyVector">
					<PropertyVector valueX="-30.000000000000" valueY="26.000000000000" valueZ="0.000000000000"/>
				</Property>
			</Properties>
		</Object>
  • Les renseignements comme :
<VectorList file="Points1"/> 
<ColorList file="DiffuseColor"/> 
<Mesh file="MeshKernel.bms"/> 
<Part file="PartShape.brp2"/>
. . . .
  • as well as other definitions containers file= relate has a file and if you change example "DiffuseColor" in <ColorList file="DiffuseColor"/> You must also change the name of the file for correspondence.
  • Once the Word change is identified, search (your Word) and Replace by (your new word) and click on Replace in all open documents and your change will be the same in both files GuiDocument.xml and Document.xml.
  • When changes are complete, return to the tool Menu > Tools > Project utility... Create project
  • Source : Give the path of the file that you just changed and that is to restore.
  • Destination : Give the path of the FCStd file to restore.
  • Click ... In the new window click on Create a new folder (to avoid errors by rewriting the file) and you post. Click on Create you can check the "Load project file after creation".
  • If you have checked "Load project file after creation" your project will load in FreeCAD.
  • PS : It is imperative that it have concordance GuiDocument.xml, Document.xml documents and files without which there will be errors in your .FCStd file. To do this should always work on a copy of your project.

Liens intéressants

D'autres renseignements sur le format Fcstd.

Ici, un utilitaire convertisseur de fichiers ImageConv.