Part Box/en: Difference between revisions

From FreeCAD Documentation
(Importing a new version from external source)
 
(Updating to match new version of source page)
(43 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
{{GuiCommand|Name=Part_Box|MenuLocation=Part -> Box||Workbenches=[[Part_Module|Part_Module]],Complete|SeeAlso=[[Part_CreatePrimitives|Part_CreatePrimitives]]}}
{{Docnav
|
|[[Part_Cylinder|Cylinder]]
|[[Part_Workbench|Part]]
|IconL=
|IconR=Part_Cylinder.svg
|IconC=Workbench_Part.svg
}}


{{GuiCommand
Creates a simple parametric box, with position, height, length and width parameters.
|Name=Part Box
|MenuLocation=Part → Primitives → Cube
|Workbenches=[[Part_Workbench|Part]]
|SeeAlso=[[Part_Primitives|Part Primitives]]
}}


==Description==
The default is for a cube of 10mm x 10mm x 10mm to be positioned at the global origin (point 0,0,0) on creation.
The Box command from the [[Part_Workbench|Part Workbench]] inserts a parametric, [http://en.wikipedia.org/wiki/Cuboid#Rectangular_cuboid rectangular cuboid], geometric primitive into the active document. By default, the Box command will insert a 10x10x10 mm cube, positioned at the origin, with the label "cube". These parameters may be modified after the object has been added.


[[Image:Part_Box.jpg|400px|Part_Box]]
The properties can later be edited in the data tab for the box:


==Usage==
The height is the distance in the z-axis.
# Switch to the [[Image:Workbench_Part.svg|16px]] [[Part_Workbench|Part Workbench]]
# There are several ways to invoke the command:
#* Press the {{Button|[[Image:Part_Box.svg|16px]] Cube}} button in the toolbar.
#* Select the {{MenuCommand|Part → Primitives → [[Image:Part_Box.svg|16px]] Cube}} from the menu bar.


'''Result:''' The default result is a box with an equal length, width and height of 10 mm. It is attached to the global xy-plane and one edge is coincident with the global z-axis.
The length is the distance in the x-axis.


The box properties can later be edited, either in the property editor or by double-clicking on the box in the model tree.
The width is the distance in the y-axis.


==Properties==
[[File:box.png|650px|a box created with the Box tool]]
{{Properties_Title|Base}}
*{{PropertyData|Placement}}: Specifies the orientation and position of the Box in the 3D space. See [[Placement|Placement]]. The reference point is the left front lower corner of the box.
*{{PropertyData|Label}}: Label given to the Box object. Change to suit your needs.


{{Properties_Title|Box}}
{{clear}}
*{{PropertyData|Length}}: The length parameter is the Box's dimension in the x-direction.
<languages/>
*{{PropertyData|Width}}: The width parameter is the Box's dimension in the y-direction.
*{{PropertyData|Height}}: The height parameter is the Box's dimension in the z-direction.

[[Image:Part_Box-Properties.jpg|Part_Box-Properties]]

==Scripting==
The Box command can by used in [[Macros|macros]] and from the python console using the following function:
{{Code|code=
FreeCAD.ActiveDocument.addObject("Part::Box", "myBox")
}}
* Where "myBox" is the label for the Box object.
* Returns newly created object of type Box.

You can access and modify attributes of the Box object. For example, you may wish to modify the length, width and height parameters.
{{Code|code=
FreeCAD.ActiveDocument.myBox.Length = 25
FreeCAD.ActiveDocument.myBox.Width = 15
FreeCAD.ActiveDocument.myBox.Height = 30
}}

You can change its placement with:
{{Code|code=
FreeCAD.ActiveDocument.myBox.Placement = FreeCAD.Placement(FreeCAD.Vector(4, 6, 3), FreeCAD.Rotation(30, 45, 10))
}}


{{Docnav
|
|[[Part_Cylinder|Cylinder]]
|[[Part_Workbench|Part]]
|IconL=
|IconR=Part_Cylinder.svg
|IconC=Workbench_Part.svg
}}

{{Part Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}

Revision as of 12:11, 25 August 2021

Part Box

Menu location
Part → Primitives → Cube
Workbenches
Part
Default shortcut
None
Introduced in version
-
See also
Part Primitives

Description

The Box command from the Part Workbench inserts a parametric, rectangular cuboid, geometric primitive into the active document. By default, the Box command will insert a 10x10x10 mm cube, positioned at the origin, with the label "cube". These parameters may be modified after the object has been added.

Part_Box

Usage

  1. Switch to the Part Workbench
  2. There are several ways to invoke the command:
    • Press the Cube button in the toolbar.
    • Select the Part → Primitives → Cube from the menu bar.

Result: The default result is a box with an equal length, width and height of 10 mm. It is attached to the global xy-plane and one edge is coincident with the global z-axis.

The box properties can later be edited, either in the property editor or by double-clicking on the box in the model tree.

Properties

Base

  • DataPlacement: Specifies the orientation and position of the Box in the 3D space. See Placement. The reference point is the left front lower corner of the box.
  • DataLabel: Label given to the Box object. Change to suit your needs.

Box

  • DataLength: The length parameter is the Box's dimension in the x-direction.
  • DataWidth: The width parameter is the Box's dimension in the y-direction.
  • DataHeight: The height parameter is the Box's dimension in the z-direction.

Part_Box-Properties

Scripting

The Box command can by used in macros and from the python console using the following function:

FreeCAD.ActiveDocument.addObject("Part::Box", "myBox")
  • Where "myBox" is the label for the Box object.
  • Returns newly created object of type Box.

You can access and modify attributes of the Box object. For example, you may wish to modify the length, width and height parameters.

FreeCAD.ActiveDocument.myBox.Length = 25
FreeCAD.ActiveDocument.myBox.Width = 15
FreeCAD.ActiveDocument.myBox.Height = 30

You can change its placement with:

FreeCAD.ActiveDocument.myBox.Placement = FreeCAD.Placement(FreeCAD.Vector(4, 6, 3), FreeCAD.Rotation(30, 45, 10))