本文整理汇总了Python中PathUtils.addToProject方法的典型用法代码示例。如果您正苦于以下问题:Python PathUtils.addToProject方法的具体用法?Python PathUtils.addToProject怎么用?Python PathUtils.addToProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathUtils
的用法示例。
在下文中一共展示了PathUtils.addToProject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Create
# 需要导入模块: import PathUtils [as 别名]
# 或者: from PathUtils import addToProject [as 别名]
def Create():
# FreeCADGui.addModule("PathScripts.PathLoadTool")
# import Path
import PathScripts
import PathUtils
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", "TC")
PathScripts.PathLoadTool.LoadTool(obj)
PathScripts.PathLoadTool._ViewProviderLoadTool(obj.ViewObject)
PathUtils.addToProject(obj)
示例2: Activated
# 需要导入模块: import PathUtils [as 别名]
# 或者: from PathUtils import addToProject [as 别名]
def Activated(self):
FreeCAD.ActiveDocument.openTransaction(translate("Path_LoadTool", "Create Tool Controller Object"))
snippet = '''
import Path, PathScripts
from PathScripts import PathUtils, PathLoadTool
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython","TC")
PathScripts.PathLoadTool.LoadTool(obj)
PathScripts.PathLoadTool._ViewProviderLoadTool(obj.ViewObject)
PathUtils.addToProject(obj)
'''
FreeCADGui.doCommand(snippet)
FreeCAD.ActiveDocument.commitTransaction()
FreeCAD.ActiveDocument.recompute()
示例3: Activated
# 需要导入模块: import PathUtils [as 别名]
# 或者: from PathUtils import addToProject [as 别名]
def Activated(self):
FreeCAD.ActiveDocument.openTransaction(translate("Current Tool","Tool Number to Load"))
FreeCADGui.addModule("PathScripts.PathLoadTool")
snippet = '''
import Path
import PathScripts
from PathScripts import PathProject, PathUtils
prjexists = False
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython","Tool")
PathScripts.PathLoadTool.LoadTool(obj)
PathScripts.PathLoadTool._ViewProviderLoadTool(obj.ViewObject)
PathUtils.addToProject(obj)
'''
FreeCADGui.doCommand(snippet)
FreeCAD.ActiveDocument.commitTransaction()
FreeCAD.ActiveDocument.recompute()