Added RebarShape property to the Rebar object and defined setEdit() function in Rebar object
This commit is contained in:
committed by
Yorik van Havre
parent
c1070e5e8e
commit
fb62c91366
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user