TechDraw PageDefault: Difference between revisions

From FreeCAD Documentation
(relink module to workbench)
(Notes)
 
(17 intermediate revisions by 3 users not shown)
Line 14: Line 14:
{{GuiCommand
{{GuiCommand
|Name=TechDraw PageDefault
|Name=TechDraw PageDefault
|MenuLocation=TechDraw → Insert Default Page
|MenuLocation=TechDraw → Page → Insert Default Page
|Workbenches=[[TechDraw_Workbench|TechDraw]]
|Workbenches=[[TechDraw_Workbench|TechDraw]]
|SeeAlso=[[TechDraw_PageTemplate|TechDraw Page Template]], [[TechDraw_Templates|TechDraw Templates]]
|SeeAlso=[[TechDraw_PageTemplate|TechDraw PageTemplate]], [[TechDraw_Templates|TechDraw Templates]]
}}
}}


Line 22: Line 22:


<!--T:9-->
<!--T:9-->
The New Default tool creates a new Page object using the the template file specified in the [[TechDraw_Preferences|TechDraw Preferences]].
The '''TechDraw PageDefault''' tool creates a new Page object using the the template file specified in the [[TechDraw_Preferences|TechDraw Preferences]].


</translate>
</translate>
Line 28: Line 28:
<translate>
<translate>
<!--T:10-->
<!--T:10-->
{{Caption|Default template that comes with TechDraw: A4 page in landscape orientation, with editable text fields}}
{{Caption|Default template that comes with TechDraw: A4_LandscapeTD.svg}}


==Usage== <!--T:3-->
==Usage== <!--T:3-->


<!--T:11-->
<!--T:11-->
* Press the {{Button|[[Image:TechDraw_PageDefault.svg|16px]] [[TechDraw_PageDefault|Insert Default Page]]}} button. (An active document must exist.)
# An active document must exist.
# There are several ways to invoke the tool:
#* Press the {{Button|[[Image:TechDraw_PageDefault.svg|16px]] [[TechDraw_PageDefault|Insert Default Page]]}} button.
#* Select the {{MenuCommand|TechDraw → Page → [[Image:TechDraw_PageDefault.svg|16px]] Insert Default Page}} option from the menu.


== Notes == <!--T:8-->
== Notes == <!--T:8-->


<!--T:12-->
<!--T:12-->
* If a Page is marked as "do not keep updated" either through the KeepUpdated Property or by the setting in Preferences, it will ignore changes in the 3D model. You may notice anomalies (missing geometry, missing Dimension values, etc) in the appearance of the Page. These will correct themselves once the Page is updated. The Page will have this icon [[Image:TechDraw_Tree_Page_Unsync.svg|32px]] in the tree while updating is suspended. This setting also affects the startup process. If the Page is marked "do not keep updated" it will not be drawn at program start.
* If a Page is marked as "do not keep updated" either through its {{PropertyData|Keep Updated}} property, through the {{MenuCommand|Toggle Keep Updated}} option from its window context menu, or by the setting in the Preferences, it will ignore changes in the 3D model. You may notice anomalies (missing geometry, missing Dimension values, etc) in the appearance of the Page. These will correct themselves once the Page is updated with the [[TechDraw_RedrawPage|Redraw Page]] tool. The Page will have this icon [[Image:TechDraw_Tree_Page_Unsync.svg|24px]] in the [[Tree_view|Tree view]] while updating is suspended. This setting also affects the startup process. If a Page is marked as "do not keep updated" it will not be drawn at program start.


<!--T:13-->
<!--T:13-->
If the default template is not specified in your user configuration file {{incode|user.cfg}}, the tool will try
* If the default template is not specified in your user configuration file {{incode|user.cfg}}, the tool will try:

</translate>
</translate>
{{Code|code=
: {{Code|code=
$INSTALL_DIR/Mod/TechDraw/Templates/A4_LandscapeTD.svg
$INSTALL_DIR/Mod/TechDraw/Templates/A4_LandscapeTD.svg
}}
}}
Line 49: Line 53:


<!--T:14-->
<!--T:14-->
Where {{incode|$INSTALL_DIR}} is the directory where FreeCAD was installed, for example
: Where {{incode|$INSTALL_DIR}} is the directory where FreeCAD was installed, for example:

</translate>
</translate>
{{Code|code=
: {{Code|code=
/usr/share/freecad/Mod/TechDraw/Templates/A4_LandscapeTD.svg
/usr/share/freecad/Mod/TechDraw/Templates/A4_LandscapeTD.svg
}}
}}
Line 57: Line 62:


==Properties== <!--T:5-->
==Properties== <!--T:5-->

=== Data === <!--T:25-->

<!--T:26-->
{{TitleProperty|Base}}

<!--T:27-->
* {{PropertyData|Projection Type}}: Default projection type (First or Third Angle) for this Page.

<!--T:28-->
{{TitleProperty|Page}}


