FreeCAD Logo FreeCAD 1.0
  • Engelska Afrikaans Arabiska Belarusian Katalanska Tjeckiska Tyska Grekiska Spanska Spanska Baskisk Finska Filippinska Franska Galiciska Kroatiska Ungerska Indonesiska Italienska Japanska Kabyliska Koreansk Litauiska Nederländska Norwegian Bokmal Polska Portugisiska Portugisiska Rumänska Ryska Slovakiska Slovenska Serbiska Svenska Turkiska Ukrainska Valencianska Vietnamesiska Kinesiska Kinesiska
  • Funktioner
  • Hämta
  • Blogg
  • Dokumentation
    Documentation index Kom igång Användardokumentation FreeCAD-manualen Dokumentation för arbetsytor Python coding documentation C++ coding documentation Övningar Frequently asked questions Privacy policy Om FreeCAD
  • Bidra
    Hur hjälper du till Sponsor Report a bug Make a pull request Jobs and funding Contribution guidelines Developers handbook Översättningar
  • Gemenskap
    Code of conduct Forum The FPA GitHub GitLab Codeberg Mastodon Matrix IRC IRC via Webchat Gitter Discord Reddit Twitter Facebook LinkedIn Calendar
  • ♥ Donate

Donate

$
SEPA Information
Ställ in din SEPA-banköverföring till:
Beneficiary: The FreeCAD project association
IBAN: BE04 0019 2896 4531
BIC/SWIFT: GEBABEBBXXX
Bankombud: BNP Paribas Fortis
Adress: Rue de la Station 64, 1360 Perwez, Belgium

While Stripe doesn't support monthly donations, you can still become a sponsor! Simply make a one-time donation equivalent to 12 months of support, and you'll gain access to the corresponding sponsoring tier. It's an easy and flexible way to contribute.

If you are not sure or not able to commit to a regular donation, but still want to help the project, you can do a one-time donation, of any amount.

Choose freely the amount you wish to donate one time only.

You can support FreeCAD by sponsoring it as an individual or organization through various platforms. Sponsorship provides a steady income for developers, allowing the FPA to plan ahead and enabling greater investment in FreeCAD. To encourage sponsorship, we offer different tiers, and unless you choose to remain anonymous, your name or company logo will be featured on our website accordingly.

from 1 USD / 1 EUR per month. You will not have your name displayed here, but you will have helped the project a lot anyway. Together, normal sponsors maintain the project on its feet as much as the bigger sponsors.

from 25 USD / 25 EUR per month. Your name or company name is displayed on this page.

from 100 USD / 100 EUR per month. Your name or company name is displayed on this page, with a link to your website, and a one-line description text.

from 200 USD / 200 EUR per month. Your name or company name and logo displayed on this page, with a link to your website and a custom description text. Companies that have helped FreeCAD early on also appear under Gold sponsors.

Instead of donating each month, you might find it more comfortable to make a one-time donation that, when divided by twelve, would give you right to enter a sponsoring tier. Don't hesitate to do so!

Choose freely the amount you wish to donate each month.

Please inform your forum name or twitter handle as a notein your transfer, or reach to us, so we can give you proper credits!

Import Export Preferences
Scripting and macros
Index
In FreeCAD version 0.20 the default location of the program's configuration, data and cache files was changed for Linux.
See Release notes 0.20 for more information. This page has not yet been updated accordingly.

Overview

Denna sida visar olika sätt att starta FreeCAD och de viktigaste konfigurationsegenskaperna.

Starta FreeCAD från Kommandoraden

FreeCAD kan startas normalt, genom att dubbelklicka på dess skrivbordsikon eller genom att välja den från startmenyn, men det kan också startas direkt från kommandoraden. Detta tillåter dig att ändra några av standard uppstartsalternativen.

Using command line options without a command line shell

  • On Ubuntu you can create a desktop icon and edit its properties. Add the command line options separated by spaces behind the program name in the "Command" field.
  • On Windows create a shortcut and edit the properties. Add the command line options separated by spaces to "Target" field.

Kommandoradsalternativ

Kommandoradsalternativen förändras ofta, så därför är det en bra ide att kontrollera alternativen genom att skriva:

