Draft Drawing/sv: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 1: Line 1:
<languages/>
<languages/>
<div class="mw-translate-fuzzy">
{{GuiCommand/sv|Name=Draft_Drawing|Name/sv=Draft Drawing|Workbenches=[[Draft Module/sv|Skiss]]|MenuLocation=Drafting → Drawing}}
{{GuiCommand/sv|Name=Draft_Drawing|Name/sv=Draft Drawing|Workbenches=[[Draft Module/sv|Skiss]]|MenuLocation=Drafting → Drawing}}
</div>


==Beskrivning==
==Beskrivning==
Line 7: Line 9:
detta verktyg tillåter dig att lägga valda objekt på ett svg [[Drawing Module/sv|ritningsark]].
detta verktyg tillåter dig att lägga valda objekt på ett svg [[Drawing Module/sv|ritningsark]].
</div>
</div>

This tool works similarly to the [[Drawing View]] tool but is optimized for [[Draft Workbench]] objects, and can render 2D objects with a face filling. It can handle specific objects such as [[Draft Dimension]] and [[Draft Text]], that the [[Drawing View]] tool cannot handle.


[[Image:Draft drawing example.jpg|640px]]
[[Image:Draft drawing example.jpg|640px]]
{{Caption|Draft object and dimensions imported into a Drawing page}}


==Bruk==
==Bruk==


# Select the objects you wish to put on a drawing sheet
# Select the objects that you wish to put on a drawing sheet.
# In the same selection, add the [[Drawing Workbench]] page object in which you want to draw the projection of the objects.
# Press the {{KEY|[[Image:Draft Drawing.png|16px]] [[Draft Drawing]]}} button
# Press the {{Button|[[Image:Draft Drawing.png|16px]] [[Draft Drawing]]}} button.

Notes:
* The tool will work best with 2D objects from the [[Draft Workbench]] or [[Sketcher Workbench]].
* The selected object can also be an [[Arch SectionPlane]], which will show the elements viewed by that plane.
* If there is no existing page, a new one will be created.
* If no page was selected but there is at least one in the document, the first page found will be used to put the projections.
* If you select a sheet and the objects already projected on that sheet, the projections will be updated.


==Options==
==Options==


<div class="mw-translate-fuzzy">
* Välj de objekt som du vill ha på ritningsarket.
* Välj de objekt som du vill ha på ritningsarket.
* Addera i samma val det sidobjekt som du vill rita dina objekt på. Om det inte finns någon existerande sida, så kommer en ny att skapas. Om du inte valde en sida, men det finns åtminstone en i dokumentet, så kommer den som hittas först att användas som underlag.
* Addera i samma val det sidobjekt som du vill rita dina objekt på. Om det inte finns någon existerande sida, så kommer en ny att skapas. Om du inte valde en sida, men det finns åtminstone en i dokumentet, så kommer den som hittas först att användas som underlag.
Line 24: Line 38:
* Ställ in/justera textstorleken. Högre värden kommer att resultera i större text.
* Ställ in/justera textstorleken. Högre värden kommer att resultera i större text.
* Om du valde ett existerande ark, och du har valt objekt som redan finns på det arket (till exempel för ett "Rectangle" objekt så finns det redan ett "ViewRectangle" objekt på arket), så kommer de att ersättas. Detta tillåter dig att helt enkelt välja alla objekt och skicka dem till en existerande sida, vilken kommer att uppdateras.
* Om du valde ett existerande ark, och du har valt objekt som redan finns på det arket (till exempel för ett "Rectangle" objekt så finns det redan ett "ViewRectangle" objekt på arket), så kommer de att ersättas. Detta tillåter dig att helt enkelt välja alla objekt och skicka dem till en existerande sida, vilken kommer att uppdateras.
</div>


==Properties==
==Properties==


* {{PropertyData|Fill Style}}: For closed shapes, allows to specify one of the Default Draft fill styles, or use the shape color.
* {{PropertyData|Fill Style}}: specifies the fill style "concrete", "square", "simple", "wood", "line", "cross", "woodgrain", or "shape color". This property only works for closed shapes.
* {{PropertyData|Font Size}}: Allows you to specify the font size of texts and dimensions.
* {{PropertyData|Font Size}}: specifies the font size of texts and dimensions.
* {{PropertyData|Line Width}}: Allows you to specify the line width of viewed objects.
* {{PropertyData|Line Width}}: specifies the line width of viewed objects in millimeters.


==Scripting==
==Scripting==
{{Emphasis|See also:}} [[Draft API]] and [[FreeCAD Scripting Basics]].


The Draft Drawing tool can by used in [[macros]] and from the python console by using the following function:
The Drawing tool can be used in [[macros]] and from the [[Python]] console by using the following function:


{{Code|code=
{{Code|code=
DrawingView = makeDrawingView(obj, page, lwmod=None, tmod=None, otherProjection=None)
Draft.makeDrawingView (object,page)
}}
}}


* Creates a {{incode|DrawingView}} from {{incode|obj}} in the specified {{incode|page}}.
* Adds a view of the given object to the given page.
* If given, {{incode|lwmod}} modifies line weights in percentage, and {{incode|tmod}} modifies text heights in percentage.
* Returns the created view object.


