From fb62c9136642487fc7248ad50df317dfaffbafb6 Mon Sep 17 00:00:00 2001 From: Amritpal Singh Date: Sat, 10 Jun 2017 23:35:56 +0530 Subject: [PATCH] Added RebarShape property to the Rebar object and defined setEdit() function in Rebar object --- src/Mod/Arch/ArchRebar.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Mod/Arch/ArchRebar.py b/src/Mod/Arch/ArchRebar.py index c641bcdda7..e27a04c8da 100644 --- a/src/Mod/Arch/ArchRebar.py +++ b/src/Mod/Arch/ArchRebar.py @@ -330,12 +330,25 @@ class _ViewProviderRebar(ArchComponent.ViewProviderComponent): def __init__(self,vobj): ArchComponent.ViewProviderComponent.__init__(self,vobj) + vobj.addProperty("App::PropertyString","RebarShape","Arch",QT_TRANSLATE_NOOP("App::Property","Shape of rebar")).RebarShape vobj.ShapeColor = ArchCommands.getDefaultColor("Rebar") + vobj.setEditorMode("RebarShape",2) def getIcon(self): import Arch_rc return ":/icons/Arch_Rebar_Tree.svg" + def setEdit(self, vobj, mode): + if mode == 0: + if vobj.RebarShape: + try: + # Import module of RebarShape + module = __import__(vobj.RebarShape) + except ImportError: + FreeCAD.Console.PrintError("Unable to import RebarShape module\n") + return + module.editDialog(vobj) + def CalculatePlacement(baramount, barnumber, size, axis, rotation, offsetstart, offsetend): """ CalculatePlacement([baramount, barnumber, size, axis, rotation, offsetstart, offsetend]): Calculate the placement of the bar from given values."""