《UIDL的幻灯片》PPT课件.ppt

上传人:枫** 文档编号:570136977 上传时间:2024-08-02 格式:PPT 页数:22 大小:215.50KB
返回 下载 相关 举报
《UIDL的幻灯片》PPT课件.ppt_第1页
第1页 / 共22页
《UIDL的幻灯片》PPT课件.ppt_第2页
第2页 / 共22页
《UIDL的幻灯片》PPT课件.ppt_第3页
第3页 / 共22页
《UIDL的幻灯片》PPT课件.ppt_第4页
第4页 / 共22页
《UIDL的幻灯片》PPT课件.ppt_第5页
第5页 / 共22页
点击查看更多>>
资源描述

《《UIDL的幻灯片》PPT课件.ppt》由会员分享,可在线阅读,更多相关《《UIDL的幻灯片》PPT课件.ppt(22页珍藏版)》请在金锄头文库上搜索。

1、ANSYS Graphical User Interface Programming With UIDLPresented By Computer Aided Engineering Associates, Inc.Copyright 2002 Computer Aided Engineering Associates, Inc. All rights reserved. Use, reproduction, distribution, etc. without the express written consent of Computer Aided Engineering Associat

2、es, Inc. is prohibited.Computer Aided Engineering Associates, Inc.2 Copyright 2002 Computer Aided Engineering Associates, Inc.Presentation TopicslIntroduction What is UIDL? Advantages and Disadvantages of UIDL l lUIDL Basics Structure of UIDL Control Files Menu Blocks Function Blocks l lExample Appl

3、ications GUI for SXYZ.MAC Automated GE Plastics Window SystemUIDLComputer Aided Engineering Associates, Inc.3 Copyright 2002 Computer Aided Engineering Associates, Inc.Introduction What is UIDL?lUIDL is the ANSYS “User Interface Design Language”. UIDL is specifically designed as a Graphical User Int

4、erface (GUI) for the ANSYS command structure. Ability to create Menus, Dialog boxes, and Picking Controls. lImplemented by ANSYS at revision 5.1 lUntil ANSYS 6.1 the ANSYS Main Menu and most Dialog Boxes were generated using UIDL Computer Aided Engineering Associates, Inc.4 Copyright 2002 Computer A

5、ided Engineering Associates, Inc.lUsability Specially designed as a GUI for ANSYS for ease in assembling ANSYS Commands Easy to incorporate User Programmed GUI with ANSYS GUI Interpreted (not compiled) so effects of modifications are immediately realizable. Can add features on corporate level and in

6、dividual user level lCompatibility: Cross-platform compatible.Introduction Advantages of UIDLComputer Aided Engineering Associates, Inc.5 Copyright 2002 Computer Aided Engineering Associates, Inc.Introduction Disadvantages of UIDLlLimited Flexibility: Difficult to use UIDL to do anything except fill

7、 in ANSYS command fields or create menus. Cannot customize “look and feel”, by adding graphics or custom buttons. Limits on Text String/Prompt lengths lNonstandard Language: Since UIDL was written specifically for ANSYS there are not many people that know how to program it. Error trapping is not rob

8、ust. Requires write privileges on control file for the initial indexing. lLimited Technical Support: Considered “Non-standard” use of the program Computer Aided Engineering Associates, Inc.6 Copyright 2002 Computer Aided Engineering Associates, Inc.UIDL in ANSYS Basic StructurelUIDL is programmed us

9、ing a control file (or Granule file) lThe Granule File contains header information and a series of “Building Blocks” l“Building Blocks” are either: Menu Blocks: Define menu entries or Function Blocks: Define dialog and pick boxes :F DEMO.GRN :D Demo Granule for Seminar :I 367, 90955, 100155 :! :N Me

10、n_Keypoint :S 177, 74, 96 :T Menu :A Keypoints :D Keypoints Fnc_K_p Fnc_K Fnc_KL Fnc_KLD Fnc_KNODE Fnc_KBET Fnc_KFILL Men_KCEN Sep_ Men_HARDPTL Men_HARDPTA :E End :N Fnc_K :S 341, 143, 191 :T Command :C )! Fnc_K :A In Active CS :D Create Keypoints in Active Coordinate System :K #(PREP7) :H Hlp_C_K C

