找回密码
 注册
Simdroid-非首页
查看: 259|回复: 8

【寻找】请问:如何将下列菜单上命令加入到 Toolbar?

[复制链接]
坏蛋 该用户已被删除
发表于 2003-5-7 09:03:35 | 显示全部楼层 |阅读模式 来自 广东广州
提示: 作者被禁止或删除 内容自动屏蔽
freedomlwj 该用户已被删除
发表于 2003-5-7 10:56:04 | 显示全部楼层 来自 甘肃兰州
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2003-5-8 20:59:28 | 显示全部楼层 来自 广东深圳

回复: 【寻找】请问:如何将下列菜单上命令加入到 Toolbar?

toolbar adding. (someone have showed the article and thanks to author)
  
ANSYS在图形界面方面的最大特点是用户可以根据自己的目的定制自己的图形界面。尽管ANSYS提供了专门的菜单开发工具UIDL语言,但毕竟只有少数熟练的用户能很好地使用。但有一种方法特别适合初学者使用,那就是通过ANSYS提供的Toolbar,把ANSYS常用的命令和宏定制成按钮,这样需要反复地点取菜单来执行的常用命令,通过点击一次Toolbar按钮就可以完成了。
   定制按钮的方法有两种:菜单方式与命令方式。菜单方式就是直接点菜单Utility Menu>Macro>Edit Abbreviations …或Utility Menu>Macro>Edit Toolbar …;而命令方式就是直接执行命令*ABBR(Abbreviation的缩写)。ANSYS的db文件自动保存你所增加的按钮,但是每次重新开始新的分析,都需要重新定义每个按钮。如果想要在每次启动ANSYS或开始新的分析时都能自动加载这些快捷按钮,通常是把这些按钮对应的*ABBR命令放在ANSYS的启动文件star56.ans(对ANSYS5.6)中,ANSYS在每次启动时会自动加载这些命令。ANSYS的启动文件star56.ans在ANSYS安装目录下的DOCU目录中,如c:\ansys56\docu\star56.ans,它是一个文本文件,可以用通用的文本编辑器打开和编辑它。其实该文件提供了一个内容很丰富的模板,它收集了许多ANSYS常用命令的缩略,只不过都把它们注释掉了,你只需去掉前面的注释符(!),就可以在进入ANSYS后在Toolbar中看到它们。你也可以把所有的*ABBR命令放在一个单独的文件中,然后在启动文件中加入一条命令ABBRES,用ABBRES命令的好处是你在任何时候都可以加载这些快捷按钮,这对于你如果使用由别人建的模型,而他用的是不同的Toolbar,这是因为Toolbar是保存在模型文件中(jobname.db),你可以发现采用这样的方法给你带来很大的方便。
   我承认我是一个Toolbar迷,把许多命令和宏放在Toolbar中使我的工作更快和更有效率。在我的Toolbar中,大多数按钮是直接执行ANSYS命令和宏,其中也有一些按钮是用来调入新的Toolbar实现一些新的功能。通过将一个Toolbar嵌入到另一个Toolbar中,可以将Toolbar分成前处理和后处理等大类,也可以列出一些特别的信息有助于工作。不过我个人的倾向不赞成用太多的嵌套Toolbar,因为点三到四层按钮与点三到四级菜单差不多。宁可在一个Toolbar中有许多按钮,也不要有许多嵌套Toolbar。  
  包含43个按钮的toolbar  
  减少了11个按钮的toolbar  
   尽管最好能把所有需要的按钮一次全部调进来,但有时发现这也不是好事。有一天我数了一下Toolbar中的按钮,竟然发现有43个按钮,尽管这不是一个世界记录,但这确实太多了,此时我才意识到我这个toolbar迷困扰于过多的按钮混乱中。得想办法结束这种状态。我决定摆脱这种按钮迷的状态,开始精简我的toolbar,去掉那些不太常用的按钮。我开始研究toolbar,结果发现没有一个按钮在工作中不太常用。我几乎每天都要用到所有这些命令,少了任何一个,我都要花时间到菜单堆里去找这些命令。我想保持原有toolbar中的所有功能,但我要把按钮数减下来,我能做得到吗?   再瞧一下toolbar,我发现打开和关闭六种实体(keypoints,lines,areas,volumes,和elements)的编号显示共用了12个按钮,此外,还有许多按钮用来打开和关闭显示节点和单元坐标系,线的方向和局部坐标系等;还有我用单独的按钮控制矢量模式和光栅模式显示。结果发现有22个按钮用来决定实体的编号和符号以及显示模式的开关。如果我能把每组开和关的按钮用一个按钮来代替,那么我可以把按钮数减少11个,这是一个很可观的数字。我决定写一个宏,它能够确定当前的设置,然后翻转该设置,我给它取名叫numtog.mac。在确定了程序的框架后,我开始查看关于*GET命令的帮助文档,看看是否能得到/PNUM,/PSYMB和显示模式的设置状态。令我失望的是,我发现尽管*GET命令可以设置显示模式,但不能得到关于/PNUM和/PSYMB的设置,没有它我就无法实现我的宏,失望之感油然而生。非常时候会有非常手段,文档中没有说明由*GET得到的量并不表示一定不可以获得,也许通过我的努力可以得到。我决定从其它地方找,在这以前我经常用此办法找到其它信息,我想到了控制ANSYS菜单系统的文件,因为ANSYS在建立关于/PNUM和/PSYMB的设置时也需要相关的信息,也许它以未公开的方式使用。我开始查找UIFUNC1.GRN和UIFUNC2.GRN,果然在UIFUNC2.GRN文件中找到了我要的信息,在该文件中我找到了控制编号和符号显示的命令,它也是由*GET命令获得,只不过时以一种特殊的方式,我就把相关的命令拷贝和粘帖到我的宏文件中,以节省时间。   尽管不推荐使用此类*GET命令,但有些高级的APDL编程人员经常使用。问题是未公开的*GET命令在5.6中能使用,但不能保证在5.7中也一定能使用,这只有等你试了以后才知道。   让我们来看一个例子,它用来确定keyponits编号的设置状态,格式如下:   *get,ar20,common,,d3com,,int,104从这个命令格式我们可以推断一些信息:其中的“Common”是指储存在公共数据块中的数据,“D3com”是该公共数据块的名字,“Int”指数值数据以整数格式存储,“104”是我们所要数据存储的位置。所以上面这条命令是告诉ANSYS提取在公共数据块“D3com”104位置的整型数据,并把它赋给变量ar20,通过试验知道,当keypoints编号显示为关闭时ar20为0,而开时为1,即用1和0表示开和关。   我的新toolbar已用了几星期了,很方便,它比旧的toolbar减少了25%的按钮。现在我的toolbar小多了,我还可以增加其它一些命令,如控制/EDGE的开和关等等。相信你会得到一些收益。
