API w konsoli

From FreeCAD Documentation
Revision as of 12:48, 24 July 2021 by Kaktus (talk | contribs) (Created page with "Ten moduł jest zawarty wewnątrz modułu FreeCAD i zawiera metody do wysyłania tekstu do konsoli wyjściowej i paska stanu programu FreeCAD. Wiadomości będą miały różn...")
(Październik 2019) Nie edytuj tych stron. Informacje są niekompletne i nieaktualne. Najnowsze API można znaleźć w automatycznie generowana dokumentacja API, lub wygenerować dokumentację samodzielnie, śledząc dokument Dokumentacja źródłowa.

Ten moduł jest zawarty wewnątrz modułu FreeCAD i zawiera metody do wysyłania tekstu do konsoli wyjściowej i paska stanu programu FreeCAD. Wiadomości będą miały różny kolor, w zależności od tego czy będą to komunikaty, ostrzeżenia czy błędy.

Przykład:

import FreeCAD
FreeCAD.Console.PrintMessage("Hello World!\n")


GetStatus("Log" or "Msg" or "Wrn" or "Err")

Description: Get the status for either Log, Msg, Wrn or Error for an observer

Returns: a status string.

PrintError(string)

Description: Prints an error message to the output

Returns: nothing

PrintLog(string)

Description: Prints a log message to the output

Returns: nothing

PrintMessage(string)

Description: Prints a message to the output

Returns: nothing

PrintWarning(string)

Description: Prints a warning to the output

Returns: nothing

SetStatus(string)

Description: Set the stats for either Log, Msg, Wrn or Error for an observer

Returns: