Console API: Difference between revisions

From FreeCAD Documentation
No edit summary
No edit summary
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<languages/>
このモジュールはFreeCADモジュール内部に含まれ、FreeCADの出力用コンソールとステータスバーにテキストを送信するためのメソッドが含まれています。メッセージ、警告、エラーの場合にはメッセージ文字列が異なる色になります。サンプル:
<translate>
<!--T:5-->
{{VeryImportantMessage|(October 2019) Do not edit this page. The information is incomplete and outdated. For the latest API, see the [https://www.freecadweb.org/api autogenerated API documentation], or generate the documentation yourself, see [[Source documentation|Source documentation]].}}


<!--T:1-->
import FreeCAD
This module is contained inside the FreeCAD module and contains methods to send text to FreeCAD's output console and status bar. The messages will have different color if they are message, warning or error.
FreeCAD.PrintMessage("Hello World!\n")


<!--T:2-->
{{APIFunction/jp|GetStatus|"Log" または "Msg" または "Wrn" または "Err"|Log、Msg、Wrn、Wrnのいずれかのステータスを監視用に取得します。|ステータス文字列}}
Example:
{{APIFunction/jp|PrintError|string|出力にエラーメッセージをプリントします。|なし}}
</translate>
{{APIFunction/jp|PrintLog|string|出力にログメッセージをプリントします。|なし}}
{{Code|code=
{{APIFunction/jp|PrintMessage|string|出力にメッセージをプリントします。|なし}}
import FreeCAD
{{APIFunction/jp|PrintWarning|string|出力に警告をプリントします。|なし}}
FreeCAD.Console.PrintMessage("Hello World!\n")
{{APIFunction/jp|SetStatus|string|Log、Msg、Wrn、Wrnのいずれかのステータスを監視用に設定します。| }}
}}
<translate>


{{languages/jp | {{en|Console_API}} {{es|Console_API/es}} {{it|Console_API/it}} }}


<!--T:3-->
[[Category:API/jp]]
{{APIFunction|GetStatus|"Log" or "Msg" or "Wrn" or "Err"|Get the status for either Log, Msg, Wrn or Error for an observer|a status string.}}
{{APIFunction|PrintError|string|Prints an error message to the output|nothing}}
{{APIFunction|PrintLog|string|Prints a log message to the output|nothing}}
{{APIFunction|PrintMessage|string|Prints a message to the output|nothing}}
{{APIFunction|PrintWarning|string|Prints a warning to the output|nothing}}
{{APIFunction|SetStatus|string|Set the stats for either Log, Msg, Wrn or Error for an observer| }}

</translate>
{{Userdocnavi{{#translation:}}}}
[[Category:API{{#translation:}}]]
[[Category:Poweruser Documentation{{#translation:}}]]
{{clear}}

Latest revision as of 20:54, 27 February 2020

(October 2019) Do not edit this page. The information is incomplete and outdated. For the latest API, see the autogenerated API documentation, or generate the documentation yourself, see Source documentation.

This module is contained inside the FreeCAD module and contains methods to send text to FreeCAD's output console and status bar. The messages will have different color if they are message, warning or error.

Example:

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: