當前位置: 首頁>>代碼示例>>Python>>正文


Python FreeCADGui.addCommand方法代碼示例

本文整理匯總了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) 
開發者ID:realthunder,項目名稱:FreeCAD_assembly3,代碼行數:18,代碼來源:gui.py

示例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 
開發者ID:oddtopus,項目名稱:flamingo,代碼行數:19,代碼來源:CommandsEagle.py

示例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 
開發者ID:shaise,項目名稱:FreeCAD_FastenersWB,代碼行數:22,代碼來源:FastenerBase.py

示例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()) 
開發者ID:looooo,項目名稱:freecad.gears,代碼行數:15,代碼來源:init_gui.py

示例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
#--------------------------------------------------------------------------- 
開發者ID:oddtopus,項目名稱:flamingo,代碼行數:16,代碼來源:CommandsPipe.py

示例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]) 
開發者ID:microelly2,項目名稱:Animation,代碼行數:9,代碼來源:InitGui.py

示例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 
開發者ID:microelly2,項目名稱:Animation,代碼行數:12,代碼來源:InitGui.py


注:本文中的FreeCADGui.addCommand方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。