Arch Add: Difference between revisions

From FreeCAD Documentation
mNo edit summary
(Marked this version for translation)
(36 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<languages/>
{{GuiCommand|Name=Arch Add|Workbenches=[[Arch Module|Arch]]|MenuLocation=Arch -> Add|SeeAlso=[[Arch Remove]]}}
<translate>
<!--T:14-->
{{docnav|[[Arch_CutPlane|Cut with plane]]|[[Arch_Remove|Remove component]]|[[Arch_Module|Arch]]|IconL=Arch_CutPlane.svg |IconC=Workbench_Arch.svg |IconR=Arch_Remove.svg}}


<!--T:1-->
==Description==
{{GuiCommand
|Name=Arch Add
|MenuLocation=Arch → Add
|Workbenches=[[Arch Module|Arch]]
|SeeAlso=[[Arch Remove|Arch Remove]]
}}


==Description== <!--T:10-->

<!--T:2-->
The Add tool allows you to do 4 kinds of operations:
The Add tool allows you to do 4 kinds of operations:
* Add [[Part Module|shape]]-based objects to an Arch component, such as a [[Arch Wall|wall]] or [[Arch Structure|structure]]. These objects make then part of the Arch component, and allow you to modify its shape but keeping its base properties such as width and height
* Add [[Part Module|shape]]-based objects to an Arch component, such as a [[Arch Wall|wall]] or [[Arch Structure|structure]]. These objects make then part of the Arch component, and allow you to modify its shape but keeping its base properties such as width and height
Line 9: Line 21:
* Add objects to [[Arch SectionPlane|section planes]]
* Add objects to [[Arch SectionPlane|section planes]]


<!--T:13-->
[[Image:Arch Add example.jpg]]
The counterpart of this tool is the [[Arch Remove]] tool.


</translate>
In the above image, a box is being added to a wall.
[[Image:Arch Add example.jpg|640px]]
<translate>
<!--T:3-->
{{Caption|A box added to a wall as a component.}}


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


<!--T:5-->
# Select the object(s) to be added, then the "host" object (the host object must be the last one you selected)
# Select the objects to be added together. The last object selected will be the host Arch object.
# Press the {{KEY|[[Image:Arch Add.png|16px]] '''Add'''}} button
# Press the {{Button|[[Image:Arch Add.svg|16px]] [[Arch Add|Add]]}} button.


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


<!--T:7-->
The Add tool can by used in [[macros]] and from the python console by using the following function:
The Add tool can be used in [[macros]] and from the [[Python]] console by using the following function:
</translate>
{{Code|code=
addComponents(objectsList, host)
}}
<translate>


<!--T:8-->
'''addComponents (objectsList,hostObject)''': adds the given object or the objects from the given list as components
* Adds the given objects in {{incode|objectsList}} to the given {{incode|host}} object.
to the given host Object. Use this for example to add windows to a wall, or to add walls to a floor.
** {{incode|objectsList}} can be a single object or a list of objects.


<!--T:9-->
Example:
Example:
</translate>
{{Code|code=
import FreeCAD, Arch, Draft, Part

p1 = FreeCAD.Vector(0, 0, 0)
p2 = FreeCAD.Vector(2000, 2000, 0)

Line = Draft.makeWire([p1, p2])
Wall = Arch.makeWall(Line, width=150, height=2000)

p3 = FreeCAD.Vector(0, 2000, 0)
p4 = FreeCAD.Vector(3000, 0, 0)

Line2 = Draft.makeWire([p3, p4])
Wall2 = Arch.makeWall(Line2, width=150, height=2000)
FreeCAD.ActiveDocument.recompute()

Arch.addComponents(Wall2, Wall)
FreeCAD.ActiveDocument.recompute()
}}
<translate>
<!--T:15-->
{{docnav|[[Arch_CutPlane|Cut with plane]]|[[Arch_Remove|Remove component]]|[[Arch_Module|Arch]]|IconL=Arch_CutPlane.svg |IconC=Workbench_Arch.svg |IconR=Arch_Remove.svg}}


<!--T:16-->
import FreeCAD, Arch, Draft, Part
{{Arch Tools navi}}
line = Draft.makeWire([FreeCAD.Vector(0,0,0),FreeCAD.Vector(2,2,0)])
wall = Arch.makeWall(line)
box = Part.makeBox(1,1,1)
Arch.addComponents(box,wall)


<!--T:17-->
{{languages | {{de|Arch_Add/de}} {{es|Arch_Add/es}} {{fr|Arch_Add/fr}} {{it|Arch_Add/it}} {{jp|Arch_Add/jp}} {{se|Arch_Add/se}} }}
{{Userdocnavi}}
</translate>

Revision as of 22:36, 9 February 2019

Arch Add

Menu location
Arch → Add
Workbenches
Arch
Default shortcut
None
Introduced in version
-
See also
Arch Remove

Description

The Add tool allows you to do 4 kinds of operations:

The counterpart of this tool is the Arch Remove tool.

A box added to a wall as a component.

How to use

  1. Select the objects to be added together. The last object selected will be the host Arch object.
  2. Press the Add button.

Scripting

See also: Arch API and FreeCAD Scripting Basics.

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

addComponents(objectsList, host)
  • Adds the given objects in objectsList to the given host object.
    • objectsList can be a single object or a list of objects.

Example:

import FreeCAD, Arch, Draft, Part

p1 = FreeCAD.Vector(0, 0, 0)
p2 = FreeCAD.Vector(2000, 2000, 0)

Line = Draft.makeWire([p1, p2])
Wall = Arch.makeWall(Line, width=150, height=2000)

p3 = FreeCAD.Vector(0, 2000, 0)
p4 = FreeCAD.Vector(3000, 0, 0)

Line2 = Draft.makeWire([p3, p4])
Wall2 = Arch.makeWall(Line2, width=150, height=2000)
FreeCAD.ActiveDocument.recompute()

Arch.addComponents(Wall2, Wall)
FreeCAD.ActiveDocument.recompute()