FreeCAD --help

Från svaret kan du läsa de möjliga parametrarna:

 Usage: FreeCAD [options] File1 File2 ...
 
 Allowed options:
 
 Generic options:
   -v [ --version ]          Prints version string
   --verbose                 Prints verbose version string
   -h [ --help ]             Prints help message
   -c [ --console ]          Starts in console mode
   --response-file arg       Can be specified with '@name', too
   --dump-config             Dumps configuration
   --get-config arg          Prints the value of the requested configuration key
   --set-config arg          Sets the value of a configuration key
   --keep-deprecated-paths   If set then config files are kept on the old 
                             location
 
 Configuration:
   -l [ --write-log ]        Writes FreeCAD.log to the user directory.
   --log-file arg            Unlike --write-log this allows logging to an 
                             arbitrary file
   -u [ --user-cfg ] arg     User config file to load/save user settings
   -s [ --system-cfg ] arg   System config file to load/save system settings
   -t [ --run-test ] arg     Run a given test case (use 0 (zero) to run all 
                             tests). If no argument is provided then return list
                             of all available tests.
   -r [ --run-open ] arg     Run a given test case (use 0 (zero) to run all 
                             tests). If no argument is provided then return list
                             of all available tests.  Keeps UI open after 
                             test(s) complete.
   -M [ --module-path ] arg  Additional module paths
   -P [ --python-path ] arg  Additional python paths
   --single-instance         Allow to run a single instance of the application
   --safe-mode               Force enable safe mode
   --pass arg                Ignores the following arguments and pass them 
                             through to be used by a script

In the following table, selected options are described in more detail:

Long option Corresponding config var name Synopsis
--user-cfg <filename> UserParameter Filename or relative path that ends with a filename. Defaults to user.cfg.
--module-path <dir> Prepends to AdditionalModulePaths Directory that contains modules. This option can be given repeatedly to specify multiple directories.
--get-config <config-var-name> most Outputs the requested value in a popup dialog. Exits upon confirmation with OK. Cannot be used repeatedly. If an unknown/illegal variable name is used, the response is empty. The --console flag is not honored.

Options can written in two forms: --long-option arg and --long-option=arg.

Respons och konfigurationsfiler

FreeCAD kan läsa en del av dessa alternativ från en konfigurationsfil. Denna fil måste ligga i bin sökvägen och måste ha namnet FreeCAD.cfg. Tänk på att alternativ som specificeras på kommandoraden har högre prioritet än konfigurationsfilen!

En del operativsystem har en låg gräns på kommandoradens längd. Det vanliga sättet att komma runt dessa begränsningar är att använda responsfiler. En responsfil är bara en konfigurationsfil som använder samma syntax som kommandoraden. Om kommandoraden specificerar namnet på den responsfil som ska användas, så laddas den och läses i tillägg till kommandoraden:

FreeCAD @ResponseFile.txt 

eller:

FreeCAD --response-file=ResponseFile.txt

or:

FreeCAD --response-file ResponseFile.txt

Gömda alternativ

Det finns en del alternativ som inte visas för användaren. Dessa alternativ är egentligen X-fönsterparametrar som läses av fönstersystemet:

  • -display display, väljer X skärmen (standard är $DISPLAY).
  • -geometry geometry, väljer klientgeometrin för det första fönstret som visas.
  • -fn or -font font, definierar applikationens typsnitt. Typsnittet ska specificeras med en X logisk typsnittsbeskrivning.
  • -bg or -background color, väljer standard bakgrundsfärg och en applikationspalett (ljusa och mörka skuggor beräknas).
  • -fg or -foreground color, väljer standard förgrundsfärg.
  • -btn or -button color, väljer standard knappfärg.
  • -name name, väljer applikationsnamnet.
  • -title title, väljer applikationstiteln.
  • -visual TrueColor, tvingar applikationen att använda TrueColor på en 8-bits skärm.
  • -ncols count, Begränsar antalet färger som allokeras i färgkuben på en 8-bitars skärm, om applikationen använder QApplication::ManyColor färgspecifikationen. Om antalet är 216 så används en 6x6x6 färgkub (d.v.s. 6 nivåer på rött, 6 på grönt, och 6 på blått); för andra värden, så används en kub som är ungefärligt proportionell till en 2x3x1 kub.
  • -cmap, får applikationen att installera en privat färgkarta på en 8-bitars skärm.

