Puesta en marcha y Configuración
Esta página muestra las diferentes formas de iniciar FreeCAD y las características de configuración más importantes.
Iniciando FreeCAD desde la línea de comandos
FreeCAD puede iniciarse normalmente, haciendo doble clic en el icono del escritorio o seleccionándolo en el menú de inicio, pero también sr puede iniciar directamente desde la línea de comandos. Esto te permite cambiar algunos de las opciones por defecto de inicio.
Opciones de la línea de comandos
Las opciones de la línea de comandos están sujetas a frecuentes cambios, por tanto es una buena idea comprobar las opciones actuales escribiendo:
FreeCAD --help
En la respuesta puedes leer los posibles parámetros:
Usage: FreeCAD [options] File1 File2 ..... Allowed options: Generic options: -v [ --version ] print version string -h [ --help ] print help message -c [ --console ] start in console mode Configuration: -l [ --write-log ] arg write a log file -t [ --run-test ] arg test level -M [ --module-path ] arg additional module paths -P [ --python-path ] arg additional python paths --response-file arg can be specified with '@name', too
Respuesta y archivos de configuración
FreeCAD puede leer algunas de estas opciones de un archivo de configuración. Este archivo debe estar en el directorio bin y debe llamarse FreeCAD.cfg. Ten en cuenta que las opciones que especifiques en la línea de comando sobrescriben el archivo de configuración!
Algunos sistemas operativos tienen límites de longitud muy bajos para la línea de comandos. El modo más habitual de evitar esas limitaciones es utilizar un archivo de respuesta. Un archivo de respuesta es simplemente un archivo de configuración que utiliza la misma sintaxis que la línea de comandos. Si la línea de comandos especifica un nombre de archivo de respuesta a utilizar, es cargado y analizado sintáticamente en adición a la línea de comandos:
FreeCAD @ResponseFile.txt
o:
FreeCAD --response-file=ResponseFile.txt
Opciones ocultas
Existen varias opciones no visibles por el usuario. Estas opciones son por ejemplo los parámetros de X-Window analizados por el sistema Windows:
- -display display, establece la visualización de X (por defecto es $DISPLAY).
- -geometry geometry, establece la geometría cliente de la primera ventana que es mostrada.
- -fn or -font font, Define la fuente de letra de la aplicación. La fuente de letra debería estar especificada utilizando una descripción de fuente lógica de X.
- -bg or -background color, establece el color de fondo por defectoy una paleta para la aplicación (se calculan las sombras iluminadas y oscuras).
- -fg or -foreground color, establece el color de primer planor.
- -btn or -button color, establece el color por defecto de los botones.
- -name name, establece el nombre de la aplicación.
- -title title, establece el título de la aplicación.
- -visual TrueColor, fuerza a la aplicación a utilizar la visualización TrueColor en una visualización de 8-bit.
- -ncols count, limita el número de colores asignados en el cubo de color de visualización de 8-bit, si la aplicación está utilizando la especificación del color QApplication::ManyColor. Si el computo es 216 entonces se utiliza un cubo de color de 6x6x6 (por ejemplo 6 niveles de rojo, 6 de verde y 6 de azul); para otros valores, se utiliza un cubo aproximadamente proporcional a un cubo de 2x3x1.
- -cmap, cause que la aplicación instale un mapa de color privado en una visualización de 8-bit.
Ejecución de FreeCAD sin interfaz de usuario
FreeCAD normalmente se inicia en el modo de interfaz de usuario gráfico GUI, pero puedes forzar que inicie en modo consola escribiendo:
FreeCAD -c
desde la línea de comandos. En el modo consola, no se mostrará el interfaz de usuario, y tendrás presente la consola del interprete de Python. Desde ella tienes la misma funcionalidad que desde el interprete de Python que se ejecuta dentro del interfaz de usuario gráfico GUI de FreeCAD, y acceso normal a todos los módulos y plugins de FreeCAD, exceptuando el módulo FreeCADGui. Ten en cuenta que los módulos que dependan del FreeCADGui podrían tampoco estar disponibles.
Ejecución de FreeCAD como un módulo de Python
FreeCAD can also be used to run as a python module inside other applications that use python or from an external python shell. For that, the host python application must know where your FreeCAD libs reside. The best way to obtain that is to temporarily append FreeCAD's lib path to the sys.path variable. The following code typed from any python shell will import FreeCAD and let you run it the same way as in console mode:
import sys
sys.path.append("path/to/FreeCAD/lib") # change this by your own FreeCAD lib path
import FreeCAD
Once FreeCAD is loaded, it is up to you to make it interact with your host application in any way you can imagine!
The Config set
On every Startup FreeCAD examines its surrounding and the command line parameters. It builds up a configuration set which holds the essence of the runtime information. This information is later used to determine the place where to save user data or log files. It is also very important for post postmortem analyzes. Therefore it is saved in the log file.
Config var name | Synopsis | Example M$ | Example Posix (Linux) |
---|---|---|---|
UserAppData | Path where FreeCAD stores User Related application data. | C:\Documents and Settings\username\Application Data\FreeCAD | /home/username/.FreeCAD |
UserParameter | File where FreeCAD stores User Related application data. | C:\Documents and Settings\username\Application Data\FreeCAD\user.cfg | /home/username/.FreeCAD/user.cfg |
SystemParameter | File where FreeCAD stores Application Related data. | C:\Documents and Settings\username\Application Data\FreeCAD\system.cfg | /home/username/.FreeCAD/system.cfg |
UserHomePath | Home path of the current user | C:\Documents and Settings\username\My Documents | /home/username |
Command line arguments
Config var name | Synopsis | Example |
---|---|---|
LoggingFile | 1 if the logging is switched on | 1 |
LoggingFileName | File name where the log is placed | C:\Documents and Settings\username\Application Data\FreeCAD\FreeCAD.log |
RunMode | This indicates how the main loop will work. "Script" means that the given script is called and then exit. "Cmd" runs the command line interpreter. "Internal" runs an internal script. "Gui" enters the Gui event loop. "Module" loads a given python module. | "Cmd" |
FileName | Meaning depends on the RunMode | |
ScriptFileName | Meaning depends on the RunMode | |
Verbose | Verbosity level of FreeCAD | "" or "strict" |
OpenFileCount | Holds the number of files opened through command line arguments | "12" |
AdditionalModulePaths | Holds the additional Module paths given in the cmd line | "extraModules/" |
Config var name | Synopsis | Example M$ | Example Posix (Linux) |
---|---|---|---|
AppHomePath | Path where FreeCAD is installed | c:/Progam Files/FreeCAD_0.7 | /user/local/FreeCAD_0.7 |
PythonSearchPath | Holds a list of paths which python search modules. This is at startup can change during execution |
Some libraries need to call system environment variables. Sometimes when there is a problem with a FreeCAD installation, it is because some environment variable is absent or set wrongly. Therefore, some important variables get duplicated in the Config and saved in the log file.
Python related environment variables:
- PYTHONPATH
- PYTHONHOME
- TCL_LIBRARY
- TCLLIBPATH
OpenCascade related environment variables:
- CSF_MDTVFontDirectory
- CSF_MDTVTexturesDirectory
- CSF_UnitsDefinition
- CSF_UnitsLexicon
- CSF_StandardDefaults
- CSF_PluginDefaults
- CSF_LANGUAGE
- CSF_SHMessage
- CSF_XCAFDefaults
- CSF_GraphicShr
- CSF_IGESDefaults
- CSF_STEPDefaults
System related environment variables:
- PATH
The table below shows the availible informations about the Build version. Most of it comes from the Subversion repository. This stuff is needed to exactly rebuild a version!
Config var name | Synopsis | Example |
---|---|---|
BuildVersionMajor | Major Version number of the Build. Defined in src/Build/Version.h.in | 0 |
BuildVersionMinor | Minor Version number of the Build. Defined in src/Build/Version.h.in | 7 |
BuildRevision | SVN Repository Revision number of the src in the Build. Generated by SVN | 356 |
BuildRevisionRange | Range of differnt changes | 123-356 |
BuildRepositoryURL | Repository URL | https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk/src |
BuildRevisionDate | Date of the above Revision | 2007/02/03 22:21:18 |
BuildScrClean | Indicates if the source was changed ager checkout | Src modified |
BuildScrMixed | Src not mixed |
These Config entries are related to the branding mechanism of FreeCAD. See Branding for more details.
Config var name | Synopsis | Example |
---|---|---|
ExeName | Name of the build Executable file. Can diver from FreeCAD if a different main.cpp is used. | FreeCAD.exe |
ExeVersion | Over all Version shows up at start time | V0.7 |
AppIcon | Icon which is used for the Executable, shows in Application MainWindow. | "FCIcon" |
ConsoleBanner | Banner which is prompted in console mode | |
SplashPicture | Name of the Icon used for the Splash Screen | "FreeCADSplasher" |
SplashAlignment | Alignment of the Text in the Splash dialog | Left" |
SplashTextColor | Color of the splasher Text | "#000000" |
StartWorkbench | Name of the Workbech which get started automaticly after Startup | "Part design" |
HiddenDockWindow | List of dockwindows (separated by a semicolon) which will be disabled | "Property editor" |