Arch Add: Difference between revisions

From FreeCAD Documentation
mNo edit summary
mNo edit summary
Line 29: Line 29:
The Add tool can by used in [[macros]] and from the python console by using the following function:
The Add tool can by used in [[macros]] and from the python console by using the following function:
</translate>
</translate>
{{Code|code=python
<syntaxhighlight>
addComponents (objectsList,hostObject)
addComponents (objectsList,hostObject)
}}
</syntaxhighlight>
<translate>
<translate>
<!--T:8-->
<!--T:8-->
Line 40: Line 40:
Example:
Example:
</translate>
</translate>
{{Code|code=python
<syntaxhighlight>
import FreeCAD, Arch, Draft, Part
import FreeCAD, Arch, Draft, Part
line = Draft.makeWire([FreeCAD.Vector(0,0,0),FreeCAD.Vector(2,2,0)])
line = Draft.makeWire([FreeCAD.Vector(0,0,0),FreeCAD.Vector(2,2,0)])
Line 46: Line 46:
box = Part.makeBox(1,1,1)
box = Part.makeBox(1,1,1)
Arch.addComponents(box,wall)
Arch.addComponents(box,wall)
}}
</syntaxhighlight>


<languages/>
<languages/>

Revision as of 07:54, 15 May 2016

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:

In the above image, a box is being added to a wall.

How to use

  1. Select the object(s) to be added, then the "host" object (the host object must be the last one you selected)
  2. Press the Add button

Scripting

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

python
addComponents (objectsList,hostObject)
  • Adds the given object or the objects from the given list as components to the given host Object. Use this for example to add windows to a wall, or to add walls to a floor.
  • Returns nothing.

Example:

python
import FreeCAD, Arch, Draft, Part
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)