11、md_K Fld_0 Typ_Lab Prm_K Create Keypoints in Activ Coordinate System Fld_2 Prm_NPT Keypoint number Typ_INT Def_Blank Fld_3 Prm_X,Y,Z Location in active CS Typ_REAL3 :E EndComputer Aided Engineering Associates, Inc.7 Copyright 2002 Computer Aided Engineering Associates, Inc.UIDL in ANSYS Control File

12、slControl files (or Granule Files) are simply ASCII files that contain some header information and then the “building blocks” for the menus and dialogs. Usually has a .GRN extension. Required header consists of :F DEMO.GRN- File Name :D Demo Granule for Seminar - Description :I 0, 0, 0- Index line (

13、0s required) Index line will be overwritten by ANSYS the first time the file is parsed Write privileges are required lThe control file must be referenced in the menulist60.ans file. ANSYS searches for this file in the following locations in order: Working Directory Home Directory ANSYS DOCU director

14、yComputer Aided Engineering Associates, Inc.8 Copyright 2002 Computer Aided Engineering Associates, Inc.UIDL in ANSYS Menulist FilelThe menulist file contains a list of all of the .GRN files that the GUI will use The list of files are parsed in order so later files can overwrite earlier files Useful

15、 because there is no need to edit the ANSYS supplied.GRN files. Simply redefine the desired menu or function and then list the user Granule file after the ANSYS files. lExample menulist60.ans C:Program FilesAnsys IncANSYS61DOCUenglishuidlUIMENU.GRN C:Program FilesAnsys IncANSYS61DOCUenglishuidlUIFUN

16、C1.GRN C:Program FilesAnsys IncANSYS61DOCUenglishuidlUIFUNC2.GRN C:Program FilesAnsys IncANSYS61DOCUenglishuidlMECHTOOL.AUI C:Program FilesAnsys IncANSYS61DOCUenglishuidlCAEG.GRN DEMO.GRN Computer Aided Engineering Associates, Inc.9 Copyright 2002 Computer Aided Engineering Associates, Inc.UIDL in A

17、NSYS Building BlockslAs we have seen there are 2 basic building blocks in UIDL: Menu Block Function Block lEach block consists of 2 sections: Header Section: All lines start with a “:” Control Section lThe Header section is basically the same for each building block. Required header fields are: :N M

18、en_menuname or :N Fnc_functionname :S 0, 0, 0-Index line (will be modified by ANSYS) :T type (Menu, Cmd, Cmd_P) :A name To appear in a menu :D description To appear in window title barComputer Aided Engineering Associates, Inc.10 Copyright 2002 Computer Aided Engineering Associates, Inc.UIDL in ANSY

19、S Building Blocks Headers cont.lThere are also optional header lines available :H Hlp_helpentry - Designates the help section to access when help button is pressed :C ansys command Executes an APDL command when this block is called Example: :C /POST1 in the header section of the General Postprocesso

20、r menu will switch the processor to POST1 before displaying the menu. Very useful for defining variables or executing commands before a Menu or Dialog box is displayed. Note: For dialog boxes these commands are executed as soon as the box is displayed (they are not affected by the CANCEL button) :K

21、KEYWORD Keyword logic to determine whether Fnc or Men is visible in a menu Computer Aided Engineering Associates, Inc.11 Copyright 2002 Computer Aided Engineering Associates, Inc.UIDL in ANSYS Menu BlockslMenu Blocks Headers :N Men_menuname :T Menu Control Section Simply a list of Sub Menus or Funct

22、ions that should be in this menu, referenced by their :N names. Also allows Sep_ - Creates a separator line. A plain text string will appear as a menu header line Example:N Men_Keypoint :S 0, 0, 0 :T Menu :A Keypoints :D Keypoints Fnc_K_p Fnc_K Fnc_KL Fnc_KLDFnc_KLD Fnc_KNODE Fnc_KBET Fnc_KFILL Men_

23、KCEN Sep_ Men_HARDPTL Men_HARDPTA :E EndComputer Aided Engineering Associates, Inc.12 Copyright 2002 Computer Aided Engineering Associates, Inc.Computer Aided Engineering Associates, Inc.13 Copyright 2002 Computer Aided Engineering Associates, Inc.UIDL in ANSYS Function Blocks cont.lThe Fld_ control