<!--T:15-->
<!--T:15-->
* {{PropertyData|Keep Updated}}: If false, the Page is not updated with changes to the 3D model. Useful for complicated/slow drawings. See [[#Notes|Notes]].
* {{PropertyData|Projection Type}}: Default projection type (First or Third Angle) for this Page.
* {{PropertyData|Keep Updated}}: If false, Page is not updated with changes to the 3D model. Useful for complicated/slow drawings. See Notes.
* {{PropertyData|Template}}: A link to this Page's [[TechDraw_Templates|Template]] object.
* {{PropertyData|Template}}: A link to this Page's [[TechDraw_Templates|Template]] object.
* {{PropertyData|Views}}: A list of links to the Views on this Page.
* {{PropertyData|Views}}: A list of links to the Views on this Page.
* {{PropertyData|Scale}}: Default scale for Views in this Page.
* {{PropertyData|Scale}}: Default scale for Views in this Page.
* {{PropertyData|Next Balloon Index}}: Auto-numbering for Balloons.


==Scripting== <!--T:6-->
=== View === <!--T:29-->


<!--T:16-->
<!--T:30-->
{{TitleProperty|Grid}}
{{Emphasis|See also:}} [[TechDraw_API|TechDraw API]] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


<!--T:17-->
<!--T:31-->
* {{PropertyView|Show Grid}}: Show a grid over this Page. {{Version|0.20}}
The New Default tool can be used in [[Macros|macros]] and from the [[Python|Python]] console by using the following functions:
* {{PropertyView|Grid Spacing}}: Distance between grid lines. {{Version|0.20}}
</translate>
{{Code|code=
page = FreeCAD.ActiveDocument.addObject('TechDraw::DrawPage','Page')
template = FreeCAD.ActiveDocument.addObject('TechDraw::DrawSVGTemplate','Template')
template.Template = templateFileSpec
page.Template = FreeCAD.ActiveDocument.Template
}}
<translate>
<!--T:7-->
* Creates a new Page in the current document


=== Editable text fields === <!--T:22-->
==Scripting== <!--T:6-->


<!--T:23-->
<!--T:32-->
See [[TechDraw_PageTemplate#Scripting|TechDraw PageTemplate]].
{{Emphasis|See also:}} [[TechDraw_Templates|TechDraw Templates]] for more information on creating templates.


<!--T:24-->
Once a new page has been created, its {{incode|Template}} attribute holds an {{incode|EditableTexts}} dictionary with the name of the editable fields (keys) and their textual values. Copy this dictionary to a variable, make changes, and then re-assign the dictionary to the {{incode|EditableTexts}} attribute to see the changes.

</translate>
{{Code|code=
page = FreeCAD.ActiveDocument.Page
texts = page.Template.EditableTexts

for key, value in texts.items():
print("{0} = {1}".format(key, value))

texts["FC-Title"] = "The title of my page"
page.Template.EditableTexts = texts
}}
<translate>


<!--T:21-->
<!--T:21-->
Line 117: Line 109:
{{TechDraw Tools navi{{#translation:}}}}
{{TechDraw Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Latest revision as of 22:07, 24 July 2023

TechDraw PageDefault

Menu location
TechDraw → Page → Insert Default Page
Workbenches
TechDraw
Default shortcut
None
Introduced in version
-
See also
TechDraw PageTemplate, TechDraw Templates

Description

The TechDraw PageDefault tool creates a new Page object using the the template file specified in the TechDraw Preferences.

Default template that comes with TechDraw: A4_LandscapeTD.svg

Usage

  1. An active document must exist.
  2. There are several ways to invoke the tool:
    • Press the Insert Default Page button.
    • Select the TechDraw → Page → Insert Default Page option from the menu.

Notes

  • If a Page is marked as "do not keep updated" either through its DataKeep Updated property, through the Toggle Keep Updated option from its window context menu, or by the setting in the Preferences, it will ignore changes in the 3D model. You may notice anomalies (missing geometry, missing Dimension values, etc) in the appearance of the Page. These will correct themselves once the Page is updated with the Redraw Page tool. The Page will have this icon in the Tree view while updating is suspended. This setting also affects the startup process. If a Page is marked as "do not keep updated" it will not be drawn at program start.
  • If the default template is not specified in your user configuration file user.cfg, the tool will try:
$INSTALL_DIR/Mod/TechDraw/Templates/A4_LandscapeTD.svg
Where $INSTALL_DIR is the directory where FreeCAD was installed, for example:
/usr/share/freecad/Mod/TechDraw/Templates/A4_LandscapeTD.svg

Properties

Data

Base

  • DataProjection Type: Default projection type (First or Third Angle) for this Page.

Page

  • DataKeep Updated: If false, the Page is not updated with changes to the 3D model. Useful for complicated/slow drawings. See Notes.
  • DataTemplate: A link to this Page's Template object.
  • DataViews: A list of links to the Views on this Page.
  • DataScale: Default scale for Views in this Page.
  • DataNext Balloon Index: Auto-numbering for Balloons.

View

Grid

Scripting

See TechDraw PageTemplate.