Rebar Addon for FreeCAD
RebarTools.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 # ***************************************************************************
3 # * *
4 # * Copyright (c) 2017 - Amritpal Singh <amrit3701@gmail.com> *
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 
24 __title__ = "RebarCommands"
25 __author__ = "Amritpal Singh"
26 __url__ = "https://www.freecadweb.org"
27 
28 from PySide.QtCore import QT_TRANSLATE_NOOP
29 import FreeCADGui
30 import os
31 
33 
34  def GetResources(self):
35  return {'Pixmap' : os.path.split(os.path.abspath(__file__))[0]+'/icons/dropdown_list/StraightRebar.svg',
36  'MenuText': QT_TRANSLATE_NOOP("RebarAddon", "Straight Rebar"),
37  'ToolTip' : QT_TRANSLATE_NOOP("RebarAddon", "Creates a Striaght bar reinforcement from the selected face of the Structural element.")}
38 
39  def IsActive(self):
40  if FreeCADGui.ActiveDocument:
41  return True
42  else:
43  return False
44 
45  def Activated(self):
46  import StraightRebar
47  # Call to CommandStraightRebar() function
49 
51 
52  def GetResources(self):
53  return {'Pixmap' : os.path.split(os.path.abspath(__file__))[0]+'/icons/dropdown_list/UShapeRebar.svg',
54  'MenuText': QT_TRANSLATE_NOOP("RebarAddon", "U-Shape Rebar"),
55  'ToolTip' : QT_TRANSLATE_NOOP("RebarAddon", "Creates a U-Shape bar reinforcement from the selected face of the Structural element.")}
56 
57  def IsActive(self):
58  if FreeCADGui.ActiveDocument:
59  return True
60  else:
61  return False
62 
63  def Activated(self):
64  import UShapeRebar
65  # Call to CommandUShaepRebar() function
67 
69 
70  def GetResources(self):
71  return {'Pixmap' : os.path.split(os.path.abspath(__file__))[0]+'/icons/dropdown_list/LShapeRebar.svg',
72  'MenuText': QT_TRANSLATE_NOOP("RebarAddon", "L-Shape Rebar"),
73  'ToolTip' : QT_TRANSLATE_NOOP("RebarAddon", "Creates a L-Shape bar reinforcement from the selected face of the Structural element.")}
74 
75  def IsActive(self):
76  if FreeCADGui.ActiveDocument:
77  return True
78  else:
79  return False
80 
81  def Activated(self):
82  import LShapeRebar
83  # Call to CommandUShaepRebar() function
85 
87 
88  def GetResources(self):
89  return {'Pixmap' : os.path.split(os.path.abspath(__file__))[0]+'/icons/dropdown_list/StirrupRebar.svg',
90  'MenuText': QT_TRANSLATE_NOOP("RebarAddon", "Stirrup"),
91  'ToolTip' : QT_TRANSLATE_NOOP("RebarAddon", "Creates a Stirrup bar reinforcement from the selected face of the Structural element.")}
92 
93  def IsActive(self):
94  if FreeCADGui.ActiveDocument:
95  return True
96  else:
97  return False
98 
99  def Activated(self):
100  import Stirrup
101  # Call to CommandStirrup() function
103 
105 
106  def GetResources(self):
107  return {'Pixmap' : os.path.split(os.path.abspath(__file__))[0]+'/icons/dropdown_list/BentShapeRebar.svg',
108  'MenuText': QT_TRANSLATE_NOOP("RebarAddon", "Bent-Shape Rebar"),
109  'ToolTip' : QT_TRANSLATE_NOOP("RebarAddon", "Creates a BentShape bar reinforcement from the selected face of the Structural element.")}
110 
111  def IsActive(self):
112  if FreeCADGui.ActiveDocument:
113  return True
114  else:
115  return False
116 
117  def Activated(self):
118  import BentShapeRebar
119  # Call to CommandBentShaepRebar() function
121 
123 
124  def GetResources(self):
125  return {'Pixmap' : os.path.split(os.path.abspath(__file__))[0]+'/icons/dropdown_list/HelixShapeRebar.svg',
126  'MenuText': QT_TRANSLATE_NOOP("RebarAddon", "Helical Rebar"),
127  'ToolTip' : QT_TRANSLATE_NOOP("RebarAddon", "Creates a Helical bar reinforcement from the selected face of the Structural element.")}
128 
129  def IsActive(self):
130  if FreeCADGui.ActiveDocument:
131  return True
132  else:
133  return False
134 
135  def Activated(self):
136  import HelicalRebar
137  # Call to CommandHelicalRebar() function
139 
140 FreeCADGui.addCommand('Arch_Rebar_Straight', StraightRebarTool())
141 FreeCADGui.addCommand('Arch_Rebar_UShape', UShapeRebarTool())
142 FreeCADGui.addCommand('Arch_Rebar_LShape', LShapeRebarTool())
143 FreeCADGui.addCommand('Arch_Rebar_Stirrup', StirrupTool())
144 FreeCADGui.addCommand('Arch_Rebar_BentShape', BentShapeRebarTool())
145 FreeCADGui.addCommand('Arch_Rebar_Helical', HelicalRebarTool())
146 
147 # List of all rebar commands
148 RebarCommands = ["Arch_Rebar_Straight", "Arch_Rebar_UShape", "Arch_Rebar_LShape", "Arch_Rebar_Stirrup", "Arch_Rebar_BentShape", "Arch_Rebar_Helical"]
def CommandHelicalRebar()
def CommandLShapeRebar()
Definition: LShapeRebar.py:300
def CommandStirrup()
Definition: Stirrup.py:350
def GetResources(self)
Definition: RebarTools.py:88
def CommandUShapeRebar()
Definition: UShapeRebar.py:313
def CommandStraightRebar()
def CommandBentShapeRebar()