TechDraw View/ro: Difference between revisions

From FreeCAD Documentation
(Created page with "==Note== * Vizualizarea va desena orice cu o proprietate Shape. Puteți selecta obiecte Draft și Body. Aplicație :: Part container sau un grup DocumentObject. * Proprietate...")
(Updating to match new version of source page)
 
(54 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
{{GuiCommand|Name=TechDraw NewView|Workbenches=[[TechDraw Module|TechDraw]]|MenuLocation=TechDraw → View|Shortcut=na|SeeAlso=}}


<div class="mw-translate-fuzzy">
{{Docnav/ro
|[[TechDraw_RedrawPage|Redraw Page]]
|[[TechDraw_ActiveView|Insert Active View]]
|[[TechDraw_Workbench|TechDraw]]
|IconL=TechDraw RedrawPage.svg
|IconC=Workbench_TechDraw.svg
|IconR=TechDraw_ActiveView.svg
}}
</div>

<div class="mw-translate-fuzzy">
{{GuiCommand/ro
|Name/ro=Noua vedere TechDraw
|MenuLocation=TechDraw → Insert View
|Workbenches=[[TechDraw Workbench|TechDraw]]
|SeeAlso=[[TechDraw_ProjectionGroup|Insert Projection Group]], [[TechDraw_SectionView|Insert Section View]]
}}
</div>

<span id="Description"></span>
==Descriere==
==Descriere==
Instrumentul Vizualizare adaugă o reprezentare a unuia sau mai multor obiecte pe o pagină de desen. Acesta este blocul de bază al modulului TechDraw. La plupart des autres vues proviennent de NewView.
Instrumentul Vizualizare adaugă o reprezentare a unuia sau mai multor obiecte pe o pagină de desen. Acesta este blocul de bază al modulului TechDraw. La plupart des autres vues proviennent de NewView.
[[File:ViewOfBox2.png|200px|center]]


[[Image:TechDraw_View_example.png]]

The '''TechDraw 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 {{incode|Shape}} property. You can select [[Sketcher_Workbench|sketches]], [[PartDesign_Body|PartDesign Bodies]], [[Draft_Workbench|Draft objects]] etc. View will also extract any shapes from objects within a [[Std_Part|Std Part]] or a [[Std_Group|Std Group]].

[[Image:TechDraw_View_example.png]]
{{Caption|View of a solid box with hidden lines}}

<span id="Usage"></span>
<div class="mw-translate-fuzzy">
==Cum se utilizează==
==Cum se utilizează==
</div>
# Selectați unul sau mai multe obiecte (Corp, Aplicație :: Parte, Parte :: Funcție, Proiect de obiect, ... Vezi Note) în fereastra sau arborele 3D.
# Dacă aveți mai multe pagini de desen în document, va trebui, de asemenea, să selectați pagina dorită din arborescență.
# Apăsați butonul {{KEY|[[Image:Techdraw-view.png|24px]] [[TechDraw NewView|View]]}}


# Optionally rotate the [[3D_view|3D view]]. Unless a face is selected in the next step, the camera direction in the [[3D_view|3D view]] determines the initial value of the {{PropertyData|Direction}} property of the View.
==Opțiuni==
# Select one or more objects in the [[3D_view|3D view]] or [[Tree_view|Tree view]]. When selecting in the 3D view the first selected face determines the initial value of the {{PropertyData|Direction}} property.
Niciuna.
# 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]].
# There are several ways to invoke the tool:
#* Press the {{Button|[[Image:TechDraw_View.svg|16px]] [[TechDraw_View|Insert View]]}} button.
#* Select the {{MenuCommand|TechDraw → TechDraw Views → [[Image:TechDraw_View.svg|16px]] Insert View}} option from the menu.
# 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.
## Press the {{Button|OK}} button.


<span id="Properties"></span>
==Proprietăți==
==Proprietăți==
* {{PropertyData|X}}:
* {{PropertyData|X}}: Poziția orizontală a vederii pe pagină (1)
Poziția orizontală a vederii pe pagină (1)
* {{PropertyData|Y}}: Poziția verticală a vederii pe pagină.(1)
* {{PropertyData|Y}}: Poziția verticală a vederii pe pagină.(1)
* {{PropertyData|LockPosition}}: Împiedică afișarea vederilor din Gui când este adevărat. Vizualizarea poate fi în continuare mutată prin schimbarea proprietăților X, Y.(1)
* {{PropertyData|LockPosition}}: Împiedică afișarea vederilor din Gui când este True. Vizualizarea poate fi în continuare mutată prin schimbarea proprietăților X, Y.(1)
* {{PropertyData|Rotation}}: Counterclockwise rotation of the View on the page in degrees. (1)
* {{PropertyData|Rotation}}: Rotație antiorară a afișării vizualizării pe pagină exporimată în grade (1)
* {{PropertyData|ScaleType}}: "Document": use the Page's scale setting. "Custom": use a scale unique to this view. "Automatic": fit view to page. (1)
* {{PropertyData|ScaleType}}: "Document": utilizați setările de scală ale Paginii. "Custom": utilizați o scală unică doar pentru această vedere. "Automatic": potrivește vizualizarea în pagină. (1)
* {{PropertyData|Scale}}: A view will be rendered on the page in Scale:1 ratio to the Source. (1)
* {{PropertyData|Scale}}: A view will be rendered on the page in Scale:1 ratio to the Source. (1)
* {{PropertyData|Caption}}: Optional short text caption.
* {{PropertyData|Caption}}: Optional short text caption.
Line 30: Line 65:
* {{PropertyData|Smooth Visible Lines}}: Visible Smooth lines on/off.
* {{PropertyData|Smooth Visible Lines}}: Visible Smooth lines on/off.
* {{PropertyData|Seam Visible Lines}}: Visible Seam lines on/off.
* {{PropertyData|Seam Visible Lines}}: Visible Seam lines on/off.
* {{PropertyData|Iso Visible Lines}}: Visible Isometric(u,v) lines on/off.
* {{PropertyData|Iso Visible Lines}}:Liniile izometrice vizibile (u,v) sunt activate/dezactivate.
* {{PropertyData|Hard Hidden Lines}}: Hidden lines on/off.
* {{PropertyData|Hard Hidden Lines}}: Liniile ascunse sunt activate/dezactivate.
* {{PropertyData|Smooth Hidden Lines}}: Hidden Smooth lines on/off.
* {{PropertyData|Smooth Hidden Lines}}: Liniile lise sunt activate/dezactivate.
* {{PropertyData|Seam Hidden Lines}}: Linii Seam ascunse on/off.
* {{PropertyData|Seam Hidden Lines}}: Liniile de cusătuiră ( Seam) ascunse activate/dezactivate .
* {{PropertyData|Iso Hidden Lines}}: Linii izometrice ascunse (u, v) on /off.
* {{PropertyData|Iso Hidden Lines}}: Linii izometrice ascunse (u, v) sunt activate /dezactivate.
* {{PropertyData|Iso Count}}: Numărul liniilor izometrice (u, v) care se desenează pe fiecare parte.
* {{PropertyData|Iso Count}}: Numărul de linii izometrice (u, v) care se desenează pe fiecare fațetă.


=== Data ===
* {{PropertyView|Keep Label}}: Always show View Label if true.

* {{PropertyView|LineWidth}}: The thickness of visible lines. See [[TechDraw_LineGroup|Line Groups]].
{{TitleProperty|Base}}
* {{PropertyView|HiddenWidth}}: The thickness of hidden lines, if enabled.

* {{PropertyView|IsoWidth}}: The thickness of isometric(u,v) surface lines and Dimension lines.
* {{PropertyData|X|Distance}}: The view's horizontal position on the page. (1)
* {{PropertyView|ExtraWidth}}: not implemented yet.
* {{PropertyData|Y|Distance}}: The view's vertical position on the page. (1)
* {{PropertyView|ShowCenters}}: Circle/arc center marks on/off.
* {{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)
* {{PropertyView|CenterScale}}: Circular arc center mark size adjustment, if enabled.
* {{PropertyData|Rotation|Angle}}: Counterclockwise rotation of the View on the page in degrees. (1)
* {{PropertyView|HorizCenterLine}}: Show a horizontal centerline through view.
* {{PropertyData|Scale Type|Enumeration}}: The scale type. Options: (1)
* {{PropertyView|VertCenterLine}}: Show a vertical centerline through view.
** {{Value|Page}}: Use the [[TechDraw_PageDefault|Page]]'s scale setting.
* {{PropertyView|ShowSectionLine}}: Show/hide section line if applicable.
** {{Value|Automatic}}: Fit the view to the page.
** {{Value|Custom}}: Use the scale defined by {{PropertyData|Scale}}.
* {{PropertyData|Scale|FloatConstant}}: The view will be rendered on the page in Scale:1 ratio to the Source. (1)
* {{PropertyData|Caption|String}}: Optional short text caption. (1)

{{TitleProperty|Cosmetics}}

* {{PropertyData|Cosmetic Vertexes|TechDraw::PropertyCosmeticVertexList|Hidden}}
* {{PropertyData|Cosmetic Edges|TechDraw::PropertyCosmeticEdgeList|Hidden}}
* {{PropertyData|Center Lines|TechDraw::PropertyCenterLineList|Hidden}}
* {{PropertyData|Geom Formats|TechDraw::PropertyGeomFormatList|Hidden}}

{{TitleProperty|HLR Parameters}}

* {{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|Bool}}: Visible Smooth lines on/off.
* {{PropertyData|Seam Visible|Bool}}: Visible Seam lines on/off.
* {{PropertyData|Iso Visible|Bool}}: Visible Isometric(u,v) lines on/off.
* {{PropertyData|Hard Hidden|Bool}}: Hidden lines on/off.
* {{PropertyData|Smooth Hidden|Bool}}: Hidden Smooth lines on/off.
* {{PropertyData|Seam Hidden|Bool}}: Hidden Seam lines on/off.
* {{PropertyData|Iso Hidden|Bool}}: Hidden Isometric(u,v) lines on/off.
* {{PropertyData|Iso Count|Integer}}: Number of Isometric(u,v) lines to draw on each face.

{{TitleProperty|Projection}}

* {{PropertyData|Source|LinkList}}: Links to the drawable objects to be depicted.
* {{PropertyData|XSource|XLinkList}}: Links to the drawable objects in an external file.
* {{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|Vector}}: This vector controls the rotation of the view around the Direction.
* {{PropertyData|Perspective|Bool}}: {{TRUE}} for perspective projection, {{FALSE}} for orthogonal projection.
* {{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 ===

{{TitleProperty|Base}}

* {{PropertyView|Keep Label|Bool}}: Always show view label if {{TRUE}}. (1)
* {{PropertyView|Stack Order|Integer}}: Over or under lap relative to other views. (1) {{Version|0.21}}

{{TitleProperty|Decoration}}

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

{{TitleProperty|Highlight}}

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

{{TitleProperty|Lines}}

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


(1) Aceste proprietăți sunt comune tuturor tipurilor de vizualizare.
(1) Aceste proprietăți sunt comune tuturor tipurilor de vizualizare.


<span id="Scripting"></span>
==Script==
==Script==
Vederile pot fi adăugate la Pages utilizând Python.
Vederile pot fi adăugate la Pages utilizând Python.

See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].

A View can be created with [[Macros|macros]] and from the [[Python|Python]] console by using the following functions:

{{Code|code=
{{Code|code=
import FreeCAD as App
view = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewPart','View')

rc = page.addView(view)
FreeCAD.ActiveDocument.View.Source = [App.ActiveDocument.Box]
doc = App.ActiveDocument
box = doc.addObject("Part::Box", "Box")
FreeCAD.ActiveDocument.View.Direction = (0.0,0.0,1.0)

page = doc.addObject("TechDraw::DrawPage", "Page")
template = doc.addObject("TechDraw::DrawSVGTemplate", "Template")
template.Template = App.getResourceDir() + "Mod/TechDraw/Templates/A4_LandscapeTD.svg"
page.Template = template

# Toggle the visibility of the page to ensure its width and height are updated (hack):
page.Visibility = False
page.Visibility = True

view = doc.addObject("TechDraw::DrawViewPart", "View")
page.addView(view)
view.Source = [box]
view.Direction = (0, 0, 1)

view.X = page.PageWidth / 2
view.Y = page.PageHeight / 2

doc.recompute()
}}


<div class="mw-translate-fuzzy">
{{Docnav/ro
|[[TechDraw_RedrawPage|Redraw Page]]
|[[TechDraw_ActiveView|Insert Active View]]
|[[TechDraw_Workbench|TechDraw]]
|IconL=TechDraw RedrawPage.svg
|IconC=Workbench_TechDraw.svg
|IconR=TechDraw_ActiveView.svg
}}
}}
</div>


{{TechDraw Tools navi{{#translation:}}}}
==Note==
{{Userdocnavi{{#translation:}}}}
* Vizualizarea va desena orice cu o proprietate Shape. Puteți selecta obiecte Draft și Body. Aplicație :: Part container sau un grup DocumentObject.
* Proprietatea Projection Direction: Acest vector controlează direcția din care vizualizați obiectul. +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).
* 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.
* Rețineți că CoarseView este afectat de o eroare din amonte în OCCT ([https://www.freecadweb.org/tracker/view.php?id=3332 #3332]) ceea ce face ca poziția Vizualizării pe pagină să fie ușor decalată față de valorile X, Y specificate.

Latest revision as of 16:51, 25 July 2023

Noua vedere TechDraw

poziția meniului
TechDraw → Insert View
Ateliere
TechDraw
scurtătură
nici unul
Prezentat în versiune
-
A se vedea, de asemenea,
Insert Projection Group, Insert Section View

Descriere

Instrumentul Vizualizare adaugă o reprezentare a unuia sau mai multor obiecte pe o pagină de desen. Acesta este blocul de bază al modulului TechDraw. La plupart des autres vues proviennent de NewView.

The TechDraw 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

Cum se utilizează

  1. Optionally rotate the 3D view. Unless a face is selected in the next step, the camera direction in the 3D view determines the initial value of the DateDirection property of the View.
  2. Select one or more objects in the 3D view or Tree view. When selecting in the 3D view the first selected face determines the initial value of the DateDirection property.
  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 View button.
    • Select the TechDraw → TechDraw Views → 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.

Proprietăți

  • DateX: Poziția orizontală a vederii pe pagină (1)
  • DateY: Poziția verticală a vederii pe pagină.(1)
  • DateLockPosition: Împiedică afișarea vederilor din Gui când este True. Vizualizarea poate fi în continuare mutată prin schimbarea proprietăților X, Y.(1)
  • DateRotation: Rotație antiorară a afișării vizualizării pe pagină exporimată în grade (1)
  • DateScaleType: "Document": utilizați setările de scală ale Paginii. "Custom": utilizați o scală unică doar pentru această vedere. "Automatic": potrivește vizualizarea în pagină. (1)
  • DateScale: A view will be rendered on the page in Scale:1 ratio to the Source. (1)
  • DateCaption: Optional short text caption.
  • DateSource: Links to the Drawable Objects to be depicted
  • DateDirection: A vector representing the viewing direction. See note below. (1)
  • DatePerspective: True for perspective projection, false for orthogonal projection.
  • DateFocus: 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.
  • DateCoarseView: If true, TechDraw will use a polygon approximation to calculate drawing geometry. If false, TechDraw will use a precision algorithm. See Notes.
  • DateSmooth Visible Lines: Visible Smooth lines on/off.
  • DateSeam Visible Lines: Visible Seam lines on/off.
  • DateIso Visible Lines:Liniile izometrice vizibile (u,v) sunt activate/dezactivate.
  • DateHard Hidden Lines: Liniile ascunse sunt activate/dezactivate.
  • DateSmooth Hidden Lines: Liniile lise sunt activate/dezactivate.
  • DateSeam Hidden Lines: Liniile de cusătuiră ( Seam) ascunse activate/dezactivate .
  • DateIso Hidden Lines: Linii izometrice ascunse (u, v) sunt activate /dezactivate.
  • DateIso Count: Numărul de linii izometrice (u, v) care se desenează pe fiecare fațetă.

Data

Base

  • DateX (Distance): The view's horizontal position on the page. (1)
  • DateY (Distance): The view's vertical position on the page. (1)
  • DateLock Position (Bool): Prevents Views from being dragged in the Gui when true. The View can still be moved by changing X,Y properties. (1)
  • DateRotation (Angle): Counterclockwise rotation of the View on the page in degrees. (1)
  • DateScale Type (Enumeration): The scale type. Options: (1)
    • Page: Use the Page's scale setting.
    • Automatic: Fit the view to the page.
    • Custom: Use the scale defined by DateScale.
  • DateScale (FloatConstant): The view will be rendered on the page in Scale:1 ratio to the Source. (1)
  • DateCaption (String): Optional short text caption. (1)

Cosmetics

  • Date (Hidden)Cosmetic Vertexes (TechDraw::PropertyCosmeticVertexList)
  • Date (Hidden)Cosmetic Edges (TechDraw::PropertyCosmeticEdgeList)
  • Date (Hidden)Center Lines (TechDraw::PropertyCenterLineList)
  • Date (Hidden)Geom Formats (TechDraw::PropertyGeomFormatList)

HLR Parameters

  • DateCoarse 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.
  • DateSmooth Visible (Bool): Visible Smooth lines on/off.
  • DateSeam Visible (Bool): Visible Seam lines on/off.
  • DateIso Visible (Bool): Visible Isometric(u,v) lines on/off.
  • DateHard Hidden (Bool): Hidden lines on/off.
  • DateSmooth Hidden (Bool): Hidden Smooth lines on/off.
  • DateSeam Hidden (Bool): Hidden Seam lines on/off.
  • DateIso Hidden (Bool): Hidden Isometric(u,v) lines on/off.
  • DateIso Count (Integer): Number of Isometric(u,v) lines to draw on each face.

Projection

  • DateSource (LinkList): Links to the drawable objects to be depicted.
  • DateXSource (XLinkList): Links to the drawable objects in an external file.
  • DateDirection (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).
  • DateXDirection (Vector): This vector controls the rotation of the view around the Direction.
  • DatePerspective (Bool): true for perspective projection, false for orthogonal projection.
  • DateFocus (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

  • VizualizareKeep Label (Bool): Always show view label if true. (1)
  • VizualizareStack Order (Integer): Over or under lap relative to other views. (1) introduced in version 0.21

Decoration

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

Highlight

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

Lines

  • VizualizareExtra Width (Length): Not implemented yet.
  • VizualizareHidden Width (Length): The thickness of hidden lines, if enabled.
  • VizualizareIso Width (Length): The thickness of isometric(u,v) surface lines and Dimension lines.
  • VizualizareLine Width (Length): The thickness of visible lines. See Line Groups.

(1) Aceste proprietăți sunt comune tuturor tipurilor de vizualizare.

Script

Vederile pot fi adăugate la Pages utilizând Python.

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

A View can be created with macros and from the Python console by using the following functions:

import FreeCAD as App

doc = App.ActiveDocument
box = doc.addObject("Part::Box", "Box")

page = doc.addObject("TechDraw::DrawPage", "Page")
template = doc.addObject("TechDraw::DrawSVGTemplate", "Template")
template.Template = App.getResourceDir() + "Mod/TechDraw/Templates/A4_LandscapeTD.svg"
page.Template = template

# Toggle the visibility of the page to ensure its width and height are updated (hack):
page.Visibility = False
page.Visibility = True

view = doc.addObject("TechDraw::DrawViewPart", "View")
page.addView(view)
view.Source = [box]
view.Direction = (0, 0, 1)

view.X = page.PageWidth / 2
view.Y = page.PageHeight / 2

doc.recompute()