Arch Space: Difference between revisions

From FreeCAD Documentation
(Marked this version for translation)
(Limitations inside how to use)
(9 intermediate revisions by the same user not shown)
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
{{GuiCommand
{{GuiCommand|Name=Arch Space|Workbenches=[[Arch Module|Arch]]|MenuLocation=Arch → Space|Shortcut=S P}}
|Name=Arch Space
|MenuLocation=Arch → Space
|Workbenches=[[Arch Module|Arch]]
|Shortcut=S P
|SeeAlso=[[Arch Wall]], [[Arch Structure]]
|Version=0.14
}}


==Description== <!--T:2-->
==Description== <!--T:2-->
Line 10: Line 17:
[[Image:Arch Space example.jpg|640px]]
[[Image:Arch Space example.jpg|640px]]
<translate>
<translate>

<!--T:3-->
<!--T:3-->
''In the above image, a space object is created from an existing solid object, then two wall faces are added as boundaries, and the display mode is set to "detailed" to show the floor area.''
{{Caption|Space object created from an existing solid object, then two wall faces are added as boundaries, and the display mode is set to "detailed" to show the floor area.}}


==How to use== <!--T:5-->
==How to use== <!--T:5-->


<!--T:6-->
<!--T:6-->
# Select an existing solid object, or faces on boundary objects
# Select an existing solid object, or faces on boundary objects.
# Press the {{KEY|[[Image:Arch_Space.png|16px]] [[Arch Space]]}} button, or press {{KEY|S}}, {{KEY|P}} keys
# Press the {{Button|[[Image:Arch_Space.svg|16px]] [[Arch Space]]}} button, or press {{KEY|S}}, {{KEY|P}} keys.

=== Limitations === <!--T:13-->

