TechDraw DraftView: Difference between revisions

From FreeCAD Documentation
No edit summary
(Move the Notes paragraph.)
 
(20 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:20-->
<!--T:20-->
{{Docnav
{{Docnav
|[[TechDraw_DetailView|Insert Detail View]]
|[[TechDraw_DetailView|DetailView]]
|[[TechDraw_ArchView|Insert Arch Workbench Object]]
|[[TechDraw_ArchView|ArchView]]
|[[TechDraw_Module|TechDraw]]
|[[TechDraw_Workbench|TechDraw]]
|IconL=TechDraw DetailView.svg
|IconL=TechDraw DetailView.svg
|IconC=Workbench_TechDraw.svg
|IconR=TechDraw_ArchView.svg
|IconR=TechDraw_ArchView.svg
|IconC=Workbench_TechDraw.svg
}}
}}


Line 14: Line 15:
{{GuiCommand
{{GuiCommand
|Name=TechDraw DraftView
|Name=TechDraw DraftView
|MenuLocation=TechDraw → Insert Draft Workbench Object
|MenuLocation=TechDraw → Views From Other Workbenches → Insert Draft Workbench Object
|Workbenches=[[TechDraw_Module|TechDraw]], [[Draft_Workbench|Draft]]
|Workbenches=[[TechDraw_Workbench|TechDraw]], [[Draft_Workbench|Draft]]
|SeeAlso=, [[TechDraw_ArchView|TechDraw Insert Arch Workbench Object]]
|SeeAlso=[[TechDraw_ArchView|TechDraw Arch View]]
}}
}}


Line 22: Line 23:


<!--T:13-->
<!--T:13-->
The [[Image:TechDraw_DraftView.svg|24px]] [[TechDraw_DraftView|DraftView]] tool inserts a view of a selected [[Part_Module|Part]]-based or Group object into a drawing page. Unlike the standard [[Image:TechDraw_View.svg|24px]] [[TechDraw_View|View]] tool, views created with this tool are handled by the [[Image:Workbench_Draft.svg|24px]] [[Draft_Workbench|Draft Workbench]], and specially designed for showing 2D objects. See Notes.
The '''TechDraw DraftView''' tool inserts a view of a selected [[Part_Workbench|Part]]-based or Group object into a drawing page. Unlike the standard [[Image:TechDraw_View.svg|24px]] [[TechDraw_View|View]] tool, views created with this tool are handled by the [[Image:Workbench_Draft.svg|24px]] [[Draft_Workbench|Draft Workbench]], and specially designed for showing 2D objects. See [[#Notes|Notes]].


<!--T:10-->
<!--T:10-->
Line 31: Line 32:


<!--T:14-->
<!--T:14-->
# Optionally rotate the [[3D_view|3D view]]. The camera direction in the [[3D_view|3D view]] determines the initial value of the {{PropertyData|Direction}} property of the View.
# Select a draft object in the 3D view or in the tree
# Select one or more objects in the [[3D_view|3D view]] or [[Tree_view|Tree view]]. A separate view will created for each object.
# If you have multiple drawing pages in your document, you will need to select the desired page in the tree.
# If there are multiple drawing pages in the document: optionally add the desired page to the selection by selecting it in the [[Tree_view|Tree view]].
# Press the {{Button|[[Image:TechDraw DraftView.svg|16px]] [[TechDraw_DraftView|Insert Draft Workbench Object]]}} button
# There are several ways to invoke the tool:
# A view of the draft object will appear on the page.
#* Press the {{Button|[[Image:TechDraw_DraftView.svg|16px]] [[TechDraw_DraftView|Insert Draft Workbench Object]]}} button.

#* Select the {{MenuCommand|TechDraw → Views From Other Workbenches → [[Image:TechDraw_DraftView.svg|16px]] Insert Draft Workbench Object}} option from the menu.
=== Limitations === <!--T:12-->
# If there are multiple drawing pages in the document and you have not yet selected a page, the {{MenuCommand|Page Chooser}} dialog box opens: {{Version|0.20}}

## Select the desired page.
<!--T:15-->
## Press the {{Button|OK}} button.
The DraftView is rendered within the [[Draft_Workbench|Draft Workbench]], therefore TechDraw has limited control over its appearance. You may need to make changes within Draft to get the representation you want.


==Options== <!--T:4-->
==Options== <!--T:4-->


<!--T:11-->
<!--T:11-->
* Creating a Draft View of a group will recursively handle all the objects found into that group and in its subgroups. The View is updated automatically when the contents of the group changes
* Creating a DraftView of a layer will recursively handle all objects found in that layer. The View is updated automatically when the contents of the layer changes
* There is no hidden line removal. Each face found in the handled object(s) will simply be projected along the Direction vector, no specific action is taken when faces overlap
* There is no hidden line removal. Each face found in the handled object(s) will simply be projected along the Direction vector, no specific action is taken when faces overlap
* The Draft View also supports all Draft objects that are not Part-based, such as dimensions and texts
* The Draft View also supports all Draft objects that are not Part-based, such as dimensions and texts
* Color, line width and line pattern can be specified in the properties. Line patterns can be fine-tuned by directly giving a [https://www.w3.org/TR/SVG/painting.html#StrokeProperties stroke-dasharray] value, such as 3,5
* Color, line width and line pattern can be specified in the properties. Line patterns can be fine-tuned by directly giving a [https://www.w3.org/TR/SVG/painting.html#StrokeProperties stroke-dasharray] value, such as 3,5
* Projected faces are filled with the face color
* Projected faces are filled with the face color

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

<!--T:15-->
The DraftView is rendered within the [[Draft_Workbench|Draft Workbench]], therefore TechDraw has limited control over its appearance. You may need to make changes within Draft to get the representation you want.


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


<!--T:8-->
<!--T:22-->
See also [[TechDraw_View#Properties|TechDraw View]].
* {{PropertyData|Source}}: The draft object to be displayed
* {{PropertyData|LineWidth}}: The width of the lines, independently of the scale
* {{PropertyData|FontSize}}: The size of all texts appearing in this view (texts and dimensions)
* {{PropertyData|Direction}}: The projection direction to use
* {{PropertyData|Color}}: The color of lines
* {{PropertyData|LineStyle}}: A line style to use for this view. Can be Solid, Dashed, Dashdot, Dot or a SVG line pattern like 0.20,0.20
* {{PropertyData|LineSpacing}}: The spacing to use between lines of texts for multiline texts


<!--T:9-->
=== Data === <!--T:23-->

Note: DraftView inherits all applicable basic View properties.
<!--T:24-->
{{TitleProperty|Draft view}}

<!--T:8-->
* {{PropertyData|Source|Link}}: The Draft object to be displayed.
* {{PropertyData|Line Width|Float}}: The width of the lines, independently of the scale.
* {{PropertyData|Font Size|Float}}: The size of all texts appearing in this view (texts and dimensions).
* {{PropertyData|Direction|Vector}}: The projection direction to use.
* {{PropertyData|Color|Color}}: The color of lines.
* {{PropertyData|Line Style|String}}: A line style to use for this view. Can be {{Value|Solid}}, {{Value|Dashed}}, {{Value|Dashdot}}, {{Value|Dot}} or an SVG line pattern like {{Value|0.20,0.20}}.
* {{PropertyData|Line Spacing|Float}}: The spacing to use between lines of texts for multiline texts.
* {{PropertyData|Override Style|Bool}}: If {{TRUE}}, line color, width and style of this view will override those of the rendered object.


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


<!--T:16-->
<!--T:16-->
{{Emphasis|See also:}} [[TechDraw_API|TechDraw API]] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


<!--T:17-->
<!--T:17-->
Line 79: Line 91:
}}
}}
<translate>
<translate>



<!--T:21-->
<!--T:21-->
{{Docnav
{{Docnav
|[[TechDraw_DetailView|Insert Detail View]]
|[[TechDraw_DetailView|DetailView]]
|[[TechDraw_ArchView|Insert Arch Workbench Object]]
|[[TechDraw_ArchView|ArchView]]
|[[TechDraw_Module|TechDraw]]
|[[TechDraw_Workbench|TechDraw]]
|IconL=TechDraw DetailView.svg
|IconL=TechDraw DetailView.svg
|IconC=Workbench_TechDraw.svg
|IconR=TechDraw_ArchView.svg
|IconR=TechDraw_ArchView.svg
|IconC=Workbench_TechDraw.svg
}}
}}


Line 93: Line 106:
{{TechDraw Tools navi{{#translation:}}}}
{{TechDraw Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Latest revision as of 08:03, 26 July 2023

TechDraw DraftView

Menu location
TechDraw → Views From Other Workbenches → Insert Draft Workbench Object
Workbenches
TechDraw, Draft
Default shortcut
None
Introduced in version
-
See also
TechDraw Arch View

Description

The TechDraw DraftView tool inserts a view of a selected Part-based or Group object into a drawing page. Unlike the standard View tool, views created with this tool are handled by the Draft Workbench, and specially designed for showing 2D objects. See Notes.

Draft elements like circles and arrays imported into a TechDraw drawing page

Usage

  1. Optionally rotate the 3D view. The camera direction in the 3D view determines the initial value of the DataDirection property of the View.
  2. Select one or more objects in the 3D view or Tree view. A separate view will created for each object.
  3. If there are multiple drawing pages in the document: optionally add the desired page to the selection by selecting it in the Tree view.
  4. There are several ways to invoke the tool:
    • Press the Insert Draft Workbench Object button.
    • Select the TechDraw → Views From Other Workbenches → Insert Draft Workbench Object option from the menu.
  5. If there are multiple drawing pages in the document and you have not yet selected a page, the Page Chooser dialog box opens: introduced in version 0.20
    1. Select the desired page.
    2. Press the OK button.

Options

  • Creating a DraftView of a layer will recursively handle all objects found in that layer. The View is updated automatically when the contents of the layer changes
  • There is no hidden line removal. Each face found in the handled object(s) will simply be projected along the Direction vector, no specific action is taken when faces overlap
  • The Draft View also supports all Draft objects that are not Part-based, such as dimensions and texts
  • Color, line width and line pattern can be specified in the properties. Line patterns can be fine-tuned by directly giving a stroke-dasharray value, such as 3,5
  • Projected faces are filled with the face color

Notes

The DraftView is rendered within the Draft Workbench, therefore TechDraw has limited control over its appearance. You may need to make changes within Draft to get the representation you want.

Properties

See also TechDraw View.

Data

Draft view

  • DataSource (Link): The Draft object to be displayed.
  • DataLine Width (Float): The width of the lines, independently of the scale.
  • DataFont Size (Float): The size of all texts appearing in this view (texts and dimensions).
  • DataDirection (Vector): The projection direction to use.
  • DataColor (Color): The color of lines.
  • DataLine Style (String): A line style to use for this view. Can be Solid, Dashed, Dashdot, Dot or an SVG line pattern like 0.20,0.20.
  • DataLine Spacing (Float): The spacing to use between lines of texts for multiline texts.
  • DataOverride Style (Bool): If true, line color, width and style of this view will override those of the rendered object.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

The New Draft tool can be used in macros and from the Python console by using the following functions:

dv = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewDraft','TestDraft')
dv.Source = myDraftbject
rc = page.addView(dv)