forked from cadracks/cadracks-freecad-workbench
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand_assembly_add.py
More file actions
62 lines (46 loc) · 1.77 KB
/
Copy pathcommand_assembly_add.py
File metadata and controls
62 lines (46 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# coding: utf-8
# Copyright 2018-2019 Guillaume Florent
# This file is part of cadracks-freecad-workbench.
#
# cadracks-freecad-workbench is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# cadracks-freecad-workbench is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cadracks-freecad-workbench. If not, see <https://www.gnu.org/licenses/>.
r"""Assembly Add Command"""
from os.path import join, dirname
import FreeCAD as App
from freecad_logging import info
class CommandAssemblyAdd:
r"""AssemblyAddCommand
Command to add an assembly to a Part
"""
def __init__(self):
pass
def Activated(self):
r""""""
info("This command will, in the future, add an assembly to a Document")
def GetResources(self):
icon = join(dirname(__file__),
"resources",
"freecad_workbench_anchors_add_assembly.svg")
return {"MenuText": "Add assembly",
"Accel": "Alt+A",
"ToolTip": "Add an assembly to the document",
"Pixmap": icon}
def IsActive(self):
r"""Determines if the command is active or inactive (greyed out)
This method is called periodically, avoid calling other methods
that print to the console
"""
if App.ActiveDocument is None:
return False
else:
return True