<!--T:20-->
* The boundaries properties is currently not editable via GUI.
* See the [http://forum.freecadweb.org/viewtopic.php?f=9&t=4275 forum announcement].


==Properties== <!--T:7-->
==Properties== <!--T:7-->
Line 27: Line 39:


==Scripting== <!--T:14-->
==Scripting== <!--T:14-->
{{Emphasis|See also:}} [[Arch API]] and [[FreeCAD Scripting Basics]].


<!--T:15-->
<!--T:15-->
The space tool can be used in python scripts and [[macros]] by using the following function:
The Space tool can be used in [[macros]] and from the [[Python]] console by using the following function:

</translate>
</translate>
{{Code|code=
{{Code|code=
makeSpace(objects)
Space = makeSpace(objects=None, baseobj=None, name="Space")
}}
}}
<translate>
<translate>


<!--T:16-->
<!--T:16-->
* Creates a space object from the given objects.
* Creates a {{incode|Space}} object from the given {{incode|objects}} or {{incode|baseobj}}, which can be
* Objects can be one document object, in which case it becomes the base shape of the space object, or a list of selection objects as returned by FreeCADGui.Selection.getSelectionEx(), or a list of tuples (object, subobjectname).
** one document object, in which case it becomes the base shape of the space object, or
** a list of selection objects as returned by {{incode|FreeCADGui.Selection.getSelectionEx()}}, or
* Returns the newly created space object.
** a list of tuples {{incode|(object, subobjectname)}}


<!--T:17-->
<!--T:17-->
Example:
Example:

</translate>
</translate>
{{Code|code=
{{Code|code=
import FreeCAD, Arch, Part
import FreeCAD, Arch

b = Part.makeBox(2,2,2)
FreeCAD.ActiveDocument.addObject("Part::Feature","Box").Shape=b
Box = FreeCAD.ActiveDocument.addObject("Part::Box", "Box")
Box.Length = 1000
sp = makeSpace([FreeCAD.ActiveDocument.Box])
Box.Width = 1000
Box.Height = 1000

Space = Arch.makeSpace(Box)
Space.ViewObject.LineWidth = 2
FreeCAD.ActiveDocument.recompute()
}}
}}
<translate>
<translate>


<!--T:18-->
<!--T:18-->
After a space object is created, selected faces can be added to it with the following function:
After a space object is created, selected faces can be added to it with the following code:

</translate>
</translate>
{{Code|code=
{{Code|code=
import FreeCADGui
import FreeCAD, FreeCADGui, Draft, Arch

Arch.addSpaceBoundaries(sp, FreeCADGui.Selection.getSelectionEx())
points = [FreeCAD.Vector(-500, 0, 0), FreeCAD.Vector(1000, 1000, 0)]
Line = Draft.makeWire(points)
Wall = Arch.makeWall(Line, width=150, height=2000)
FreeCAD.ActiveDocument.recompute()

# Select a face of the wall
selection = FreeCADGui.Selection.getSelectionEx()
Arch.addSpaceBoundaries(Space, selection)
}}
}}
<translate>
<translate>


<!--T:19-->
<!--T:19-->
Boundaries can also be removed with:
Boundaries can also be removed, again by selecting the indicated faces:

</translate>
</translate>
{{Code|code=
{{Code|code=
Arch.removeSpaceBoundaries(sp, FreeCADGui.Selection.getSelectionEx())
selection = FreeCADGui.Selection.getSelectionEx()
Arch.removeSpaceBoundaries(Space, selection)
}}
}}
<translate>
<translate>


==Limitations== <!--T:13-->

<!--T:20-->
* Not available below FreeCAD version 0.14
* The boundaries properties is currently not editable via GUI
* See the [http://forum.freecadweb.org/viewtopic.php?f=9&t=4275 forum announcement]
</translate>

<translate>
<!--T:21-->
<!--T:21-->
{{Arch Tools navi}}
[[Category:Arch]]
{{Userdocnavi}}
</translate>
</translate>

Revision as of 22:40, 29 November 2018

Arch Space

Menu location
Arch → Space
Workbenches
Arch
Default shortcut
S P
Introduced in version
0.14
See also
Arch Wall, Arch Structure

Description

The Space tool allows you to define an empty volume, either by basing it on a solid shape, or by defining its boundaries, or a mix of both. If it is based solely on boundaries, the volume is calculated by starting from the bounding box of all the given boundaries, and subtracting the spaces behind each boundary. The space object always defines a solid volume. The floor area of a space object, calculated by intersecting a horizontal plane at the center of mass of the space volume, can also be displayed, by setting the display mode of the space object to "detailed".

Space object created from an existing solid object, then two wall faces are added as boundaries, and the display mode is set to "detailed" to show the floor area.

How to use

  1. Select an existing solid object, or faces on boundary objects.
  2. Press the Arch Space button, or press S, P keys.

Limitations

Properties

  • DataBase: The base object, if any (must be a solid)
  • DataBoundaries: A list of optional boundary elements

Scripting

See also: Arch API and FreeCAD Scripting Basics.

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

Space = makeSpace(objects=None, baseobj=None, name="Space")
  • Creates a Space object from the given objects or baseobj, which can be
    • one document object, in which case it becomes the base shape of the space object, or
    • a list of selection objects as returned by FreeCADGui.Selection.getSelectionEx(), or
    • a list of tuples (object, subobjectname)

Example:

import FreeCAD, Arch

Box = FreeCAD.ActiveDocument.addObject("Part::Box", "Box")
Box.Length = 1000
Box.Width = 1000
Box.Height = 1000

Space = Arch.makeSpace(Box)
Space.ViewObject.LineWidth = 2
FreeCAD.ActiveDocument.recompute()

After a space object is created, selected faces can be added to it with the following code:

import FreeCAD, FreeCADGui, Draft, Arch

points = [FreeCAD.Vector(-500, 0, 0), FreeCAD.Vector(1000, 1000, 0)]
Line = Draft.makeWire(points)
Wall = Arch.makeWall(Line, width=150, height=2000)
FreeCAD.ActiveDocument.recompute()

# Select a face of the wall
selection = FreeCADGui.Selection.getSelectionEx()
Arch.addSpaceBoundaries(Space, selection)

Boundaries can also be removed, again by selecting the indicated faces:

selection = FreeCADGui.Selection.getSelectionEx()
Arch.removeSpaceBoundaries(Space, selection)