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."""