Draft: Autogroup, rename variables to more readable names
This commit is contained in:
@@ -128,13 +128,14 @@ def autogroup(obj):
|
||||
|
||||
if Gui.ActiveDocument.ActiveView.getActiveObject("Arch"):
|
||||
# add object to active Arch Container
|
||||
Gui.ActiveDocument.ActiveView.getActiveObject("Arch").addObject(obj)
|
||||
active_arch_obj = Gui.ActiveDocument.ActiveView.getActiveObject("Arch")
|
||||
active_arch_obj.addObject(obj)
|
||||
|
||||
elif Gui.ActiveDocument.ActiveView.getActiveObject("part", False) is not None:
|
||||
# add object to active part and change it's placement accordingly
|
||||
# so object does not jump to different position, works with App::Link
|
||||
# if not scaled. Modified accordingly to realthunder suggestions
|
||||
p, parent, sub = Gui.ActiveDocument.ActiveView.getActiveObject("part", False)
|
||||
active_part, parent, sub = Gui.ActiveDocument.ActiveView.getActiveObject("part", False)
|
||||
matrix = parent.getSubObject(sub, retType=4)
|
||||
if matrix.hasScale() == 1:
|
||||
err = translate("Draft",
|
||||
@@ -161,7 +162,8 @@ def autogroup(obj):
|
||||
elif hasattr(obj,"Placement"):
|
||||
# every object that have a placement is processed here
|
||||
obj.Placement = App.Placement(inverse_placement.multiply(obj.Placement))
|
||||
p.addObject(obj)
|
||||
|
||||
active_part.addObject(obj)
|
||||
|
||||
|
||||
def dim_symbol(symbol=None, invert=False):
|
||||
|
||||
Reference in New Issue
Block a user