24、s determine which fields of the Cmd_ will be filled in by the user. The format is Fld_#. The lines following this Fld_ control will affect that field number. Each Fld_# line should be followed by at least one Typ_ line which dictates the type of data that will go into that field. Other available lin

25、es to follow the Fld_ are: Prm_ - Displays a test prompt in the dialog box Def_ - Defines a default value to display in the field K_FL Defines Keyword logic that determines whether the entry box for field should be displayed Computer Aided Engineering Associates, Inc.14 Copyright 2002 Computer Aided

26、 Engineering Associates, Inc.UIDL in ANSYS Function Blocks cont.lThere are over 20 different available Typ_ lines in UIDL, to define different types of entries. l Typ_Int Typ_Int2 Typ_Int3 Typ_Real Typ_Real2 Typ_Real3 Typ_Char Typ_Logi Typ_Lis_OptionB Typ_Mlis Typ_Lis_RadioB Typ_Idx Typ_File Typ_Fil

27、e_InlineTyp_Node Typ_Elem Typ_XYZ Typ_XYZ_WP Typ_Resu Typ_Color Typ_Def +MorelWe will look at a few of these types. Please refer to the UIDL Programmers Guide for information on the other types. l Computer Aided Engineering Associates, Inc.15 Copyright 2002 Computer Aided Engineering Associates, Inc

28、.UIDL in ANSYS Function Blocks cont.lLets look at a simple example of how to generate this dialog box in ANSYS: :N Fnc_K :S 341, 143, 191 :T Command :C )! Fnc_K :A In Active CS :D Create Keypoints in Active Coordinate System :K #(PREP7) :H Hlp_C_K Cmd_K Fld_0 Typ_Lab Prm_K Create Keypoints in Activ

29、Coordinate System Fld_2 Prm_NPT Keypoint number Typ_INT Def_Blank Fld_3 Prm_X,Y,Z Location in active CS Typ_REAL3 :E EndComputer Aided Engineering Associates, Inc.16 Copyright 2002 Computer Aided Engineering Associates, Inc.UIDL in ANSYS Function Blocks cont.lOther useful Function block commands: Us

30、e Cnt_, Min_, Max_, Sel_ Rub_, Pdp_, etc. to control how many entities, what types of entities, what type of picking, etc. the user can choose when a pick box is opened. Use the Cal_ just before the end (:E End) of a function to call another function Cal_Fnc_Demo1 Will call function Demo1 after the

31、users chooses OK or Apply The Cal_ comand can also be a conditional call Ex. Cal_Fnc_Name,Fld #,Oper,Value,Cmd # Cal_Fnc_Demo2,2,EQ,1,3 Will call Function Demo2 if field 2 of the 3rd command equals 1 Cal_REFRESH Will refresh the currently open submenu. Useful if this Function Block has modified a Ke

32、yword so that an entry is no longer grayed out. Use *PAR(var) to retrieve the value of a variable Computer Aided Engineering Associates, Inc.17 Copyright 2002 Computer Aided Engineering Associates, Inc.UIDL in ANSYS Detailed ExamplelLets look at a more detailed example in which we create a GUI for t

33、he SXYZ macro that was presented in the APDL section. The sxyz macro requires X,Y,Z positions and an averaging key as input. Use UIDL to create a GUI that allows the user to pick an arbitray point in space at which to obtain the Stress. After picking we will bring up a dialog box with the coordinate

34、s that the user chose so they can be modified if necessary. Also prompt for type of stress to list. Add this function to the PostProcessor under List Results.Computer Aided Engineering Associates, Inc.18 Copyright 2002 Computer Aided Engineering Associates, Inc.UIDL in ANSYS Detailed Example:F DEMO.

35、GRN :D Demo Granule for Seminar :I 0, 0, 0 :! :N Men_ListResults :S 0, 0, 0 :T Menu :A List Results :K #(POST1+RESULTS)*NOFILTER) Fnc_SET_list Fnc_PRITER Fnc_PRERR Fnc_PRCONV Sep_ -Sorted Listing- Fnc_NSORT Fnc_NUSORT Fnc_ESORT Fnc_EUSORT Sep_ Fnc_sxyz Sep_ Fnc_PRNSOL Fnc_PRESOL Fnc_PRSSOL Fnc_SEDLI

