Arch Remove/zh-cn: Difference between revisions

From FreeCAD Documentation
(Created page with "或者 # 先选择待移除的(若干)对象,最后选择主建筑对象(也就是要从中去掉前面所选的对象)。 # 按{{Button|Image:Arch Remove.svg|16p...")
(Created page with "==脚本== {{Emphasis|参阅:}} Arch APIFreeCAD Scripting Basics。")
Line 29: Line 29:
# 按{{Button|[[Image:Arch Remove.svg|16px]] [[Arch Remove|Remove]]}}按钮。
# 按{{Button|[[Image:Arch Remove.svg|16px]] [[Arch Remove|Remove]]}}按钮。


==Scripting==
==脚本==
{{Emphasis|See also:}} [[Arch API]] and [[FreeCAD Scripting Basics]].
{{Emphasis|参阅:}} [[Arch API]] [[FreeCAD Scripting Basics]]


The Remove tool can be 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:

Revision as of 10:19, 17 June 2019

Arch Remove

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

描述

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

建筑添加工具与本工具功能相反。

从墙体中去掉一个立方体,于是便留下了一个洞。

如何使用

  1. 选中建筑对象中的某个子构件。
  2. Remove按钮。

或者

  1. 先选择待移除的(若干)对象,最后选择主建筑对象(也就是要从中去掉前面所选的对象)。
  2. Remove按钮。

脚本

参阅: Arch APIFreeCAD 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.

示例:

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()