Köra FreeCAD utan användargränssnitt

FreeCAD startar normalt i gränssnittsläge, men du kan också tvinga det att starta i konsolläge genom att skriva:

FreeCAD --console

på kommandoraden. I konsolläge, så kommer inget användargränssnitt att visas, och du kommer att presenteras med en pythontolks prompt. Från den pythonprompten så har du samma funktionalitet som den pythontolk som körs inuti FreeCAD gränssnittet, med normal åtkomst till alla FreeCADs moduler och plugin, förutom FreeCADGui modulen. Tänk på att moduler som beror på FreeCADGui kanske inte heller finns tillgängliga.

To read more about console or headless mode, refer to Headless FreeCAD.

Running modules, macros and scripts

File type System Command line example
Module Windows "C:\Program Files\FreeCAD\bin\FreeCAD.exe" -M "C:\FreeCAD\Mod\Draft"
Linux FreeCAD_0.19 -M ~/.FreeCAD/Mod/Draft
Linux (AppImage) path/to/FreeCADXXX.AppImage -M ~/.FreeCAD/Mod/Draft
.FCMacro or .py Windows "C:\Program Files\FreeCAD\bin\FreeCAD.exe" "C:\Users\userName\AppData\Roaming\FreeCAD\Mod\WorkFeature\start_WF.FCMacro"
Linux FreeCAD_0.19 ~/.FreeCAD/Mod/WorkFeature/start_WF.FCMacro
Linux (AppImage) path/to/FreeCADXXX.AppImage ~/.FreeCAD/Mod/WorkFeature/start_WF.FCMacro

See Macro at Startup on how to set up a macro to automatically run at FreeCAD startup.

Environment variables

FreeCAD supports the following environment variables, which can be used to configure directories: introduced in 0.19

Environment variable Corresponding config var name Synopsis
FREECAD_USER_HOME UserHomePath FreeCAD's "base" directory for keeping local user data.
FREECAD_USER_DATA UserAppData If not set, defaults to FREECAD_USER_HOME/.FreeCAD, but only if FREECAD_USER_HOME is set.
FREECAD_USER_TEMP AppTempPath If not set, defaults to FREECAD_USER_HOME/temp, but only if FREECAD_USER_HOME is set.

If the specified path does not exist, the setting is ignored!

The above environment variables are meant to be used to realize a portable FreeCAD environment. For an example how environment variables can be used from the command line on Linux refer to the notes for Linux users on the downloads page.

HOME

FreeCAD uses Qt, which does honor the HOME environmental variable. Thus, setting HOME can be used to specify the base directory of Qt-related configuration files (.config/FreeCAD/FreeCAD.conf).

