本文整理汇总了Python中PathScripts.PathUtil.clearExpressionEngine方法的典型用法代码示例。如果您正苦于以下问题:Python PathUtil.clearExpressionEngine方法的具体用法?Python PathUtil.clearExpressionEngine怎么用?Python PathUtil.clearExpressionEngine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathScripts.PathUtil
的用法示例。
在下文中一共展示了PathUtil.clearExpressionEngine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onDelete
# 需要导入模块: from PathScripts import PathUtil [as 别名]
# 或者: from PathScripts.PathUtil import clearExpressionEngine [as 别名]
def onDelete(self, obj, arg2=None):
'''Called by the view provider, there doesn't seem to be a callback on the obj itself.'''
PathLog.track(obj.Label, arg2)
doc = obj.Document
# the first to tear down are the ops, they depend on other resources
PathLog.debug('taking down ops: %s' % [o.Name for o in self.allOperations()])
while obj.Operations.Group:
op = obj.Operations.Group[0]
if not op.ViewObject or not hasattr(op.ViewObject.Proxy, 'onDelete') or op.ViewObject.Proxy.onDelete(op.ViewObject, ()):
PathUtil.clearExpressionEngine(op)
doc.removeObject(op.Name)
obj.Operations.Group = []
doc.removeObject(obj.Operations.Name)
obj.Operations = None
# stock could depend on Base
if obj.Stock:
PathLog.debug('taking down stock')
PathUtil.clearExpressionEngine(obj.Stock)
doc.removeObject(obj.Stock.Name)
obj.Stock = None
# base doesn't depend on anything inside job
if obj.Base:
PathLog.debug('taking down base')
if isResourceClone(obj, 'Base'):
PathUtil.clearExpressionEngine(obj.Base)
doc.removeObject(obj.Base.Name)
obj.Base = None
# Tool controllers don't depend on anything
PathLog.debug('taking down tool controller')
for tc in obj.ToolController:
PathUtil.clearExpressionEngine(tc)
doc.removeObject(tc.Name)
obj.ToolController = []
# SetupSheet
PathUtil.clearExpressionEngine(obj.SetupSheet)
doc.removeObject(obj.SetupSheet.Name)
obj.SetupSheet = None
return True