当前位置: 首页>>代码示例>>Python>>正文


Python PathUtil.clearExpressionEngine方法代码示例

本文整理汇总了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
开发者ID:AjinkyaDahale,项目名称:FreeCAD,代码行数:40,代码来源:PathJob.py


注:本文中的PathScripts.PathUtil.clearExpressionEngine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。