TechDraw View: Difference between revisions

From FreeCAD Documentation
(Properties...)
(Properties...)
Line 55: Line 55:


<!--T:14-->
<!--T:14-->
* {{PropertyData|X}}: The view's horizontal position on the page. (1)
* {{PropertyData|X|Distance}}: The view's horizontal position on the page. (1)
* {{PropertyData|Y}}: The view's vertical position on the page. (1)
* {{PropertyData|Y|Distance}}: The view's vertical position on the page. (1)
* {{PropertyData|Lock Position}}: Prevents Views from being dragged in the Gui when true. The View can still be moved by changing X,Y properties. (1)
* {{PropertyData|Lock Position|Bool}}: Prevents Views from being dragged in the Gui when true. The View can still be moved by changing X,Y properties. (1)
* {{PropertyData|Rotation}}: Counterclockwise rotation of the View on the page in degrees. (1)
* {{PropertyData|Rotation|Angle}}: Counterclockwise rotation of the View on the page in degrees. (1)
* {{PropertyData|Scale Type}}: "Document": use the Page's scale setting. "Custom": use a scale unique to this view. "Automatic": fit view to page. (1)
* {{PropertyData|Scale Type|Enumeration}}: "Document": use the Page's scale setting. "Custom": use a scale unique to this view. "Automatic": fit view to page. (1)
* {{PropertyData|Scale}}: A view will be rendered on the page in Scale:1 ratio to the Source. (1)
* {{PropertyData|Scale|FloatConstant}}: A view will be rendered on the page in Scale:1 ratio to the Source. (1)
* {{PropertyData|Caption}}: Optional short text caption.
* {{PropertyData|Caption|String}}: Optional short text caption.


<!--T:8-->
<!--T:8-->
Line 70: Line 70:


<!--T:23-->
<!--T:23-->
* {{PropertyData|Coarse View}}: If true, TechDraw will use a polygon approximation to calculate drawing geometry. If false, TechDraw will use a precision algorithm. CoarseView can be much faster for complex models. The quality of the drawing is reduced, since every curve is approximated as a series of short line segments. Vertices are not displayed in CoarseView since each short segment would result in two new Vertices and the display becomes cluttered. Linear Dimensions can be added to a CoarseView, but are unlikely to be useful.
* {{PropertyData|Coarse View|Bool}}: If true, TechDraw will use a polygon approximation to calculate drawing geometry. If false, TechDraw will use a precision algorithm. CoarseView can be much faster for complex models. The quality of the drawing is reduced, since every curve is approximated as a series of short line segments. Vertices are not displayed in CoarseView since each short segment would result in two new Vertices and the display becomes cluttered. Linear Dimensions can be added to a CoarseView, but are unlikely to be useful.
* {{PropertyData|Smooth Visible}}: Visible Smooth lines on/off.
* {{PropertyData|Smooth Visible|Bool}}: Visible Smooth lines on/off.
* {{PropertyData|Seam Visible}}: Visible Seam lines on/off.
* {{PropertyData|Seam Visible|Bool}}: Visible Seam lines on/off.
* {{PropertyData|Iso Visible}}: Visible Isometric(u,v) lines on/off.
* {{PropertyData|Iso Visible|Bool}}: Visible Isometric(u,v) lines on/off.
* {{PropertyData|Hard Hidden}}: Hidden lines on/off.
* {{PropertyData|Hard Hidden|Bool}}: Hidden lines on/off.
* {{PropertyData|Smooth Hidden}}: Hidden Smooth lines on/off.
* {{PropertyData|Smooth Hidden|Bool}}: Hidden Smooth lines on/off.
* {{PropertyData|Seam Hidden}}: Hidden Seam lines on/off.
* {{PropertyData|Seam Hidden|Bool}}: Hidden Seam lines on/off.
* {{PropertyData|Iso Hidden}}: Hidden Isometric(u,v) lines on/off.
* {{PropertyData|Iso Hidden|Bool}}: Hidden Isometric(u,v) lines on/off.
* {{PropertyData|Iso Count}}: Number of Isometric(u,v) lines to draw on each face.
* {{PropertyData|Iso Count|Integer}}: Number of Isometric(u,v) lines to draw on each face.


<!--T:27-->
<!--T:27-->
Line 84: Line 84:


<!--T:24-->
<!--T:24-->
* {{PropertyData|Source}}: Links to the drawable objects to be depicted.
* {{PropertyData|Source|LinkList}}: Links to the drawable objects to be depicted.
* {{PropertyData|XSource}}: Links to the drawable objects in an external file. {{Version|0.19}}
* {{PropertyData|XSource|XLinkList}}: Links to the drawable objects in an external file. {{Version|0.19}}
* {{PropertyData|Direction}}: this vector controls the direction from which you are viewing the object. +X is right, -X is left, +Y is rear, -Y is front (looking into the screen), +Z is up and -Z is down. So a Front view is (0,-1,0) and an isometric view is (1,-1,1).
* {{PropertyData|Direction|Vector}}: this vector controls the direction from which you are viewing the object. +X is right, -X is left, +Y is rear, -Y is front (looking into the screen), +Z is up and -Z is down. So a Front view is (0,-1,0) and an isometric view is (1,-1,1).
* {{PropertyData|XDirection}}: this vector controls the rotation of the view around the Direction. {{Version|0.19}}.
* {{PropertyData|XDirection|Vector}}: this vector controls the rotation of the view around the Direction. {{Version|0.19}}.
* {{PropertyData|Perspective}}: True for perspective projection, false for orthogonal projection.
* {{PropertyData|Perspective|Bool}}: True for perspective projection, false for orthogonal projection.
* {{PropertyData|Focus}}: Distance from camera to projection plane for perspective projections. Needs to be adjusted to fit the object. Too far and the perspective is lost, too close and the object is distorted.
* {{PropertyData|Focus|Distance}}: Distance from camera to projection plane for perspective projections. Needs to be adjusted to fit the object. Too far and the perspective is lost, too close and the object is distorted.


=== View === <!--T:28-->
=== View === <!--T:28-->
Line 95: Line 95:
{{TitleProperty|Base}}
{{TitleProperty|Base}}


* {{PropertyView|Keep Label}}: Always show View Label if true.
* {{PropertyView|Keep Label|Bool}}: Always show View Label if true.
* {{PropertyView|Stack Order}}: Over or under lap relative to other views.
* {{PropertyView|Stack Order|Integer}}: Over or under lap relative to other views.


{{TitleProperty|Decoration}}
{{TitleProperty|Decoration}}


* {{PropertyView|Arc Center Marks}}: Switch circular arc center marks on/off.
* {{PropertyView|Arc Center Marks|Bool}}: Circular arc center marks on/off.
* {{PropertyView|Center Scale}}: Circular arc center mark size adjustment, if enabled.
* {{PropertyView|Center Scale|Float}}: Circular arc center mark size adjustment, if enabled.
* {{PropertyView|Horiz Center Line}}: Show a horizontal centerline through the view.
* {{PropertyView|Horiz Center Line|Bool}}: Show a horizontal centerline through the view.
* {{PropertyView|Section Line Color}}: Set the section line color if applicable.
* {{PropertyView|Section Line Color|Color}}: Set the section line color if applicable.
* {{PropertyView|Section Line Style}}: Set the section line style if applicable.
* {{PropertyView|Section Line Style|Enumeration}}: Set the section line style if applicable.
* {{PropertyView|Show All Edges}}: Temporarily show invisible lines.
* {{PropertyView|Show All Edges|Bool}}: Temporarily show invisible lines.
* {{PropertyView|Show Section Line}}: Show/hide the section line if applicable.
* {{PropertyView|Show Section Line|Bool}}: Show/hide the section line if applicable.
* {{PropertyView|Vert Center Line}}: Show a vertical centerline through the view.
* {{PropertyView|Vert Center Line|Bool}}: Show a vertical centerline through the view.


{{TitleProperty|Highlight}}
{{TitleProperty|Highlight}}


* {{PropertyView|Highlight Adjust}}: Adjust the rotation of the Detail highlight.
* {{PropertyView|Highlight Adjust|Float}}: Adjust the rotation of the Detail highlight.
* {{PropertyView|Highlight Line Color}}: Set the highlight line color if applicable.
* {{PropertyView|Highlight Line Color|Color}}: Set the highlight line color if applicable.
* {{PropertyView|Highlight Line Style}}: Set the highlight line style if applicable.
* {{PropertyView|Highlight Line Style|Enumeration}}: Set the highlight line style if applicable.


{{TitleProperty|Lines}}
{{TitleProperty|Lines}}


* {{PropertyView|Extra Width}}: not implemented yet.
* {{PropertyView|Extra Width|Length}}: not implemented yet.
* {{PropertyView|Hidden Width}}: The thickness of hidden lines, if enabled.
* {{PropertyView|Hidden Width|Length}}: The thickness of hidden lines, if enabled.
* {{PropertyView|Iso Width}}: The thickness of isometric(u,v) surface lines and Dimension lines.
* {{PropertyView|Iso Width|Length}}: The thickness of isometric(u,v) surface lines and Dimension lines.
* {{PropertyView|Line Width}}: The thickness of visible lines. See [[TechDraw_LineGroup|Line Groups]].
* {{PropertyView|Line Width|Length}}: The thickness of visible lines. See [[TechDraw_LineGroup|Line Groups]].


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

Revision as of 10:27, 10 September 2022

TechDraw View

Menu location
TechDraw → Insert View
Workbenches
TechDraw
Default shortcut
None
Introduced in version
-
See also
TechDraw Projection Group, TechDraw Section View

Description

The View tool adds a representation of one or more objects to a Drawing page. This is the basic building block of the TechDraw workbench. Most other Views are derived in some way from View.

View will try to draw anything with a Shape property. You can select sketches, PartDesign Bodies, Draft objects etc. View will also extract any shapes from objects within a Std Part or a Std Group.

View of a solid box with hidden lines

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.
  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. This is not optional for version 0.19 and below.
  4. There are several ways to invoke the tool:
    • Press the Insert View button.
    • Select the TechDraw → Insert View 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.

Properties

Data

Base

  • DataX (Distance): The view's horizontal position on the page. (1)
  • DataY (Distance): The view's vertical position on the page. (1)
  • DataLock Position (Bool): Prevents Views from being dragged in the Gui when true. The View can still be moved by changing X,Y properties. (1)
  • DataRotation (Angle): Counterclockwise rotation of the View on the page in degrees. (1)
  • DataScale Type (Enumeration): "Document": use the Page's scale setting. "Custom": use a scale unique to this view. "Automatic": fit view to page. (1)
  • DataScale (FloatConstant): A view will be rendered on the page in Scale:1 ratio to the Source. (1)
  • DataCaption (String): Optional short text caption.

(1) these properties are common to all View types.

HLR Parameters

  • DataCoarse View (Bool): If true, TechDraw will use a polygon approximation to calculate drawing geometry. If false, TechDraw will use a precision algorithm. CoarseView can be much faster for complex models. The quality of the drawing is reduced, since every curve is approximated as a series of short line segments. Vertices are not displayed in CoarseView since each short segment would result in two new Vertices and the display becomes cluttered. Linear Dimensions can be added to a CoarseView, but are unlikely to be useful.
  • DataSmooth Visible (Bool): Visible Smooth lines on/off.
  • DataSeam Visible (Bool): Visible Seam lines on/off.
  • DataIso Visible (Bool): Visible Isometric(u,v) lines on/off.
  • DataHard Hidden (Bool): Hidden lines on/off.
  • DataSmooth Hidden (Bool): Hidden Smooth lines on/off.
  • DataSeam Hidden (Bool): Hidden Seam lines on/off.
  • DataIso Hidden (Bool): Hidden Isometric(u,v) lines on/off.
  • DataIso Count (Integer): Number of Isometric(u,v) lines to draw on each face.

Projection

  • DataSource (LinkList): Links to the drawable objects to be depicted.
  • DataXSource (XLinkList): Links to the drawable objects in an external file. introduced in version 0.19
  • DataDirection (Vector): this vector controls the direction from which you are viewing the object. +X is right, -X is left, +Y is rear, -Y is front (looking into the screen), +Z is up and -Z is down. So a Front view is (0,-1,0) and an isometric view is (1,-1,1).
  • DataXDirection (Vector): this vector controls the rotation of the view around the Direction. introduced in version 0.19.
  • DataPerspective (Bool): True for perspective projection, false for orthogonal projection.
  • DataFocus (Distance): Distance from camera to projection plane for perspective projections. Needs to be adjusted to fit the object. Too far and the perspective is lost, too close and the object is distorted.

View

Base

  • ViewKeep Label (Bool): Always show View Label if true.
  • ViewStack Order (Integer): Over or under lap relative to other views.

Decoration

  • ViewArc Center Marks (Bool): Circular arc center marks on/off.
  • ViewCenter Scale (Float): Circular arc center mark size adjustment, if enabled.
  • ViewHoriz Center Line (Bool): Show a horizontal centerline through the view.
  • ViewSection Line Color (Color): Set the section line color if applicable.
  • ViewSection Line Style (Enumeration): Set the section line style if applicable.
  • ViewShow All Edges (Bool): Temporarily show invisible lines.
  • ViewShow Section Line (Bool): Show/hide the section line if applicable.
  • ViewVert Center Line (Bool): Show a vertical centerline through the view.

Highlight

  • ViewHighlight Adjust (Float): Adjust the rotation of the Detail highlight.
  • ViewHighlight Line Color (Color): Set the highlight line color if applicable.
  • ViewHighlight Line Style (Enumeration): Set the highlight line style if applicable.

Lines

  • ViewExtra Width (Length): not implemented yet.
  • ViewHidden Width (Length): The thickness of hidden lines, if enabled.
  • ViewIso Width (Length): The thickness of isometric(u,v) surface lines and Dimension lines.
  • ViewLine Width (Length): The thickness of visible lines. See Line Groups.

Scripting

See also: TechDraw API and FreeCAD Scripting Basics.

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

view = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewPart','View')
rc = page.addView(view)
FreeCAD.ActiveDocument.View.Source = [App.ActiveDocument.Box]
FreeCAD.ActiveDocument.View.Direction = (0.0,0.0,1.0)