Skip to content
Permalink
Browse files

Added RebarTools.py file

  • Loading branch information...
amrit3701 committed Jun 21, 2017
1 parent 4db8144 commit 30d7b60182c1fda8f6310aeee0da1c3a94ba4e69
Showing with 45 additions and 0 deletions.
  1. +45 −0 RebarTools.py
@@ -0,0 +1,45 @@
from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCADGui, FreeCAD
import os

class StraightRebarTool:

def GetResources(self):
return {'Pixmap' : os.path.split(os.path.abspath(__file__))[0]+'/icons/StraightRebar.svg',
'MenuText': QT_TRANSLATE_NOOP("Arch_Rebar_Straight", "Straight Rebar"),
'ToolTip' : QT_TRANSLATE_NOOP("Arch_Rebar_Straight", "Creates a Striaght bar reinforcement from the selected face of the Structural element.")}

def IsActive(self):
if FreeCADGui.ActiveDocument:
return True
else:
return False

def Activated(self):
import StraightRebar
# Call to CommandStraightRebar() function
StraightRebar.CommandStraightRebar()

class UShapeRebarTool:

def GetResources(self):
return {'Pixmap' : os.path.split(os.path.abspath(__file__))[0]+'/icons/UShapeRebar.svg',
'MenuText': QT_TRANSLATE_NOOP("Arch_Rebar_UShape", "U-Shape Rebar"),
'ToolTip' : QT_TRANSLATE_NOOP("Arch_Rebar_UShape", "Creates a U-Shape bar reinforcement from the selected face of the Structural element.")}

def IsActive(self):
if FreeCADGui.ActiveDocument:
return True
else:
return False

def Activated(self):
import UShapeRebar
# Call to CommandUShaepRebar() function
UShapeRebar.CommandUShapeRebar()

FreeCADGui.addCommand('Arch_Rebar_Straight', StraightRebarTool())
FreeCADGui.addCommand('Arch_Rebar_UShape', UShapeRebarTool())

# List of all rebar commands
RebarCommands = ["Arch_Rebar_Straight", "Arch_Rebar_UShape"]

0 comments on commit 30d7b60

Please sign in to comment.
You can’t perform that action at this time.