Arch Remove: Difference between revisions

From FreeCAD Documentation
(Marked this version for translation)
(Image caption; translate tags in correct position)
(6 intermediate revisions by the same user not shown)
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
{{GuiCommand
{{GuiCommand|Name=Arch Remove|Workbenches=[[Arch Module|Arch]]|MenuLocation=Arch → Remove|SeeAlso=[[Arch Add]]}}
|Name=Arch Remove
|MenuLocation=Arch → Remove
|Workbenches=[[Arch Module|Arch]]
|SeeAlso=[[Arch Add]]
}}


==Description== <!--T:2-->
==Description== <!--T:2-->
Line 11: Line 16:
* Subtract a [[Part Module|shape]]-based object from an Arch component such as a [[Arch Wall|wall]] or [[Arch Structure|structure]]
* Subtract a [[Part Module|shape]]-based object from an Arch component such as a [[Arch Wall|wall]] or [[Arch Structure|structure]]


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


</translate>
[[Image:Arch Remove example.jpg|600px]]
<translate>
<!--T:5-->
<!--T:5-->
{{Caption|A box subtracted from a wall, leaving a hole in it.}}
''In the above image, a box is being subtracted from a wall.''


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


<!--T:7-->
<!--T:7-->
# Select a subcomponent inside an Arch object, '''or''':
# Select a subcomponent inside an Arch object.
# Press the {{Button|[[Image:Arch Remove.svg|16px]] [[Arch Remove|Remove]]}} button.
# Select object(s) to be subtracted, then the Arch component from which they must be subtracted (the arch component must be the last thing you selected)

# Press the {{KEY|[[Image:Arch Remove.png|16px]] '''Remove'''}} button
Or
# Select objects to be subtracted, the last object selected must the Arch object from which the other objects will be subtracted.
# Press the {{Button|[[Image:Arch Remove.svg|16px]] [[Arch Remove|Remove]]}} button.


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


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

<!--T:10-->
<!--T:10-->
* Removes the given objects in {{incode|objectsList}} from their parents.
* removes the given component or the components from the given list from their parents. If a host object is specified, this function will try adding the components as holes to the host object instead.
* If a {{incode|host}} object is specified, this function will try adding the objects in {{incode|objectsList}} as holes to the {{incode|host}}.

Example:
Example:
</translate>
</translate>
{{Code|code=
{{Code|code=
import FreeCAD, Arch, Draft, Part
import FreeCAD, Draft, Arch
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)
Arch.removeComponents(box)
}}


Line = Draft.makeWire([FreeCAD.Vector(0, 0, 0),FreeCAD.Vector(2000, 2000, 0)])
Wall = Arch.makeWall(Line, width=150, height=3000)

Box = FreeCAD.ActiveDocument.addObject("Part::Box", "Box")
Box.Length = 900
Box.Width = 450
Box.Height = 2000
FreeCAD.ActiveDocument.recompute()

Draft.rotate(Box, 45)
Draft.move(Box, FreeCAD.Vector(1000, 700, 0))

Arch.removeComponents(Box, Wall)
FreeCAD.ActiveDocument.recompute()
}}
<translate>
<translate>

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

Revision as of 17:37, 2 December 2018

Arch Remove

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

Description

The Remove tools allows you to do 2 kinds of operations:

  • Remove a subcomponent from an Arch object, for example remove a box that has been added to a wall, like in the Arch Add example
  • Subtract a shape-based object from an Arch component such as a wall or structure

The counterpart of this tool is the Arch Add tool.

A box subtracted from a wall, leaving a hole in it.

How to use

  1. Select a subcomponent inside an Arch object.
  2. Press the Remove button.

Or

  1. Select objects to be subtracted, the last object selected must the Arch object from which the other objects will be subtracted.
  2. Press the Remove button.

Scripting

See also: Arch API and FreeCAD Scripting Basics.

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

removeComponents(objectsList, host=None)
  • Removes the given objects in objectsList from their parents.
  • If a host object is specified, this function will try adding the objects in objectsList as holes to the host.

Example:

import FreeCAD, Draft, Arch

Line = Draft.makeWire([FreeCAD.Vector(0, 0, 0),FreeCAD.Vector(2000, 2000, 0)])
Wall = Arch.makeWall(Line, width=150, height=3000)

Box = FreeCAD.ActiveDocument.addObject("Part::Box", "Box")
Box.Length = 900
Box.Width = 450
Box.Height = 2000
FreeCAD.ActiveDocument.recompute()

Draft.rotate(Box, 45)
Draft.move(Box, FreeCAD.Vector(1000, 700, 0))

Arch.removeComponents(Box, Wall)
FreeCAD.ActiveDocument.recompute()