36、S Sep_ Fnc_PRRSOL Fnc_PRNLD Sep_ Fnc_PRETAB_dummy Fnc_PRVECT Fnc_PRPATH_dummy Fnc_PRSECT_dummy K_LN(ELECTRIC*MAGNETIC+EDGEELC) Sep_ K_LN(ELECTRIC*MAGNETIC+EDGEELC) -Field Extension- Fnc_RADAR_L Fnc_RADAR_NL Fnc_HFFAR_L Fnc_HFNEAR Fnc_ANTENNA Fnc_ANTPAT_L Fnc_ANTDIR_L Fnc_ANTPRAD Fnc_ANTPGAIN Fnc_ANT

37、EFF :E End First add our function to a pre-existing ANSYS menuAutomatically parsed into Tcl/Tk menu for new GUI in ANSYS 6.1Computer Aided Engineering Associates, Inc.19 Copyright 2002 Computer Aided Engineering Associates, Inc.UIDL in ANSYS Detailed Example:N Fnc_sxyz :S 0, 0, 0 :T Cmd_P :C )! Fnc_

38、sxyz :A Stress at XYZ location :D Evaluate Stress at XYZ location :H Hlp_EFIX Inp_P Cmd_)/NOPR Cmd_)*DEL,_z Cmd_)*DIM,_z,3 Cmd_)*SET,_z(1) Fld_2 Prm_Pick location or enter coordinates for stess evaluation Typ_XYZ Min_1 Cnt_1 PFM_2 ! Cmd_)/GO Cal_Fnc_sxyz2 :E END :! Then generate a picking tool and p

39、rompt the user to pick an arbitrary location. Store the point coordinates and then call the next functionComputer Aided Engineering Associates, Inc.20 Copyright 2002 Computer Aided Engineering Associates, Inc.UIDL in ANSYS Detailed Example cont.:N Fnc_sxyz2 :S 0, 0, 0 :T Command :C )! Fnc_sxyz2 :A S

40、tress at XYZ location :D Evaluate Stress at XYZ location Cmd_SXYZ Fld_0 Typ_Lab Prm_Evaluate Stress at Specified Location ! Fld_2 Typ_REAL3 Prm_X,Y,Z Coordinates for stress evaluation Def_*PAR(_z(1),*PAR(_z(2),*PAR(_z(3) ! Fld_5 Prm_Item,Stress to be printed Typ_IDX IDX_Stress ,X-direction SX,X IDX_

41、Stress ,Y-direction SY,Y IDX_Stress ,Z-direction SZ,Z IDX_Stress ,XY-shear SXY,XY IDX_Stress ,YZ-shear SYZ,YZ IDX_Stress ,XZ-shear SXZ,XZ IDX_Stress ,1st principal S1,1 IDX_Stress ,2nd principal S2,2 IDX_Stress ,3rd principal S3,3 IDX_Stress ,Intensity SINT,INT IDX_Stress ,von Mises SEQV,EQV :E ENDF

42、inally, bring up a dialog to display the coodinates of the picked point (with the ability to modify them) and prompt for the stress type.Computer Aided Engineering Associates, Inc.21 Copyright 2002 Computer Aided Engineering Associates, Inc.UIDL in ANSYS Hints and TipslAll of the ANSYS Menus and Dia

43、log boxes are found in the directory: ANSYS61/docu/english/UIDL. The files are UIMENU.GRN, UIFUNC1.GRN, and UIFUNC2.GRN Start by finding an Menu or Dialog box in ANSYS that resembles the one that you wish to create. Find the UIDL code for that block in one of the ANSYS files and copy it to a new fil

44、e. lRemember to reset all index lines to 0s. lSave a copy of your granule file with the 0 indices,because ANSYS will overwrite them the first time it is accessed. lWatch your CASE. UIDL is case sensitive, unlike APDL.Computer Aided Engineering Associates, Inc.22 Copyright 2002 Computer Aided Engineering Associates, Inc.UIDL in ANSYS Customized GUI DemolDemonstration of a Fully customized ANSYS GUI for a Window Manufacturer

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 高等教育 > 研究生课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号