Macro Build Utility/it

Descrizione
Questa macro è destinata ad essere utilizzata su grandi progetti, quelli che coinvolgono centinaia di oggetti. È inutile e superfluo utilizzarla su un piccolo progetto con un unico file. Su un grande progetto con molti oggetti e molti file da unire in quello finale, fa risparmiare tempo, evita le azioni ripetitive ed elimina gli errori umani.

Installazione
Tutto il codice di buildUtility.FCMacro è contenuto in una macro, quindi per installarla basta copiare il suo codice nella appropriata directory delle Macro. Dopo, si può invocare Build Utility dal menu Macro, dalla console Python o da un pulsante della barra degli strumenti (il metodo preferito).
 * per informazioni su come installare il codice delle macro vedere la pagina Come installare le macro
 * per informazioni su come installarla abbinata a un pulsante in una barra degli strumenti vedere la pagina Personalizzare la barra degli strumenti

Uso
Build Utility lavora sugli stessi principi dei file di costruzione che vengono utilizzati per assemblare i grandi sistemi software (come FreeCAD). Si utilizza un editor di testo per creare un file di testo che aderisce ai formati richiesti da Build Utility, poi Build Utility legge semplicemente ogni riga del file di testo ed esegue le azioni specificate.

The macro asks the user for a "build file". It then parses that build file, there are 3 legal line types: Note: the "@" character is for future enhancement when sub-build files will be handled
 * lines starting with the comment character "#" which are ignored as being comments or remarks
 * lines starting with the subfile character "@" which are ignored
 * all other lines which may be a project file or a sub-directory

L'estensione per il file Utility Build è ".FCBld". Questo serve ad evitare che il file sia usato impropriamente da altre applicazioni.

Any file specified in the build file is assumed to have the extension ".FCStd" If the line starts with a directory then the project file is read from that subfolder. Otherwise it is assumed the line specifies a project file. Directories within directories are supported so nesting of arbitrary depths is possible. The file specification format is the "Unix" style with different levels separated by the forward slash character "/".

Qualsiasi file mancante viene stampato nella Vista Report. Ogni directory mancante è stampata nella Vista Report.

A new document is created and each project is "Project Merged" into that new and empty document. The document is not saved at the end, this is left for the user if desired. If the file does not exist then the file name is Printed to the Report view

User Interface
There really isn't a GUI at all for this macro. The macro reads a text file that has been prepared with a text editor and produces a model in an output document. Other than clicking the button on the toolbar to start the process, there is no user interaction.

Example
You are working with some other departments in your company to use FreeCAD to generate a large CAD model for an external client. To prepare for the upcoming presentation you need to integrate the models represented in the 'black' and 'blue' subsystems, the engineering department has responsibility for the 'green' and 'grey' subsystems and you have the 'metal' subsystem on your own computer. The client also uses FreeCAD and your design must integrate with their subsystems "red', and 'yellow'. The external client has told you that the Stacker Assembly is not ready for you to use so you comment it out in your build file.

There are a lot of directory paths to type in so you enter the commands into the Build Utility text file which means you can run it with a single click on a toolbar button.



The contents of the build file "buildFile.FCBld" shown below shows the file structure for the project described above.

A summary of the file and how it is processed is:
 * the first two lines are treated as comments and everything following the initial character of the hash sign is ignored


 * the third line is also ignored because it's first character is the ampersand character which is reserved for future use where command files can invoke other commend files


 * the fifth line is the first file specification, the file is in the same directory as the build file, not in a sub-directory


 * the seventh and eighth lines are both file specifications where the file is in a sub-directory, note that the sub-directory is of the form "./black/" where "black" is the directory name, so a file called "sheetFold.FCstd" in the directory "outsourcing" would appear "./outsourcing/sheetFold"


 * the nineteenth line shows a file specification which exists but is not being included in this build operation


 * the last two lines show file specifications where the file is in more than one level of sub-directory

Options
There is no GUI so there are no options. The only alternatives that exist are by using the 3 types of lines in the text file as described above.

Remarks
To reiterate what was stated at the outset, there is no use for this macro on a small single file model. But for persons modeling a plane, locomotive, ship, building, physical plant, complex circuity there is a definitive use and advantage. By choosing the ".FCBld" file extension it is hoped a standard of sorts can be set for build files within FreeCAD. By reserving the "@" prefix character in the command file definition it is hoped that future use and (if needed) growth can be accommodated.

Links
none (so far)