本文整理汇总了Python中FreeCADGui.addCommand方法的典型用法代码示例。如果您正苦于以下问题:Python FreeCADGui.addCommand方法的具体用法?Python FreeCADGui.addCommand怎么用?Python FreeCADGui.addCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FreeCADGui
的用法示例。
在下文中一共展示了FreeCADGui.addCommand方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: register
# 需要导入模块: import FreeCADGui [as 别名]
# 或者: from FreeCADGui import addCommand [as 别名]
def register(mcs,cls):
if cls._id < 0:
return
super(AsmCmdManager,mcs).register(cls)
FreeCADGui.addCommand(cls.getName(),cls)
if cls._toolbarName:
tb = mcs.Toolbars.setdefault(cls._toolbarName,[])
if not tb and not getattr(cls,'_toolbarVisible',True):
mcs._HiddenToolbars.add(cls._toolbarName)
tb.append(cls)
if cls._menuGroupName is not None:
name = cls._menuGroupName
if not name:
name = mcs._defaultMenuGroupName
mcs.Menus.setdefault(name,[]).append(cls)
示例2: addCommand
# 需要导入模块: import FreeCADGui [as 别名]
# 或者: from FreeCADGui import addCommand [as 别名]
def addCommand(name,cmdObject):
(list,num) = inspect.getsourcelines(cmdObject.Activated)
pos = 0
# check for indentation
while(list[1][pos] == ' ' or list[1][pos] == '\t'):
pos += 1
source = ""
for i in range(len(list)-1):
source += list[i+1][pos:]
FreeCADGui.addCommand(name,cmdObject,source)
#---------------------------------------------------------------------------
# The command classes
#---------------------------------------------------------------------------
# Eagle import tool
# Riccardo Treu - LGPL 2016
示例3: getCommands
# 需要导入模块: import FreeCADGui [as 别名]
# 或者: from FreeCADGui import addCommand [as 别名]
def getCommands(self, group):
cmdlist = []
cmdsubs = {}
for cmd in self.commands[group]:
command, subgroup = cmd
if subgroup != None and GroupButtonMode > 0:
if not(subgroup in cmdsubs):
cmdsubs[subgroup] = []
if GroupButtonMode == 2:
cmdlist.append(subgroup.replace(" ", ""))
cmdlist.append("Separator")
cmdsubs[subgroup].append(command)
else:
cmdlist.append(command)
for subcommand in cmdsubs:
if GroupButtonMode == 2:
Gui.addCommand(subcommand.replace(" ", ""), FSGroupCommand(cmdsubs[subcommand], subcommand, subcommand))
else:
cmdlist.append((subcommand.replace(" ", ""), cmdsubs[subcommand], subcommand))
return cmdlist
示例4: Initialize
# 需要导入模块: import FreeCADGui [as 别名]
# 或者: from FreeCADGui import addCommand [as 别名]
def Initialize(self):
from .commands import CreateCycloideGear, CreateInvoluteGear
from .commands import CreateBevelGear, CreateInvoluteRack, CreateCrownGear
from .commands import CreateWormGear
self.appendToolbar("Gear", self.commands)
self.appendMenu("Gear", self.commands)
# Gui.addIconPath(App.getHomePath()+"Mod/gear/icons/")
Gui.addCommand('CreateInvoluteGear', CreateInvoluteGear())
Gui.addCommand('CreateCycloideGear', CreateCycloideGear())
Gui.addCommand('CreateBevelGear', CreateBevelGear())
Gui.addCommand('CreateInvoluteRack', CreateInvoluteRack())
Gui.addCommand('CreateCrownGear', CreateCrownGear())
Gui.addCommand('CreateWormGear', CreateWormGear())
示例5: addCommand
# 需要导入模块: import FreeCADGui [as 别名]
# 或者: from FreeCADGui import addCommand [as 别名]
def addCommand(name,cmdObject):
(list,num) = inspect.getsourcelines(cmdObject.Activated)
pos = 0
# check for indentation
while(list[1][pos] == ' ' or list[1][pos] == '\t'):
pos += 1
source = ""
for i in range(len(list)-1):
source += list[i+1][pos:]
FreeCADGui.addCommand(name,cmdObject,source)
#---------------------------------------------------------------------------
# The command classes
#---------------------------------------------------------------------------
示例6: c1a
# 需要导入模块: import FreeCADGui [as 别名]
# 或者: from FreeCADGui import addCommand [as 别名]
def c1a(menu,isactive,name,*info):
global _Command
name1="Animation_"+name
t=_Command(name,*info)
t.IsActive=isactive
FreeCADGui.addCommand(name1,t)
FreeCAD.tcmds6.append([menu,name1,name,isactive,info])
示例7: c2a
# 需要导入模块: import FreeCADGui [as 别名]
# 或者: from FreeCADGui import addCommand [as 别名]
def c2a(menu,isactive,title,name,*info):
global _Command
t=_Command(name,*info)
title1="Animation_"+title
t.IsActive=isactive
FreeCADGui.addCommand(title1,t)
FreeCAD.tcmds6.append([menu,title1,name,isactive,info])
# special conditions for actions