1
# ***************************************************************************
2
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
3
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
4
# * Copyright (c) 2020 FreeCAD Developers *
6
# * This program is free software; you can redistribute it and/or modify *
7
# * it under the terms of the GNU Lesser General Public License (LGPL) *
8
# * as published by the Free Software Foundation; either version 2 of *
9
# * the License, or (at your option) any later version. *
10
# * for detail see the LICENCE text file. *
12
# * This program is distributed in the hope that it will be useful, *
13
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
# * GNU Library General Public License for more details. *
17
# * You should have received a copy of the GNU Library General Public *
18
# * License along with this program; if not, write to the Free Software *
19
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
22
# ***************************************************************************
23
"""Provides functions to create Facebinder objects."""
24
## @package make_facebinder
26
# \brief Provides functions to create Facebinder objects.
28
## \addtogroup draftmake
31
import draftutils.gui_utils as gui_utils
33
from draftobjects.facebinder import Facebinder
36
from draftviewproviders.view_facebinder import ViewProviderFacebinder
39
def make_facebinder(selectionset, name="Facebinder"):
40
"""make_facebinder(selectionset, [name])
42
Creates a Facebinder object from a selection set.
47
Only faces will be added.
49
name : string (default = "Facebinder")
50
Name of the created object
52
if not App.ActiveDocument:
53
App.Console.PrintError("No active document. Aborting\n")
55
if not isinstance(selectionset,list):
56
selectionset = [selectionset]
57
fb = App.ActiveDocument.addObject("Part::FeaturePython",name)
60
ViewProviderFacebinder(fb.ViewObject)
61
faces = [] # unused variable?
62
fb.Proxy.addSubobjects(fb, selectionset)
67
makeFacebinder = make_facebinder