Cleaning up startEditing/finishEditing/isEditing
This commit is contained in:
@@ -121,7 +121,7 @@ class _CommandArchMaterial:
|
||||
for obj in sel:
|
||||
if hasattr(obj,"Material"):
|
||||
FreeCADGui.doCommand("FreeCAD.ActiveDocument.getObject(\""+obj.Name+"\").Material = mat")
|
||||
FreeCADGui.doCommandGui("mat.ViewObject.startEditing()")
|
||||
FreeCADGui.doCommandGui("mat.ViewObject.Document.setEdit(mat.ViewObject, 0)")
|
||||
FreeCAD.ActiveDocument.commitTransaction()
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
|
||||
@@ -156,7 +156,7 @@ class _CommandArchMultiMaterial:
|
||||
if hasattr(obj,"Material"):
|
||||
if not obj.isDerivedFrom("App::MaterialObject"):
|
||||
FreeCADGui.doCommand("FreeCAD.ActiveDocument."+obj.Name+".Material = mat")
|
||||
FreeCADGui.doCommandGui("mat.ViewObject.startEditing()")
|
||||
FreeCADGui.doCommandGui("mat.ViewObject.Document.setEdit(mat.ViewObject, 0)")
|
||||
FreeCAD.ActiveDocument.commitTransaction()
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
|
||||
|
||||
@@ -383,7 +383,7 @@ class ArchReferenceCommand:
|
||||
FreeCADGui.doCommand("obj = Arch.makeReference()")
|
||||
FreeCADGui.doCommand("Draft.autogroup(obj)")
|
||||
FreeCAD.ActiveDocument.commitTransaction()
|
||||
FreeCADGui.doCommand("obj.ViewObject.startEditing()")
|
||||
FreeCADGui.doCommand("obj.ViewObject.Document.setEdit(obj.ViewObject, 0)")
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
FreeCADGui.addCommand('Arch_Reference', ArchReferenceCommand())
|
||||
|
||||
Reference in New Issue
Block a user