本文整理匯總了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