发表于 2003-5-8 22:01:30 | 显示全部楼层 来自 江苏南京

回复: 【寻找】请问:如何将下列菜单上命令加入到 Toolbar?

还是没讲清楚,当把!去掉时,倒是能弹出来,可一下子全弹出来了,我的意思是想让他成为一个像saVE_DB一样的按钮,当点击它时才出现!
freedomlwj 该用户已被删除
发表于 2003-5-9 10:41:16 | 显示全部楼层 来自 甘肃兰州
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2003-5-9 13:34:27 | 显示全部楼层 来自 江苏南京

回复: 【寻找】请问:如何将下列菜单上命令加入到 Toolbar?

我也找到了!
关于/ui的说明:
/UI
Name
/UI, Func, Type, Format, Screen, Color, Krev, Orient, Compress, Quality — Activates specified GUI dialog boxes.
group: SESSION:Run Controls  
  
product: MP ME ST DY PR EM FL PP ED  
  
Argument Descriptions
Funcr  
Label identifying the dialog box to be activated:  
  
HELP --   
Activates the online help system. Valid only in non-UI graphics mode (/MENU,GRPH).
  
VIEW --   
Activates the Pan, Zoom, Rotate dialog box
  
WPSE --   
Activates the Working Plane Settings dialog box.
  
WPVI --   
Activates the Offset Working Plane dialog box.
  
RESULT --   
Activates the Query Picking Menu for reviewing results.
  
QUERY --   
Activates the Query Picked Entities (preprocess) dialog box.
  
COPY --   
Activates the Hard Copy dialog box.
  
