几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » SolidWorks二次开发
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2008-08-27, 10:05 AM   #1
huangyhg
超级版主
 
huangyhg的头像
 
注册日期: 04-03
帖子: 18592
精华: 36
现金: 249466 标准币
资产: 1080358888 标准币
huangyhg 向着好的方向发展
默认 How to determine the current language in SolidWorks is running

//GetLocalizedMenuName.bas

'--------------------------------------------
' How to determine the current language in SolidWorks is running
'
' Problem:
' SolidWorks is now localised for many different languages.
' This means the menu names are presented in the local language.
' For addins which add to the SW menus, they need to know the
' names of various menus in their call to:
'
' SldWorks/Frame::AddMenuItem
'
' This sample code shows how to determine the current language
' and retrieve the local menu names for several of the standard
' SolidWorks menus.
'
' Preconditions:
' none
'
' Postconditions:
' none
Option Explicit
Public Enum swMenuIdentifiers_e
swFileMenu = 0
swEditMenu = 1
swViewMenu = 2
swInsertMenu = 3
swToolsMenu = 4
swWindowMenu = 5
swHelpMenu = 6
swDeveloperToolsMenu = 7
swViewToolbarsMenu = 8
End Enum
Sub main()
Dim swApp As SldWorks.SldWorks

Set swApp = CreateObject("SldWorks.Application")

Debug.Print "Language = " + swApp.GetCurrentLanguage
Debug.Print " FileMenu = " + swApp.GetLocalizedMenuName(swFileMenu)
Debug.Print " EditMenu = " + swApp.GetLocalizedMenuName(swEditMenu)
Debug.Print " ViewMenu = " + swApp.GetLocalizedMenuName(swViewMenu)
Debug.Print " InsertMenu = " + swApp.GetLocalizedMenuName(swInsertMenu)
Debug.Print " ToolsMenu = " + swApp.GetLocalizedMenuName(swToolsMenu)
Debug.Print " WindowMenu = " + swApp.GetLocalizedMenuName(swWindowMenu)
Debug.Print " HelpMenu = " + swApp.GetLocalizedMenuName(swHelpMenu)
Debug.Print " DeveloperToolsMenu = " + swApp.GetLocalizedMenuName(swDeveloperToolsMenu)
Debug.Print " ViewToolbarsMenu = " + swApp.GetLocalizedMenuName(swViewToolbarsMenu)
End Sub

' English OS + English SW 2001 SP13
'Language = english
'FileMenu = &File
'EditMenu = &Edit
'ViewMenu = &View
'InsertMenu = &Insert
'ToolsMenu = &Tools
'WindowMenu = &Window
'HelpMenu = &Help
'DeveloperToolsMenu = &DeveloperTools
'ViewToolbarsMenu = &Toolbars

' Spanish OS + Spanish SW 2001 SP11
' SPR 119300 - "SldWorks::GetLocalizedMenuName returns incorrect strings on Spanish OS"
'Language = spanish
'FileMenu = &File <---- BUG
'EditMenu = &Edit <---- BUG
'ViewMenu = &View <---- BUG
'InsertMenu = &Insert <---- BUG
'ToolsMenu = &Tools <---- BUG
'WindowMenu = &Window <---- BUG
'HelpMenu = &Help <---- BUG
'DeveloperToolsMenu = &DeveloperTools <---- BUG
'ViewToolbarsMenu = Barras de &herramientas

' French OS + French SW 2001 SP11
'Language = french
'FileMenu = &Fichier
'EditMenu = &Edition
'ViewMenu = Affic&hage
'InsertMenu = &Insertion
'ToolsMenu = &Outils
'WindowMenu = Fe&nêtre
'HelpMenu = &?
'DeveloperToolsMenu = &DeveloperTools <---- BUG
'ViewToolbarsMenu = &Barre d'outils

' German OS + German SW 2001 SP11
'Language = german
'FileMenu = &Datei
'EditMenu = &Bearbeiten
'ViewMenu = &Ansicht
'InsertMenu = &Einfügen
'ToolsMenu = E&xtras
'WindowMenu = &Fenster
'HelpMenu = &Hilfe
'DeveloperToolsMenu = En&twickler
'ViewToolbarsMenu = S&ymbolleisten

' Italian OS + Italian SW 2001 SP11
'Language = italian
'FileMenu = &File
'EditMenu = &Modifica
'ViewMenu = &Visualizza
'InsertMenu = &Inserisci
'ToolsMenu = &Strumenti
'WindowMenu = Fi&nestra
'HelpMenu = &?
'DeveloperToolsMenu = &DeveloperTools <---- BUG
'ViewToolbarsMenu = &Barre degli strumenti

' Japanese OS + Japanese SW 2001 SP11
'Language = japanese
'FileMenu = &Igrave;§&sup2;&Ugrave;(&F)
'EditMenu = •&Ograve;W(&E)
'ViewMenu = •\Ž&brvbar;(&V)
'InsertMenu = ‘}“ü(&I)
'ToolsMenu = &Acirc;°&Ugrave;(&T)
'WindowMenu = &sup3;¨&Yacute;&Auml;&THORN;&sup3;(&W)
'HelpMenu = &Iacute;&Ugrave;&Igrave;&szlig;(&H)
'DeveloperToolsMenu = ŠJ”&shy;&Acirc;°&Ugrave;(&D)
'ViewToolbarsMenu = &Acirc;°&Ugrave;&Ecirc;&THORN;°(&T)
'--------------------------------------------
huangyhg离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
How to determine the current language in SolidWorks is running huangyhg SolidWorks二次开发 0 2007-01-23 10:52 PM
How to determine numerical values for the SolidWorks version huangyhg SolidWorks二次开发 0 2007-01-23 10:50 PM


所有的时间均为北京时间。 现在的时间是 03:59 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多