FreeCAD

Форк
0
/
make_wpproxy.py 
61 строка · 2.7 Кб
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                                 *
5
# *                                                                         *
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.                                 *
11
# *                                                                         *
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.                  *
16
# *                                                                         *
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  *
20
# *   USA                                                                   *
21
# *                                                                         *
22
# ***************************************************************************
23
"""Provides functions to create WorkingPlaneProxy objects."""
24
## @package make_wpproxy
25
# \ingroup draftmake
26
# \brief Provides functions to create WorkingPlaneProxy objects.
27

28
## \addtogroup draftmake
29
# @{
30
import FreeCAD as App
31

32
from draftobjects.wpproxy import WorkingPlaneProxy
33

34
if App.GuiUp:
35
    from draftviewproviders.view_wpproxy import ViewProviderWorkingPlaneProxy
36

37

38
def make_workingplaneproxy(placement):
39
    """make_working_plane_proxy(placement)
40

41
    Creates a Working Plane proxy object in the current document.
42

43
    Parameters
44
    ----------
45
    placement : Base.Placement
46
        specify the p.
47
    """
48
    if App.ActiveDocument:
49
        obj = App.ActiveDocument.addObject("App::FeaturePython","WPProxy")
50
        WorkingPlaneProxy(obj)
51
        if App.GuiUp:
52
            ViewProviderWorkingPlaneProxy(obj.ViewObject)
53
            obj.ViewObject.Proxy.writeCamera()
54
            obj.ViewObject.Proxy.writeState()
55
        obj.Placement = placement
56
        return obj
57

58

59
makeWorkingPlaneProxy = make_workingplaneproxy
60

61
## @}
62

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.