def readObjects(self):
for i in FreeCAD.ActiveDocument.Objects:
if hasattr(i.ViewObject, "Transparency"):
self.transaprency[i] = i.ViewObject.Transparency
i.ViewObject.Transparency = 80
if (hasattr(i, "Shape") and i.Shape.Solids != [] and (i.InList == [] or i.InList[0].TypeId == 'App::DocumentObjectGroup')) or hasattr(i, "Proxy") and hasattr(i.Proxy, "Type") and i.Proxy.Type in ["assemblyMain"]:
a = QtGui.QListWidgetItem(i.Label)
a.setData(QtCore.Qt.UserRole, i.Name)
a.setFlags(QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsUserCheckable)
try:
a.setIcon(i.ViewObject.Icon)
except AttributeError:
pass
a.setCheckState(QtCore.Qt.Unchecked)
self.table1.addItem(a)
###########
a = QtGui.QListWidgetItem(i.Label)
a.setData(QtCore.Qt.UserRole, i.Name)
a.setFlags(QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsUserCheckable)
try:
a.setIcon(i.ViewObject.Icon)
except AttributeError:
pass
a.setCheckState(QtCore.Qt.Unchecked)
self.table2.addItem(a)
评论列表
文章目录