assembly: no doc touch when auto changing element visibility
This commit is contained in:
parent
a0339c1e5b
commit
a9b302c0ac
|
@ -876,6 +876,7 @@ class AsmConstraint(AsmGroup):
|
|||
obj.setPropertyStatus('VisibilityList','-Immutable')
|
||||
obj.VisibilityList = [False]*len(group)
|
||||
obj.setPropertyStatus('VisibilityList','Immutable')
|
||||
obj.setPropertyStatus('VisibilityList','NoModify')
|
||||
Constraint.attach(obj)
|
||||
obj.recompute()
|
||||
|
||||
|
@ -1147,6 +1148,8 @@ class AsmElementGroup(AsmGroup):
|
|||
for o in obj.Group:
|
||||
getProxy(o,AsmElement).parent = self
|
||||
obj.cacheChildLabel()
|
||||
if gui.AsmCmdManager.AutoElementVis:
|
||||
obj.setPropertyStatus('VisibilityList','NoModify')
|
||||
|
||||
def getAssembly(self):
|
||||
return self.parent
|
||||
|
|
13
gui.py
13
gui.py
|
@ -58,7 +58,8 @@ class SelectionObserver:
|
|||
|
||||
def removeSelection(self,docname,objname,subname):
|
||||
self.onChanged()
|
||||
self.setElementVisible(docname,objname,subname,False)
|
||||
if (docname,objname,subname) in self.elements:
|
||||
self.setElementVisible(docname,objname,subname,False)
|
||||
|
||||
def setSelection(self,*_args):
|
||||
self.onChanged()
|
||||
|
@ -281,12 +282,16 @@ class AsmCmdAutoElementVis(AsmCmdCheckable):
|
|||
@classmethod
|
||||
def Activated(cls,checked):
|
||||
super(AsmCmdAutoElementVis,cls).Activated(checked)
|
||||
from .assembly import isTypeOf,AsmConstraint,AsmElement,AsmElementLink
|
||||
from .assembly import isTypeOf,AsmConstraint,\
|
||||
AsmElement,AsmElementLink,AsmElementGroup
|
||||
visible = not checked
|
||||
for doc in FreeCAD.listDocuments().values():
|
||||
for obj in doc.Objects:
|
||||
if isTypeOf(obj,AsmConstraint):
|
||||
obj.ViewObject.OnTopWhenSelected = 2 if checked else 0
|
||||
if isTypeOf(obj,(AsmConstraint,AsmElementGroup)):
|
||||
if isTypeOf(obj,AsmConstraint):
|
||||
obj.ViewObject.OnTopWhenSelected = 2 if checked else 0
|
||||
obj.setPropertyStatus('VisibilityList',
|
||||
'NoModify' if checked else '-NoModify')
|
||||
elif isTypeOf(obj,(AsmElementLink,AsmElement)):
|
||||
vis = visible and not isTypeOf(obj,AsmElement)
|
||||
obj.Proxy.parent.Object.setElementVisible(obj.Name,vis)
|
||||
|
|
Loading…
Reference in New Issue
Block a user