当前位置: 首页>>代码示例>>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;未经允许,请勿转载。