FreeCad itself does not honor the HOME environmental variable (because it determines the user's home directory from a lower-level system API). Use FREECAD_USER_HOME for this pupose.

TMPDIR

The default temporary directory is /tmp/. The TMPDIR environmental variable can be used to override the default. (Editor: precedence?).

Libraries

En del bibliotek behöver anropa systemmiljövariabler. ibland när det är ett problem med en FreeCAD installation, så beror det på att en del miljövariabler saknas eller är felinställda. Därför dupliceras några viktiga variabler i Konfigurationen och sparas i loggfilen.

Python relaterade miljövariabler:

  • PYTHONPATH
  • PYTHONHOME
  • TCL_LIBRARY
  • TCLLIBPATH

OpenCascade relaterade miljövariabler:

  • CSF_MDTVFontDirectory
  • CSF_MDTVTexturesDirectory
  • CSF_UnitsDefinition
  • CSF_UnitsLexicon
  • CSF_StandardDefaults
  • CSF_PluginDefaults
  • CSF_LANGUAGE
  • CSF_SHMessage
  • CSF_XCAFDefaults
  • CSF_GraphicShr
  • CSF_IGESDefaults
  • CSF_STEPDefaults

Konfigurationssetet

Vid varje uppstart så undersöker FreeCAD sin omgivning och kommandoradsparametrarna. Det bygger upp ett configuration set vilket innehåller den huvudsakliga körinformationen. Denna information används senare för att avgöra vilken plats som användardata eller loggfiler ska sparas. Det är också mycket viktigt för postmortem analyser. Därför så sparas det i loggfilen.

To quickly find the location of the configuration files (e.g. to delete them and therefore reset FreeCAD to "factory settings") on your machine, run the following command in the Python console in FreeCAD:

App.getUserConfigDir()

Användarrelaterad information

Användarkonfiguration
Konfig. var. namn Förklaring Exempel M$ Exempel Posix (Linux)
UserAppData Sökväg där FreeCAD lagrar användarrelaterad applikationsdata. C:\Documents and Settings\username\Application Data\FreeCAD /home/username/.FreeCAD
UserParameter Fil där FreeCAD lagrar användarrelaterad applikationsdata. C:\Documents and Settings\username\Application Data\FreeCAD\user.cfg /home/username/.FreeCAD/user.cfg
SystemParameter Fil där FreeCAD lagrar applikationsrelaterad data. C:\Documents and Settings\username\Application Data\FreeCAD\system.cfg /home/username/.FreeCAD/system.cfg
UserHomePath Nuvarande användares sökväg till hem mappen C:\Documents and Settings\username\My Documents /home/username

Note: For Linux distributions, an additional configuration file that relates to Qt may exist at path /home/username/.config/FreeCAD/FreeCAD.conf.

Kommandoradsargument

Användarkonfiguration
Konfig. var. namn Förklaring Exempel
LoggingFile 1 om loggningen är påslagen 1
LoggingFileName Filnamn där loggen sparas C:\Documents and Settings\username\Application Data\FreeCAD\FreeCAD.log
RunMode Detta indikerar hur huvudslingan kommer att fungera. "Script" innebär att det givna skriptet anropas och avslutas efter det. "Cmd" kör kommandotolken. "Internal" kör ett internt skript. "Gui" startar händelseslingan för gränssnittet. "Module" laddar en given python modul. "Cmd"
FileName Innebörd beror på RunMode
ScriptFileName Innebörd beror på RunMode
Verbose FreeCADs pratighet, d.v.s. hur mycket som loggas "" eller "strict"
OpenFileCount Innehåller antalet filer som öppnas genom kommandoradsargument "12"
AdditionalModulePaths Innehåller sökvägen för de extramoduler som ges i kommandoraden "extraModules/"

Systemrelaterat

Användarkonfiguration
Konfig. var. namn Förklaring Exempel M$ Exempel Posix (Linux)
AppHomePath Sökväg där FreeCAD är installerat c:/Progam Files/FreeCAD_0.7 /user/local/FreeCAD_0.7
PythonSearchPath Innehåller en lista på sökvägar där python söker efter moduler. Detta är vid uppstart och kan ändras under körning

Bygga relaterad information

Tabellen nedan visar tillgänglig information om Byggversionen. Det flesta av dem kommer från Subversion förrådet. dessa saker behövs för att exakt återuppbygga en version!

Användarkonfiguration
Konfig. var. namn Förklaring Exempel
BuildVersionMajor Byggningens Major Versionsnummer. Definierad i src/Build/Version.h.in 0
BuildVersionMinor Byggningens Minor Versionsnummer. Definierad i src/Build/Version.h.in 7
BuildRevision Källkodens SVN Repository Revisionnummer i byggningen. Genererad av SVN 356
BuildRevisionRange Område för olika ändringar 123-356
BuildRepositoryURL URL adress för förråd https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk/src
BuildRevisionDate Datum av ovanstående Revision 2007/02/03 22:21:18
BuildScrClean Indikerar om källkoden har ändrats efter kontroll Källkod ändrad
BuildScrMixed Källkod inte blandad

Märkningsrelaterat

Dessa konfigurationspunkter är relaterade till FreeCADs märkningsmekanism. Se Branding/sv för mer detaljer.

Användarkonfiguration
Konfig. var. namn Förklaring Exempel
ExeName Namn på den byggda körfilen. Kan skilja sig från FreeCAD om en annan main.cpp används. FreeCAD.exe
ExeVersion Allmän version som visas vid uppstart V0.7
AppIcon Ikon som används för körfilen, visas i Applikationens huvudfönster. "FCIcon"
ConsoleBanner Den banner som visas i konsolläge
SplashPicture Namn på den ikon som används till uppstartsskärmen "FreeCADSplasher"
SplashAlignment Textjustering i uppstartsdialogen Left"
SplashTextColor Textfärg i uppstartsfönstret "#000000"
StartWorkbench Namn på den arbetsbänk som ska startas automatiskt efter uppstart "Part design"
HiddenDockWindow Lista på dockningsfönster (separerade av semikolon) som kommer att inaktiveras "Property editor"

Querying the configuration

From FreeCAD's Python console

Entries of the configuration set can be queried with the config var name (see tables above) from the Python console. For example:

 >>> FreeCAD.ConfigGet("ExeVersion")
 '0.19'

If the name is not found, an empty string is returned.

From command line

Use the --get-config <config-var-name> option to query a single name. Not all names are supported. For example:

 FreeCAD --get-config ExeVersion

Use the --dump-config option to get a list of names and their values. Not all names are supported.

From FreeCAD console

Start FreeCAD in console mode with --console and query with Python code. For example:

 $ FreeCAD --console
 [FreeCAD Console mode <Use Ctrl-D (i.e. EOF) to exit.>]
 >>> FreeCAD.ConfigGet("ExeVersion")
 '0.19'
 >>> exit()

For Linux (bash shell) you can modify the following command line to suit your needs:

 $ FreeCAD --console <<EOF
 print( "FREECAD_USER_HOME: " + ( "not set" if ( os.environ.get('FREECAD_USER_HOME') is None ) else os.environ.get('FREECAD_USER_HOME') ) )
 print( "UserHomePath: " + FreeCAD.ConfigGet("UserHomePath") )
 exit()
 EOF

Starting FreeCAD from the desktop

Linux: Creating an additional start option

The following assumes that your desktop is configured such that you can launch FreeCAD from it. Depending on your Linux distribution and desktop environment, you may have to adapt the following steps:

  1. Copy the freedesktop entry file for FreeCAD from /usr/share/applications/freecad.desktop to ~/.local/share/applications.
  2. Change the name from freecad.desktop to something else (e.g. MyFreeCADConfig.desktop).
  3. Open the file with a text editor and change how FreeCAD is invoked by modifying the line starting with Exec.
  4. As a result, an additional entry in your start menu/application launcher is available. This way, you can have multiple FreeCAD entries with various launch options.

Starting FreeCAD from a portable USB medium

Windows

Put the FreeCAD executable, FreeCAD.exe, on the USB medium. Create a batch file, FreeCAD.bat, and put it into the same directory as FreeCAD.exe. Inside the batch file write:

set CURRENTDIR=%cd%
set FREECAD_USER_HOME=%CURRENTDIR%
start FreeCAD.exe -u FreeCAD/user.cfg -s FreeCAD/system.cfg --write-log

Or with FREECAD_USER_DATA (see):

set CURRENTDIR="%cd%"
set FREECAD_USER_DATA=%CURRENTDIR%/..
start FreeCAD.exe -u %FREECAD_USER_DATA%/user.cfg -s %FREECAD_USER_DATA%/system.cfg

With the batch in the root of the USB medium:

set CURRENTDIR=%cd%
set FREECAD_USER_DATA=%CURRENTDIR%FreeCAD\
start %cd%FreeCAD\bin\FreeCAD.exe -u %FREECAD_USER_DATA%user.cfg -s %FREECAD_USER_DATA%system.cfg

Now double-click the batch file to start FreeCAD. (see)


Third Party Tools/sv
FreeCAD Build Tool/sv
Index

Denna sida hämtas från https://wiki.freecad.org/Start_up_and_Configuration

Kontakta oss!
Forum GitHub Mastodon Matrix IRC Gitter.im Discord Reddit Twitter Facebook LinkedIn

© The FreeCAD Team. Homepage image credits (top to bottom): ppemawm, r-frank, epileftric, regis, rider_mortagnais, bejant.

This project is supported by: , KiCad Services Corp. och andra sponsorer

GitHubImprove this page on GitHub