GuiCommand model: Difference between revisions
(Version) |
(Reworked model) |
||
Line 1: | Line 1: | ||
<languages/> |
<languages/> |
||
<translate> |
<translate> |
||
{{Message|This page shows a model of a recommended GuiCommand page. Under the [[#Selectable block|Selectable block]] section below you will find the same content easily selectable for pasting in a new page.}} |
|||
<!--T:1--> |
<!--T:1--> |
||
{{GuiCommand |
{{GuiCommand |
||
|Name=Base ExampleCommandModel |
|Name=Base ExampleCommandModel |
||
|Icon=<!--filename of icon with extension (e.g. svg, png) if not the same name as command / delete row if unused--> |
|||
|MenuLocation=Sample → Command |
|||
|MenuLocation=Menu → Submenu → Command |
|||
|Workbenches= |
|||
|Workbenches=[[Workbench Name|Workbench]] |
|||
|Shortcut= |
|||
|Shortcut=<!--delete this row if not used--> |
|||
|SeeAlso= |
|||
|SeeAlso=<!--add links to similar commands, delete this row if not used--> |
|||
|Version= |
|||
|Version=0.17 |
|||
}} |
}} |
||
Line 16: | Line 19: | ||
Insert here a short description of what the command does. |
Insert here a short description of what the command does. |
||
Add an image if possible, and please follow the guidelines in [[WikiPages#Graphics]]. Example taken from Draft Line: |
|||
<!--T:14--> |
|||
</translate> |
|||
[[image:FreeCAD05.png]] image |
|||
[[File:Draft_Line_example.jpg|none|400px]] |
|||
<translate> |
|||
''Optional: add a caption in italics below the image.'' |
|||
==How to use== <!--T:3--> |
==How to use== <!--T:3--> |
||
Line 27: | Line 33: | ||
==Options== <!--T:5--> |
==Options== <!--T:5--> |
||
{{TitleTasks|[[Image:Part_Box.png|24px]] Create Geometry }} |
|||
* List the command options here. Check out two examples, [[Draft Line]] and [[PartDesign Pad]]. |
|||
<nowiki>{{TitleTasks|[[Image:Icon.png|24]] + Text}}</nowiki> (Code for the main title Tasks) |
|||
* {{PropertyTasks|Tasks}} : Tasks |
|||
<nowiki>{{PropertyTasks|Tasks}}</nowiki> (Code of title Tasks) |
|||
* Options |
|||
==Properties== <!--T:6--> |
==Properties== <!--T:6--> |
||
{{TitleProperty|Base}} |
|||
===Data=== |
|||
<nowiki>{{TitleProperty|Base}}</nowiki> (Code for the main title Properties) |
|||
* {{PropertyData|Properties}}: Properties |
|||
* {{PropertyData|PropertyName1}}: Description of the property |
|||
* {{PropertyView|Properties}}: Properties |
|||
===View=== |
|||
<nowiki>{{PropertyView|Properties}}</nowiki> (Code of title View) |
|||
* {{PropertyView|PropertyName2}}: Description of the property |
|||
==Example== <!--T:7--> |
==Example== <!--T:7--> |
||
Line 61: | Line 66: | ||
Base.makeExampleCommandModel(FreeCAD.Data,FreeCAD.Data) |
Base.makeExampleCommandModel(FreeCAD.Data,FreeCAD.Data) |
||
<translate> |
<translate> |
||
==Limitations== |
|||
* Optional, use bullet list if multiple items |
|||
==Other== <!--T:12--> |
==Other== <!--T:12--> |
||
Line 67: | Line 75: | ||
</translate> |
</translate> |
||
{{clear}} |
{{clear}} |
||
==Selectable block== |
|||
<nowiki> |
|||
{{GuiCommand |
|||
|Name=Base ExampleCommandModel |
|||
|Icon=<!--filename of icon with extension (e.g. svg, png) if not the same name as command / delete row if unused--> |
|||
|MenuLocation=Menu → Submenu → Command |
|||
|Workbenches=[[Workbench Name|Workbench]] |
|||
|Shortcut=<!--delete this row if not used--> |
|||
|SeeAlso=<!--add links to similar commands, delete this row if not used--> |
|||
|Version=0.17 |
|||
}} |
|||
==Description== |
|||
Insert here a short description of what the command does. |
|||
</translate> |
|||
[[File:Draft_Line_example.jpg|none|400px]] |
|||
<translate> |
|||
''Optional: add a caption in italics.'' |
|||
==How to use== |
|||
# Press the {{KEY|[[File:Std Close.png|24px]] '''Command name'''}} button. |
|||
# Detailed steps as needed. |
|||
# Set options and press {{KEY|OK}}. |
|||
==Options== |
|||
* List the command options here. |
|||
==Properties== |
|||
===Data=== |
|||
* {{PropertyData|PropertyName1}}: Description of the property |
|||
===View=== |
|||
* {{PropertyView|PropertyName2}}: Description of the property |
|||
==Example== |
|||
Optional |
|||
==Scripting== |
|||
The ExampleCommandModel tool can be used in [[macros]] and from the python console by using the following function: |
|||
</translate> |
|||
'''makeExampleCommandModel(Data, Data)''' |
|||
<translate> |
|||
* Creates a CommandModel using Data. |
|||
* Returns the newly created object. |
|||
Example: |
|||
</translate> |
|||
import FreeCAD, Base |
|||
Base.makeExampleCommandModel(FreeCAD.Data,FreeCAD.Data) |
|||
<translate> |
|||
==Limitations== |
|||
* Optional, use bullet list if multiple items |
|||
==Other== |
|||
Optional |
|||
</nowiki> |
Revision as of 06:30, 12 November 2018
This page shows a model of a recommended GuiCommand page. Under the Selectable block section below you will find the same content easily selectable for pasting in a new page.
Base ExampleCommandModel |
Menu location |
---|
Menu → Submenu → Command |
Workbenches |
Workbench |
Default shortcut |
None |
Introduced in version |
0.17 |
See also |
None |
Description
Insert here a short description of what the command does.
Add an image if possible, and please follow the guidelines in WikiPages#Graphics. Example taken from Draft Line:
Optional: add a caption in italics below the image.
How to use
- Press the File:Std Close.png Command name button.
- Detailed steps as needed.
- Set options and press OK.
Options
- List the command options here. Check out two examples, Draft Line and PartDesign Pad.
Properties
Data
- DataPropertyName1: Description of the property
View
- ViewPropertyName2: Description of the property
Example
Optional
Scripting
The ExampleCommandModel tool can be used in macros and from the python console by using the following function:
makeExampleCommandModel(Data, Data)
- Creates a CommandModel using Data.
- Returns the newly created object.
Example:
import FreeCAD, Base Base.makeExampleCommandModel(FreeCAD.Data,FreeCAD.Data)
Limitations
- Optional, use bullet list if multiple items
Other
Optional
Selectable block
{{GuiCommand |Name=Base ExampleCommandModel |Icon=<!--filename of icon with extension (e.g. svg, png) if not the same name as command / delete row if unused--> |MenuLocation=Menu → Submenu → Command |Workbenches=[[Workbench Name|Workbench]] |Shortcut=<!--delete this row if not used--> |SeeAlso=<!--add links to similar commands, delete this row if not used--> |Version=0.17 }} ==Description== Insert here a short description of what the command does. </translate> [[File:Draft_Line_example.jpg|none|400px]] <translate> ''Optional: add a caption in italics.'' ==How to use== # Press the {{KEY|[[File:Std Close.png|24px]] '''Command name'''}} button. # Detailed steps as needed. # Set options and press {{KEY|OK}}. ==Options== * List the command options here. ==Properties== ===Data=== * {{PropertyData|PropertyName1}}: Description of the property ===View=== * {{PropertyView|PropertyName2}}: Description of the property ==Example== Optional ==Scripting== The ExampleCommandModel tool can be used in [[macros]] and from the python console by using the following function: </translate> '''makeExampleCommandModel(Data, Data)''' <translate> * Creates a CommandModel using Data. * Returns the newly created object. Example: </translate> import FreeCAD, Base Base.makeExampleCommandModel(FreeCAD.Data,FreeCAD.Data) <translate> ==Limitations== * Optional, use bullet list if multiple items ==Other== Optional