Draft/Arch: minor fixes

This commit is contained in:
Yorik van Havre
2018-12-01 18:56:05 -02:00
parent c075247036
commit 0e554bd36e
2 changed files with 12 additions and 2 deletions

View File

@@ -691,7 +691,10 @@ class _Structure(ArchComponent.Component):
if base and placement:
if obj.Normal.Length:
normal = Vector(obj.Normal)
normal = placement.inverse().Rotation.multVec(normal)
if isinstance(placement,list):
normal = placement[0].inverse().Rotation.multVec(normal)
else:
normal = placement.inverse().Rotation.multVec(normal)
if not normal:
normal = Vector(0,0,1)
if not normal.Length:

View File

@@ -1438,12 +1438,17 @@ def move(objectslist,vector,copy=False):
elif getType(obj) == "DraftText":
if copy:
newobj = FreeCAD.ActiveDocument.addObject("App::FeaturePython",getRealName(obj.Name))
DraftText(newobj)
if gui:
ViewProviderDraftText(newobj.ViewObject)
formatObject(newobj,obj)
newobj.Text = obj.Text
newobj.Placement = obj.Placement
if gui:
formatObject(newobj,obj)
else:
newobj = obj
newobj.Position = obj.Position.add(vector)
newobj.Placement.Base = obj.Placement.Base.add(vector)
elif getType(obj) == "Dimension":
if copy:
newobj = FreeCAD.ActiveDocument.addObject("App::FeaturePython",getRealName(obj.Name))
@@ -3240,6 +3245,8 @@ def clone(obj,delta=None,forcedraft=False):
base = getCloneBase(obj[0])
cl.Label = prefix + base.Label
cl.CloneOf = base
if hasattr(cl,"Material") and hasattr(obj[0],"Material"):
cl.Material = obj[0].Material
if getType(obj[0]) != "BuildingPart":
cl.Placement = obj[0].Placement
try: