本文整理汇总了Python中PathUtils.getTool方法的典型用法代码示例。如果您正苦于以下问题:Python PathUtils.getTool方法的具体用法?Python PathUtils.getTool怎么用?Python PathUtils.getTool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathUtils
的用法示例。
在下文中一共展示了PathUtils.getTool方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: import PathUtils [as 别名]
# 或者: from PathUtils import getTool [as 别名]
def execute(self, obj):
tool = PathUtils.getTool(obj, obj.ToolNumber)
if tool is not None:
obj.Label = obj.Name + ": " + tool.Name
else:
obj.Label = obj.Name + ": UNDEFINED TOOL"
commands = ""
commands += "(" + obj.Label + ")"+'\n'
commands += 'M6T'+str(obj.ToolNumber)+'\n'
if obj.SpindleDir == 'Forward':
commands += 'M3S' + str(obj.SpindleSpeed) + '\n'
else:
commands += 'M4S' + str(obj.SpindleSpeed) + '\n'
示例2: execute
# 需要导入模块: import PathUtils [as 别名]
# 或者: from PathUtils import getTool [as 别名]
def execute(self, obj):
# if obj.ToolNumber != 0:
tool = PathUtils.getTool(obj, obj.ToolNumber)
if tool is not None:
obj.Label = obj.Name + ": (" + tool.Name + ")"
else:
obj.Label = obj.Name + ": (UNDEFINED TOOL)"
commands = ""
commands = 'M6T'+str(obj.ToolNumber)+'\n'
if obj.SpindleDir == 'Forward':
commands += 'M3S' + str(obj.SpindleSpeed) + '\n'
else:
commands += 'M4S' + str(obj.SpindleSpeed) + '\n'
obj.Path = Path.Path(commands)