File size: 2,015 Bytes
985c397
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# SPDX-License-Identifier: LGPL-2.1-or-later

# Tux module for FreeCAD
# Copyright (C) 2017  triplus @ FreeCAD
#
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA

"""Tux module for FreeCAD."""

p = FreeCAD.ParamGet("User parameter:Tux")


# Navigation indicator
if p.GetGroup("NavigationIndicator").GetBool("Enabled", 1):
    import NavigationIndicatorGui
else:
    pass


# Persistent toolbars
if p.GetGroup("PersistentToolbars").GetBool("Enabled", 1):
    import PersistentToolbarsGui
else:
    pass

# Temporary - for FreeCAD v1.0
# Detect a possible clash between the built-in BIM WB in v1.0
# and the BIM addon. Resolve this by renaming the BIM add-on path
try:
    import Arch_rc

    # we could import Arch_rc, nothing to be done, either we are
    # running built-in BIM without the addon, or the addon without built-in BIM
except:
    # Arch_rc not importable: We have both the BIM addon and the built-in BIM
    from pathlib import Path
    import FreeCAD

    bim_modpath = Path(FreeCAD.getUserAppDataDir(), "Mod", "BIM")
    try:
        bim_modpath.rename(bim_modpath.with_name("BIM021"))
    except FileNotFoundError:
        pass
    else:
        FreeCAD.Console.PrintWarning(
            "BIM addon path has been renamed to BIM021 to avoid conflicts with the builtin BIM workbench. Please restart FreeCAD\n"
        )