Skip to content

Commit

Permalink
Arch: Fixed wrong structures drawn in beam mode using a metal profile
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed May 11, 2019
1 parent ab6e30b commit 60fae52
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/Mod/Arch/ArchStructure.py
Expand Up @@ -264,7 +264,10 @@ def getPoint(self,point=None,obj=None):
else:
FreeCADGui.doCommand('s.Placement.Base = '+DraftVecUtils.toString(point))
if self.bmode and self.bpoint:
rot = FreeCAD.Rotation(Vector(1,0,0),(point.sub(self.bpoint)).normalize())
if (self.Profile != None) and (not "Precast" in self.Profile):
rot = FreeCAD.Rotation(Vector(0,0,1),(point.sub(self.bpoint)).normalize())
else:
rot = FreeCAD.Rotation(Vector(1,0,0),(point.sub(self.bpoint)).normalize())
FreeCADGui.doCommand('s.Placement.Rotation=FreeCAD.Rotation'+str(rot.Q))
else:
FreeCADGui.doCommand('s.Placement.Rotation=s.Placement.Rotation.multiply(FreeCAD.DraftWorkingPlane.getRotation().Rotation)')
Expand Down Expand Up @@ -406,13 +409,19 @@ def setHeight(self,d):

self.Height = d
self.tracker.height(d)
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("StructureHeight",d)
if self.modeb.isChecked():
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("StructureLength",d)
else:
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("StructureHeight",d)

def setLength(self,d):

self.Length = d
self.tracker.length(d)
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("StructureLength",d)
if self.modeb.isChecked():
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("StructureHeight",d)
else:
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").SetFloat("StructureLength",d)

def setContinue(self,i):

Expand Down

0 comments on commit 60fae52

Please sign in to comment.