ANNO --   
Activates the 2D Annotation dialog box.
  
AN3D --   
Activates the 3D Annotation dialog box.
  
SELECT --   
Activates the Select Entities dialog box.
  
NSEL --   
Activates a picking menu to select nodes.
  
ESEL --   
Activates a picking menu to select elements.
  
KSEL --   
Activates a picking menu to select keypoints.
  
LSEL --   
Activates a picking menu to select lines.
  
ASEL --   
Activates a picking menu to select areas.
  
VSEL --   
Activates a picking menu to select volumes.
  
REFRESH --   
Refreshes the graphics window (non-UI mode only).
  
COLL --  
Controls the collapse of the ANSYS Main Menu when a FINISH command is issued. See Type below for a discussion of the arguments.
  
Type  
Label identifying the type of select operation. Valid only for the following Func labels; NSEL, ESEL, KSEL, LSEL, ASEL, and VSEL:  
  
S --   
Select a new set.
  
R --   
Reselect a set from the current set.
  
A --   
Additionally select a set and extend the current set.
  
U --   
Unselect a set from the current set.
  
Label identifying the type of results data to be queried. Valid only for Func = RESULT:  
  
NODE --   
Nodal solution data (h-elements only).
  
ELEMENT --   
Element solution data.
  
GRID --   
Subgrid solution data (p-elements only).
  
Label specifying the behavior of the ANSYS Main Menu after a FINISH command is issued. Note that this does not affect user interaction with the Main Menu. Valid only for Func = COLL:
  
YES, 1 or blank --  
Allows the Main Menu to collapse after FINISH command.
  
NO or 0 --  
Prevents Main Menu collapse after FINISH command.
  
If Func = COPY, and `Type = SAVE, command format is /UI,Func,Type,Format,Screen,Color,Krev,Orient,Compress,Quality. The remaining fields (after Type) identify the portion of the screen, the type of file, and the method of display that the portion of the screen is to be saved as.
  
Format  
  
PSCR --   
Encapsulated Postscript File Format.
  
TIFF --   
Tagged Image File Format.
  
EPSI --   
Encapsulated Postscript with TIFF preview.
  
BMP --   
(PC only) Bitmap (Windows) file format.
  
WMF --   
(PC only) Windows Metafile format.
  
EMF --   
(PC only) Enhanced Metafile format.
  
JPEG --   
JPEG (Joint Photographic Experts Group) file format.  
  
Screen  
  
FULL --   
Saves the entire screen in the specified format.
  
GRAPH --   
Saves only the ANSYS Graphic window.
  
Color  
  
MONO --   
A two color (black and white) file is saved.
  
GREY --   
The specified file format is saved in greyscale.
  
COLOR --   
The file is saved at the specified color depth.
  
Krev  
  
NORM --   
Saves file as shown on the screen.
  
REVERSE --   
Saves file with the background color reversed.
  
Orient  
  
LANDSCAPE --   
Saves file in landscape mode.
  
PORTRAIT --   
Saves file in portrait mode.
  
Compress  
  
YES --   
Compresses TIFF files and EPS files w/ TIFF preview (default).
  
NO --   
Saves files with no compression.
  
Quality  
  
1 -100  --   
JPEG quality index, with 100 being the maximum quality level.  
  
Notes
Allows you to activate specified GUI dialog boxes directly in either GUI or non-GUI mode.
  
The /UI command itself is valid in any processor, however certain dialog boxes are accessible only in a particular processor (e.g., /UI,RESULT,... is valid only in the General Postprocessor).  
  
ANSYS JPEG software is based in part on the work of the Independent JPEG Group, Copyright 1998, Thomas G. Lane.  
  
Menu Paths
This command cannot be accessed from a menu.
发表于 2003-5-9 13:46:59 | 显示全部楼层 来自 江苏南京

回复: 【寻找】请问:如何将下列菜单上命令加入到 Toolbar?

我想激活select entity按钮,用的命令为
*abra,select,/ui,select
坏蛋 该用户已被删除
 楼主| 发表于 2003-5-10 09:26:06 | 显示全部楼层 来自 广东广州
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2012-4-1 22:44:41 | 显示全部楼层 来自 河北廊坊
好难啊 !!!!!!11
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-9-22 07:39 , Processed in 0.065805 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表