PCBcollision.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号