The attributes of the view usually need to be modified so that it is displayed correctly in the drawing page. In particular, the position is controlled by {{incode|X}} and {{incode|Y}}, which are given in millimeters, and {{incode|Scale}} is important to correctly fit the projected shape in the page. The scale usually ranges from 1 to 0.25 (1:1 to 1:4) for small solids, and from 0.02 to 0.01 (1:50 to 1:100) for typical architectural elements.
Example:


Example:
{{Code|code=
{{Code|code=
import FreeCAD,Draft
import FreeCAD, Draft, Drawing

obj = FreeCAD.ActiveDocument.ActiveObject
obj = Draft.makePolygon(5, 1000)
page = FreeCAD.ActiveDocument.Page
page = FreeCAD.ActiveDocument.addObject('Drawing::FeaturePage', 'Page')
Draft.makeDrawingView(obj,page)
page.Template = FreeCAD.getResourceDir() + 'Mod/Drawing/Templates/A3_Landscape.svg'

View = Draft.makeDrawingView(obj, page)
View.Scale = 0.02
FreeCAD.ActiveDocument.recompute()

View.X = 200
View.Y = 150
FreeCAD.ActiveDocument.recompute()
}}
}}

{{Draft Tools navi}}
{{Userdocnavi}}
{{clear}}

Revision as of 13:12, 8 January 2019

Draft Drawing

Menyplacering
Drafting → Drawing
Arbetsbänkar
Skiss
Standard genväg
Ingen
Introducerad i version
-
Se även
Ingen

Beskrivning

detta verktyg tillåter dig att lägga valda objekt på ett svg ritningsark.

This tool works similarly to the Drawing View tool but is optimized for Draft Workbench objects, and can render 2D objects with a face filling. It can handle specific objects such as Draft Dimension and Draft Text, that the Drawing View tool cannot handle.

Draft object and dimensions imported into a Drawing page

Bruk

  1. Select the objects that you wish to put on a drawing sheet.
  2. In the same selection, add the Drawing Workbench page object in which you want to draw the projection of the objects.
  3. Press the Draft Drawing button.

Notes:

  • The tool will work best with 2D objects from the Draft Workbench or Sketcher Workbench.
  • The selected object can also be an Arch SectionPlane, which will show the elements viewed by that plane.
  • If there is no existing page, a new one will be created.
  • If no page was selected but there is at least one in the document, the first page found will be used to put the projections.
  • If you select a sheet and the objects already projected on that sheet, the projections will be updated.

Options

  • Välj de objekt som du vill ha på ritningsarket.
  • Addera i samma val det sidobjekt som du vill rita dina objekt på. Om det inte finns någon existerande sida, så kommer en ny att skapas. Om du inte valde en sida, men det finns åtminstone en i dokumentet, så kommer den som hittas först att användas som underlag.
  • De objekt som visas på ritningssidan kommer att använda den skala och offsetvärden som värdsidan har. Försäkra dig om att ställa in dessa värden innan.
  • Du kan ändra objektens skala och offset när som helst.
  • Ställ in/justera linjebredden. Högre värden kommer att resultera i tjockare linjer.
  • Ställ in/justera textstorleken. Högre värden kommer att resultera i större text.
  • Om du valde ett existerande ark, och du har valt objekt som redan finns på det arket (till exempel för ett "Rectangle" objekt så finns det redan ett "ViewRectangle" objekt på arket), så kommer de att ersättas. Detta tillåter dig att helt enkelt välja alla objekt och skicka dem till en existerande sida, vilken kommer att uppdateras.

Properties

  • DataFill Style: specifies the fill style "concrete", "square", "simple", "wood", "line", "cross", "woodgrain", or "shape color". This property only works for closed shapes.
  • DataFont Size: specifies the font size of texts and dimensions.
  • DataLine Width: specifies the line width of viewed objects in millimeters.

Scripting

See also: Draft API and FreeCAD Scripting Basics.

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

DrawingView = makeDrawingView(obj, page, lwmod=None, tmod=None, otherProjection=None)
  • Creates a DrawingView from obj in the specified page.
  • If given, lwmod modifies line weights in percentage, and tmod modifies text heights in percentage.

The attributes of the view usually need to be modified so that it is displayed correctly in the drawing page. In particular, the position is controlled by X and Y, which are given in millimeters, and Scale is important to correctly fit the projected shape in the page. The scale usually ranges from 1 to 0.25 (1:1 to 1:4) for small solids, and from 0.02 to 0.01 (1:50 to 1:100) for typical architectural elements.

Example:

import FreeCAD, Draft, Drawing

obj = Draft.makePolygon(5, 1000)
page = FreeCAD.ActiveDocument.addObject('Drawing::FeaturePage', 'Page')
page.Template = FreeCAD.getResourceDir() + 'Mod/Drawing/Templates/A3_Landscape.svg'

View = Draft.makeDrawingView(obj, page)
View.Scale = 0.02
FreeCAD.ActiveDocument.recompute()

View.X = 200
View.Y = 150
FreeCAD.ActiveDocument.recompute()