Home
Abaqus GUI User`s Manual
Contents
1. ees OH 2 Model Resuts Module E Model v Step 2 wv me Models 1 Ei Model 1 fl Parts 1 Pe Materials 1 Calibrations EH x Sections 1 Profiles 9 i Assembly Ho a Steps 2 Field Output Be History Outpt Time Points ALE Adaptive T Interactions Interaction P Contact Cont qe Contact Initie d Contact Stab Model Model 1 Analysis product Abaqus Standard Description NENNEN Submission General Memory Parallelization Precision Job Type Full analysis Recover Explicit Restart Run Mode Host names Background C Queue Piu Type Submit Time onstraints E Connector Se w 9 nd 41 fe C Wait hrs min pue x gt p gt Figure 2 1 An overview of an Abaqus GUI application Dialog boxes Dialog boxes group widgets inside layout managers and present all the inputs required for a particular function For example the Print dialog box presents all the controls that allow the user to specify what should be printed and how it should be printed Modes Modes are GUI mechanisms that control the display of a particular user interface Modes are also responsible for issuing the command associated with that user interface For example a mode is started when you select File Pr
2. 7 5 7 Picking by angle Picking by face angle or by edge angle is always enabled when appropriate For example picking by face angle is enabled when the user is picking faces You cannot disable picking by angle 7 5 8 AFXOrderedPickStep The AFXOrderedPickStep is a special pick step that preserves the order in which the user picks entities For example when picking four nodes to create a quad element the order in which the user picks the nodes is important and must be preserved during picking The user must pick the entities one at a time and cannot drag select them In addition because this is a single step that treats the picked entities as a single pick the user cannot backup any of the individual picks The step continues to loop until the user clicks the mouse button two 7 5 9 Prepopulating a pick step In some cases you may want to prepopulate a pick step with some selections For example let s say that you have a procedure that creates an object that includes selecting a region of the model and you want to allow the user to edit that object In the edit procedure you will want to prepopulate the region selection step with the selection that the user originally made when creating the object You can do this by adding a set of entities to the pick step as shown below step AFXPickStep self self nodesKw Select some nodes AFXPickStep NODES AFXPickStep MANY 1 AFXPickStep ARRAY step addNodeSetSelection NodeSet 1 Ther
3. 0 0 The following statement creates a dialog box that always occludes its owner widget usually a dialog box when overlapping with the widget AFXDataDialog mode owner title actionButtonIds 0 opts DIALOG NORMAL x 0 0 w 0 h 0 When you construct a dialog box you will start by deriving from the AFXDataDialog class The first thing you should do in the constructor body is call the base class constructor to properly initialize the dialog Then you would build the contents of your dialog by adding widgets For example class MyDB AFXDataDialog My constructor def init self Call base class constructor AFXDataDialog init self form My Dialog self OK self CANCEL Add widgets next When a dialog box is unposted it is removed from the screen By default a dialog box is deleted when it is unposted Deleting a dialog box removes both the GUI resources associated with the dialog box and the dialog box s data structures In contrast you can choose to destroy a dialog box when it 5 12 DATA DIALOG BOXES is unposted Destroying a dialog box removes only the GUI resources and retains the dialog box s data structures If there is some dialog box GUI state that you want to retain between postings of the dialog box you should specify that the dialog box is destroyed only when it is unposted Therefore when the dialog box is posted again it retains its data structures and the old state
4. Abaqus 6 12 GUI Toolkit User s Manual A DS SIMULIA Abaqus GUI Toolkit User s Manual Legal Notices CAUTION This documentation is intended for qualified users who will exercise sound engineering judgment and expertise in the use of the Abaqus Software The Abaqus Software is inherently complex and the examples and procedures in this documentation are not intended to be exhaustive or to apply to any particular situation Users are cautioned to satisfy themselves as to the accuracy and results of their analyses Dassault Systemes and its subsidiaries including Dassault Syst mes Simulia Corp shall not be responsible for the accuracy or usefulness of any analysis performed using the Abaqus Software or the procedures examples or explanations in this documentation Dassault Syst mes and its subsidiaries shall not be responsible for the consequences of any errors or omissions that may appear in this documentation The Abaqus Software is available only under license from Dassault Syst mes or its subsidiary and may be used or reproduced only in accordance with the terms of such license This documentation is subject to the terms and conditions of either the software license agreement signed by the parties or absent such an agreement the then current software license agreement to which the documentation relates This documentation and the software described in this documentation are subject to change without prior notice No part o
5. Boolean keyword with option tree list self tree AFXOptionTreeList parent 6 self treeitem addItemLast Item 1 mode itemlKw Integer keyword AFXTextField self 8 Number of CPUs mode cpusKw 0 combo AFXComboBox self 8 3 Number mode numberKw combo appendItem 1 1 combo appendItem 2 2 combo appendItem 3 3 Float keyword AFXTextField self 8 Radius mode radiusKw 0 String keyword AFXTextField self 8 Name mode nameKw 0 6 5 12 Symbolic constant keyword examples 0 0 Symbolic constants provide a way to specify choices for a command argument that make the command more readable For example there are three choices for the renderStyle argument in display options 6 17 GUI COMMANDS commands We could number these choices using integer values from 1 to 3 However using integer values would result in a command that is not very readable for example renderStyle 2 Alternatively if we define symbolic constants for each choice the command becomes more readable for example renderStyle HIDDEN Internally symbolic constants contain an integer ID that can be accessed via its getId method Symbolic constants can be used in both the GUI and kernel processes Typically you should create a module that defines your symbolic constants and then import that module into both your kernel and GUI scripts You can import the SymbolicConstant constructor from the symbolicConstant
6. Button E Button 2 Button 3 Figure 4 10 Adding a third button on the left side at the top of the layout cavity Figure 4 11 shows the final configuration of the three buttons 222671 eiii A Button 1 YJ Button 2 Button 3 p et be Figure 4 11 The final configuration of the buttons Example 2 The second example illustrates how you can use nondefault layout hints The example starts by using the default hints to position a button on top of the available space and on the left gb FXGroupBox p FXButton gb Button 1 4 11 LAYOUT EXAMPLES Figure 4 12 Creating a button on the left side and at the top of the layout cavity The example then positions a second button on the right side on the bottom of the layout cavity FXButton gb Button 2 opts LAYOUT SID TTOM LAYOUT RIGHT BUTTON NORMAL Figure 4 13 Adding a second button on the right side at the bottom of the layout cavity Finally the example places a third button on the bottom of the available space and centered in the X direction FXButton gb Button 3 zLAY TTON NORMAL TIPS FOR SPECIFYING LAYOUT HINTS Figure 4 14 Adding a third button in the center at the bottom of the layout cavity 4 12 Tips for specifying layout hints no r specify layou isha In many cases the default values are what you want and you do E specify the hin e Thinkinterms ofs sinl ows and columns and use horizontal or
7. File View Manipulation View Options Selection c nig Toolbar grip Render Style Visible Objects View Cut Display Group Color Code Translucency or NENNEN Aad 0 945 ris JH ex Rin Ei Sip Part defauts 18 i LA Figure 13 2 The Abaqus CAE toolbars You can use the following statement to access a toolbar group from the module or toolset that defines the toolbar group toolbar self getToolbarGroup toolbarName 13 4 THE PROMPT AREA where se fis the module or toolset and toolbarName is the name given to the toolbar when Abaqus CAE constructs it You can determine the names of the toolbars by selecting Tools Customize from the main menu bar and viewing the dialog box that appears 13 5 The context bar The context bar contains controls for the current module and other context for example the current part You can access the context bar using the following statement contextBar getAFXApp getAFXMainWindow getContextBar 13 6 The module toolbox The module toolbox contains icons for tools commonly used in the current module When you switch into a module that module s toolbox icons replace those of the previous module You can access the module toolbox using the following statement toolbox getAFXApp getAFXMainWindow getToolbox 13 7 The drawing area and canvas The canvas provides an infinite space upon which you can create and man
8. GUI IN MENUBAR ViewManipToolsetGui View GUI IN MENUBAR GUI IN TOOLBAR Manipulation For an example of how example Section 14 2 Visualization module to register the toolsets and modules used by Abaqus CAE see Main window 1 The following statements show how you could add your own toolset to the File myVisModuleGui py from abaqusGui import from myToolsetGui import MyToolsetGui class MyVisModuleGui VisualizationGui def _ init self Construct the base class VisualizationGui init self Register my toolset 10 3 MODIFYING AND ACCESSING Abaqus CAE GUI MODULES AND TOOLSETS self registerToolset MyToolsetGui GUI IN MENUBAR GUI IN TOOLBOX MyVisModuleGui File myMainWindow py from abaqusGui import class MyMainWindow AFXMainWindow def init self app windowTitle self registerModule Visualization myVisModuleGui If you derive a toolset from an Abaqus CAE toolset you must construct that toolset using the makeCustomToolsets method of AFXMainWindow You must use the makeCustomToolsets method to ensure that the toolset is created at the appropriate time during application startup This will avoid any conflicts with Abaqus CAE modules that also make use of the module For example if you derive a new toolset from the Datum toolset you must create the new toolset in makeCustomToolsets This approach is illustrated in the following exam
9. String RGB value Grey22 FXRGB 56 56 56 Grey23 FXRGB 59 59 59 Grey24 FXRGB 61 61 61 25 FXRGB 64 64 64 Grey26 FXRGB 66 66 66 Grey27 FXRGB 69 69 69 Grey28 FXRGB 71 71 71 Grey29 FXRGB 74 74 74 Grey3 FXRGB 8 8 8 Grey30 FXRGB 77 77 77 Grey31 FXRGB 79 79 79 Grey32 FXRGB 82 82 82 Grey33 FXRGB 84 84 84 Grey34 FXRGB 87 87 87 Grey35 FXRGB 89 89 89 Grey36 FXRGB 92 92 92 Grey37 FXRGB 94 94 94 Grey38 FXRGB 97 97 97 Grey39 FXRGB 99 99 99 Grey4 FXRGB 10 10 10 Grey40 FXRGB 102 102 102 Grey41 FXRGB 105 105 105 Grey42 FXRGB 107 107 107 Grey43 FXRGB 110 110 110 Grey44 FXRGB 112 112 112 Grey45 FXRGB 115 115 115 Grey46 FXRGB 117 117 117 Grey47 FXRGB 120 120 120 APPENDIX B COLORS AND RGB VALUES String RGB value Grey48 Grey49 5 Grey50 Grey51 Grey52 Grey53 Grey54 Grey55 Grey56 Grey57 Grey58 Grey59 Grey6 Grey60 Grey61 Grey62 Grey63 Grey64 Grey65 Grey66 Grey67 Grey68 Grey69 Grey7 Grey70 Grey71 Grey72 FXRGB 122 122 122 FXRGB 125 125 125 FXRGB 13 13 13 FXRGB 127 127 127 FXRGB 130 130 130 FXRGB 133 133 133 FXRGB 135 135 135 FXRGB 138 138 138 FXRGB 140 140 140 FXRGB 143 143 143 FXRGB 145 145 145 FXRGB 148 148 148 FXRGB 150 150 150 FXRGB 15 15 15 FXRGB 153 153 153 FXRGB 156 156 156 FXRGB 158 158 158 FXRGB 161 161 161 FXRGB 163 163 163 FXRGB 166 166 166 FXRGB 168 168
10. The Abaqus GUI Toolkit is an extension of the FOX GUI Toolkit just as the Abaqus Scripting Interface is an extension of the Python programming language FOX which stands for Free Objects for X is a modern object oriented platform independent GUI toolkit Since the Abaqus GUI Toolkit is platform ORGANIZATION OF THE Abaqus GUI Toolkit USER S MANUAL independent once you write an application for one platform you can run that application on all supported platforms you do not need to change your source code The user interface produced by the Abaqus GUI Toolkit looks similar on all platforms This is due to the architecture of the toolkit While the application programming interface API is the same on all platforms the underlying calls made to the operating system s GUI libraries differ on Linux systems calls are made to the Xt library whereas on Windows systems calls are made to the Win32 library These differences are hidden from the application developer Since the FOX GUI Toolkit is object oriented it allows developers to extend its functionality easily by deriving new classes from the base toolkit The Abaqus GUI Toolkit takes advantage of this feature by adding special functionality required for Abaqus GUIs Class names that begin with FX are part of the standard FOX library for example FXButton Class names that begin with AFX are part of the Abaqus extensions to the FOX library for example APXDialog When the same class exis
11. committed for example the user clicked a push button The SEL UPDATE message is sent when a widget is requesting its target to update its state for more information see Automatic GUI updating Section 6 5 5 A message is routed to a message handler using a map defined in the target class You add an entry in the map by specifying which method to call when a message of a certain type and ID is received These concepts are illustrated in Figure 6 2 The message map is defined by using the FXMAPFUNC function see example below This macro takes four arguments self message type message ID and method name The method name must be qualified by the class name className methodName When a message is received whose type and ID match those defined in an FXMAPFUNC entry the corresponding method will be called If you have a GUI COMMANDS Object 3 ID_1 msgType1 Object 1 Target None Msg ID 0 Target Object Msg Types Various Msg ID ID_1 Msg Types Various Message Map msgType1 ID_1 onCmdA msgType2 ID_2 onCmdB Object 2 msgType1 ID_3 onCmdA ID_2 msgType2 Target Object 3 onCmdA Msg ID ID_2 Do something Msg Types Various Do something Figure 6 2 Targets and messages large range of IDs that you want to define in the message map you can use the FXMAPFUNCS function which takes one additional argument self message type start message ID end messag
12. example the AFXModuleGui base class keeps track of the module s menus along with its toolbar and 8 1 GUI MODULE EXAMPLE toolbox icons As a result the menus toolbars and icons can be swapped in and out automatically as the user changes modules The following example shows how to create a module GUI subsequent sections explain the details of this example from abaqusGui import from myModes import mode 1 mode 2 mode 3 from myIcons import from myToolsetGui import MyToolsetGui class MyModuleGui AFXModuleGui def init self Construct the base class mw getAFXApp getAFXMainWindow AFXModuleGui init self moduleName My Module displayTypes AFXModuleGui PART mw appendApplicableModuleForTreeTab Model self getModuleName mw appendVisibleModuleForTreeTab Model self getModuleName Menu items menu AFXMenuPane self AFXMenuTitle self amp Menul None menu AFXMenuCommand self menu amp Item 1 None mode 1 AFXMode ID_ACTIVATE subMenu AFXMenuPane self AFXMenuCascade self menu amp Submenu None subMenu AFXMenuCommand self subMenu amp Subitem 1 None mode_2 AFXMode ID_ACTIVATE Toolbar items group AFXToolbarGroup self icon FXXpmIcon getAFXApp iconDatal AFXToolButton group tTool Tip icon mode 1 AFXMode ID ACTIVATE GUI MODULE EXAMPLE Toolbox items group AFXToolboxGroup self icon FXXPMIcon g
13. mode heightKw 0 7 11 PROCEDURE MODES 7 4 Procedure modes A procedure consists of a series of steps that collect input from the user The following topics are covered in this section Procedure example Section 7 4 1 e Procedure constructor Section 7 4 2 e getFirstStep Section 7 4 3 e getNextStep Section 7 4 4 e getLoopStep Section 7 4 5 e AFXDialogStep Section 7 4 6 7 4 1 Procedure example Steps in a procedure are posted using the following methods e getFirstStep e getNextStep getLoopStep The following types of steps are available for use in procedures AFXDialogStep This step provides an interface to a dialog box AFXPickStep This step provides an interface to allow picking entities in the viewport The following example shows how to write a simple one step procedure mode that uses a dialog box step Subsequent examples will extend this example to show how to use more steps from abaqusGui import from plateDB import PlateDB class PlateProcedure AFXProcedure AFXProcedure init self owner self cmd AFXGuiCommand self Plate examples self nameKw AFXStringKeyword self cmd name True self widthKw AFXFloatKeyword self cmd width True self heightKw AFXFloatKeyword self cmd height True 7 12 PROCEDURE MODES def getFirstStep self self cmd setKeywordValuesToDefaults db PlateDB self return AFXDialogStep self db 7 4
14. AFXTextField self 12 View Vector X Y Z mode viewVectorKw 0 Alternatively you can use three separate text fields to collect X Y and Z inputs Each of the text field widgets uses a message ID equal to the element number 1 based of the tuple to which they correspond For example 1 corresponds to the first element of the tuple 2 corresponds to the second element in the tuple etc In this case we can connect the keyword to three text fields as follows AFXTextField self 4 X mode viewVectorKw 1 AFXTextField self 4 Y mode viewVectorKw 2 AFXTextField self 4 Z mode viewVectorKw 3 6 5 14 Table keyword example The AFXTableKeyword must be connected to a table widget This type of keyword will result in a command argument that is a tuple of tuples The values in a table keyword can be Ints Floats or Strings The default minimum number of rows is 0 and the default maximum number rows is 1 indicating that the number of rows is unlimited Tables can vary in size because the user can add or delete rows as a result you usually specify the defaults for the minimum and maximum number of rows For example to generate a command that creates XY data you can define the following keywords in the form GUI COMMANDS self cmd AFXGuiCommand self XYData session self nameKw AFXStringKeyword self cmd name True self dataKw AFXTableKeyword self cmd data True 0 1 AFXTABLE TYPE FLOAT In the
15. Violet VioletRed VioletRed1 VioletRed2 VioletRed3 VioletRed4 Wheat Wheatl Wheat2 Wheat3 Wheat4 White WhiteSmoke Yellow Yellowl Yellow2 Yellow3 Yellow4 YellowGreen FXRGB 238 130 238 FXRGB 208 32 144 FXRGB 255 62 150 FXRGB 238 58 140 FXRGB 205 50 120 FXRGB 139 34 82 FXRGB 245 222 179 FXRGB 255 231 186 FXRGB 238 216 174 FXRGB 205 186 150 FXRGB 139 126 102 FXRGB 255 255 255 FXRGB 245 245 245 FXRGB 255 255 0 FXRGB 255 255 0 FXRGB 238 238 0 FXRGB 205 205 0 FXRGB 139 139 0 FXRGB 154 205 50 24 APPENDIX C LAYOUT HINTS Appendix C Layout hints The layout managers in the Abaqus GUI Toolkit support the following layout hints Layout hint Used in Effect If you specify one of these four layout hints the child widget will be stuck to the top bottom left or right respectively in the layout manager cavity The size LAYOUT_SIDE_TOP default FXPacker of the cavity will be reduced by the amount lopped LAYOUT_SIDE BOTTOM FXGroupBox off by the packed widget LAYOUT SIDE TOP LAYOUT SIDE LEFT Pu ue and LAYOUT SIDE BOTTOM will reduce the LAYOUT SIDE RIGHT p height of the cavity LAYOUT_SIDE_LEFT and LAYOUT_SIDE_RIGHT will reduce the width of the cavity For other composite widgets these hints may not have any effect The widget will be placed on the left side or right side of the space remaining in the LAYOUT_LEFT default All container When used for a child of FXPacker
16. 168 FXRGB 171 171 171 FXRGB 173 173 173 FXRGB 176 176 176 FXRGB 18 18 18 FXRGB 179 179 179 FXRGB 181 181 181 FXRGB 184 184 184 APPENDIX B COLORS AND RGB VALUES String RGB value Grey73 FXRGB 186 186 186 Grey74 FXRGB 189 189 189 Grey75 FXRGB 191 191 191 Grey76 FXRGB 194 194 194 Grey77 FXRGB 196 196 196 Grey78 FXRGB 199 199 199 Grey79 FXRGB 201 201 201 Grey8 FXRGB 20 20 20 Grey80 FXRGB 204 204 204 Grey81 FXRGB 207 207 207 Grey82 FXRGB 209 209 209 Grey83 FXRGB 212 212 212 Grey84 FXRGB 214 214 214 Grey85 FXRGB 217 217 217 Grey86 FXRGB 219 219 219 Grey87 FXRGB 222 222 222 Grey88 FXRGB 224 224 224 Grey89 FXRGB 227 227 227 Grey9 FXRGB 23 23 23 Grey90 FXRGB 229 229 229 Grey91 FXRGB 232 232 232 Grey92 FXRGB 235 235 235 Grey93 FXRGB 237 237 237 Grey94 FXRGB 240 240 240 Grey95 FXRGB 242 242 242 Grey96 FXRGB 245 245 245 Grey97 FXRGB 247 247 247 Grey98 FXRGB 250 250 250 APPENDIX B COLORS AND RGB VALUES String RGB value Grey99 FXRGB 252 252 252 Honeydew FXRGB 240 255 240 Honeydew1 FXRGB 240 255 240 Honeydew2 FXRGB 224 238 224 Honeydew3 FXRGB 193 205 193 Honeydew4 FXRGB 131 139 131 HotPink FXRGB 255 105 180 HotPink1 FXRGB 255 110 180 HotPink2 FXRGB 238 106 167 HotPink3 FXRGB 205 96 144 HotPink4 FXRGB 139 58 98 IndianRed FXRGB 205 92 92 IndianRed1 255 106 106 IndianRed2 FXRGB 238 99 99 IndianRed3 FXRGB 2
17. FXXPMIcon getAFXApp boltToolboxIconData btn setIcon icon This example script illustrates the following Deriving a new toolset class To modify a toolset GUI you begin by deriving a new class from it Inside the new class constructor body you must call the base class constructor and pass se f as the first argument Removing items from a menu or toolbar You can remove items from a menu by hiding them You use the getWidgetFromText or the getSeparator functions to obtain the widgets and call the hide method to remove them Adding items to a menu You can insert items into an existing menu by creating new menu commands and positioning them using the LinkBefore or linkAfter methods Renaming items and changing icons You can change the text or icon associated with a widget by calling the setText or setIcon methods 10 12 Part VI Creating a customized application This part describes how you create a customized application The following topics are covered Chapter 11 Creating an application Chapter 12 The application object Chapter 13 The main window Chapter 14 Customizing the main window STARTUP SCRIPT 11 Creating an application This chapter explains how to create an application The following topics are covered Design overview Section 11 1 e Startup script Section 11 2 e Licensing and command line options Section 11 3 e Installation Section 11 4 11 1 Design overvi
18. For more information see Registered dictionaries Section 5 6 7 of the Abaqus Scripting User s Manual RegisteredList allows you to create custom lists For more information see Registered lists Section 5 6 8 of the Abaqus Scripting User s Manual e RegisteredTuple allows you to create custom tuples For more information see Registered tuples Section 5 6 9 of the Abaqus Scripting User s Manual For more information on the customKernel module see Extending the Abaqus Scripting Interface Section 5 6 of the Abaqus Scripting User s Manual 6 26 MODE PROCESSING 7 Modes A mode is a mechanism for gathering input from the user processing that input and then issuing a command to the kernel This section describes the modes that are available in the Abaqus GUI Toolkit The following topics are covered e An overview of modes Section 7 1 Mode processing Section 7 2 e Form modes Section 7 3 e Procedure modes Section 7 4 e Picking in procedure modes Section 7 5 7 1 An overview of modes There are two types of modes Form Modes Form modes provide an interface to standalone dialog boxes Procedure Modes Procedure modes provide an interface that uses the prompt area to guide the user through a sequence of steps that collect input from dialog boxes or from selections in the viewport Ifa mode needs to perform drawing or highlighting in the current viewport the
19. LAYOUT_RIGHT FXGroupBox or FXTopLevel the hint will be ignored unless either LAYOUT_SIDE_TOP or LAYOUT SIDE BOTTOM is specified The widget will be placed on the top side or LAYOUT TOP default bottom side of the space remaining in the container LAYOUT BOTTOM All For a child of FXPacker etc these options will only have effect if either LAYOUT SIDE RIGHT or LAYOUT SIDE LEFT is specified The widget will be centered in the X direction or Y direction in the parent Extra spacing will be LAYOUT CENTER X All added around the widget to place it at the center of LAYOUT_CENTER_Y the space available to it The size of the widget will be its default size unless LAYOUT FIX WIDTH or LAYOUT FIX HEIGHT have been specified APPENDIX C LAYOUT HINTS Layout hint Used in Effect LAYOUT_FILL_X LAYOUT FILL Y All Either none one or both of these hints may be specified LAYOUT FILL X will cause the parent layout manager to stretch or shrink the widget to accommodate the available space If more than one child with this option is placed side by side the available space will be subdivided proportionally to their default size LAYOUT FILL Y has the identical effect on the vertical direction LAYOUT FIX X LAYOUT FIX Y All Either none one or both of these hints may be specified The LAYOUT_FIX_X hint will cause the parent layout manager to place this widget at the indicated X position as passed on the
20. Ll gt gt gt len p vertices i gt gt gt gt 7 2 3 5 14 0 gt gt gt Figure 13 3 The command line interface The Abaqus GUI Toolkit does not expect users to use the CLI to issue Abaqus Scripting Interface commands Normally all commands sent from the GUI process are sent by the GUI via modes For more information see Chapter 7 Modes You can hide the CLI if it is not used by your application as shown in the following statements mainWindow getAFXApp getAFXMainWindow mainWindow hideC1i 13 6 THE Abaqus CAE MAIN WINDOW 14 Customizing the main window The main window base class provides the GUI infrastructure to allow user interaction the manipulation of modules and the display of objects in the viewport The main window base class does not provide any application functionality for example building parts This section describes how you assign functionality to the application by deriving from the main window base class and then registering modules and toolsets The following topics are covered Modules and toolsets Section 14 1 The Abaqus CAE main window Section 14 2 14 1 Modules and toolsets Modules are one of the fundamental concepts of an interactive Abaqus application A module serves to group functionality into logical units for example a unit that creates parts or a unit that meshes the assembly An interactive Abaqus application presents only one module at a time to
21. PROCEDURE MODES if not self plateHeightDB self plateHeightDB PlateHeightDB self self step3 AFXDialogStep self self plateHeightDB return self step3 else return None 7 4 5 getLoopStep If you want your procedure to loop you must write the getLoopStep method The getLoopStep method is defined in the base class to return None indicating that the mode will be run through a single time You can redefine the getLoopStep method and return a step to which the procedure should loop back The following example shows how you can make the procedure shown in the previous section loop back to the first step after it has completed the last step def getLoopStep self return self stepl 7 4 6 AFXDialogStep The AFXDialogStep class allows you to post a dialog box during a procedure To create a dialog step you must supply the procedure a dialog box and optionally a prompt for the prompt line If you do not supply a prompt Abaqus uses a default prompt of Fill out the dialog box title dialog The following is an example of a dialog step in a single step procedure def getFirstStep self db PlateDB self prompt Enter plate dimensions in the dialog box return AFXDialogStep self db prompt In most cases a procedure will have more than one step Since a procedure has the ability to back up to previous steps you must write procedures that do not construct dialog boxes more than once during the procedure You can prevent a pro
22. Sorting Section 3 6 13 3 6 1 Table constructor The AFXTab1e constructor is defined by the following prototype AFXTable p numVisRows numVisColumns numRows numColumns tgt None sel 0 opts AFXTABLE NORMAL x 0 0 w 0 h 0 i pl DEFAULT MARGIN pr DEFAULT MARGIN pt DEFAULT MARGIN pb DEFAULT MARGIN The 1 constructor has the following arguments 3 18 TABLE WIDGET parent The first argument in the constructor is the parent An AFXTab1le does not draw frame around itself therefore you may want to create an FXVerticalFrame to use as the parent of the table You should zero out the padding in the frame so that the frame wraps tightly around the table number of visible rows and columns The number of rows and columns that will be visible when the table is first displayed If the number of visible rows or columns is less than the total number of rows or columns in the table the appropriate scroll bars are displayed number of rows and columns The number of rows and columns to be created when the table is created These numbers include leading rows and columns If the size of the table is fixed you specify the total number of rows and columns If the size of the table is dynamic you specify 1 row and 1 column plus any leading rows or columns and allow the user to add rows or columns as necessary target and selector You can specify a target and selector in the table constructor arguments
23. To create an FXColor you use the FXRGB function and pass in the appropriate values for red green and blue The following table shows a list of valid color strings and the corresponding RGB values String RGB value AliceBlue FXRGB 240 248 255 AntiqueWhite FXRGB 250 235 215 AntiqueWhitel FXRGB 255 239 219 AntiqueWhite2 FXRGB 238 223 204 AntiqueWhite3 FXRGB 205 192 176 AntiqueWhite4 FXRGB 139 131 120 Aquamarine FXRGB 127 255 212 Aquamarinelq FXRGB 127 255 212 Aquamarine2 FXRGB 118 238 198 Aquamarine3 FXRGB 102 205 170 Aquamarine4 FXRGB 69 139 116 Azure FXRGB 240 255 255 Azurel FXRGB 240 255 255 Azure2 FXRGB 224 238 238 Azure3 FXRGB 193 205 205 Azure4 FXRGB 131 139 139 Beige FXRGB 245 245 220 Bisque FXRGB 255 228 196 Bisquel FXRGB 255 228 196 Bisque2 FXRGB 238 213 183 Bisque3 FXRGB 205 183 158 Bisque4 FXRGB 139 125 107 Black FXRGB 0 0 0 APPENDIX B COLORS AND RGB VALUES String RGB value BlanchedAlmond FXRGB 255 235 205 Blue FXRGB 0 0 255 Bluel FXRGB 0 0 255 Blue2 FXRGB 0 0 238 Blue3 FXRGB 0 0 205 Blue4 FXRGB 0 0 139 BlueViolet FXRGB 138 43 226 Brown FXRGB 165 42 42 Brownl FXRGB 255 64 64 Brown2 FXRGB 238 59 59 Brown3 FXRGB 205 51 51 Brown4 FXRGB 139 35 35 Burlywood FXRGB 222 184 135 Burlywoodl FXRGB 255 211 155 Burlywood2 FXRGB 238 197 145 Burlywood3 FXRGB 205 170 125 Burlywood4 FXRGB 139 115 85 CadetBlue FXRGB 95 158 160 CadetBluel FXRGB
24. e Constructors Section 5 5 2 e Sizing and location Section 5 5 3 e Action area Section 5 5 4 e Custom action area button names Section 5 5 5 e Action button handling Section 5 5 6 CUSTOM DIALOG BOXES 5 5 1 An overview of custom dialog boxes AFXDialog is the base class for the other dialog box classes in the toolkit If none of the other dialog box classes suit your needs you must derive your dialog box from AFXDialog and provide most of the dialog box processing yourself The AFXDialog class extends the FXDialog class by providing the following features Button flags that allow the automatic construction of action area buttons Option flags that control the placement of the action area Option flags also determine whether to include a separator between the action area and the rest of the dialog box e Message IDs for the various action area commit semantics Methods to add action area buttons manually Automatic handling of the No Cancel and Dismiss buttons Automatic handling is also provided for the Close X button on the right hand side of the dialog box s title bar e Automatic destruction of the dialog box after it is unposted See Action area Section 5 5 4 for more details 5 5 2 Constructors There are three prototypes of the AFXDialog constructor The difference between the three prototypes is the occluding behavior of the dialog box as illustrated in the following exa
25. example session viewports Viewport 1 setValues width 50 height 100 object method arguments mdb models Model 1 PointSection name Section 3 mass 1 0 object method arguments session viewports Viewport 1 bringToFront object method LeafFromElementSets elementSets PART 1 1 E1 method arguments 6 5 GUI commands GUI commands are designed to work together with modes Modes perform the command processing and send the command to the kernel For more information see Chapter 7 Modes This section describes how to construct and use GUI commands The following topics are covered e Constructing GUI commands Section 6 5 1 GUI commands and current objects Section 6 5 2 Keeping the GUI and commands up to date Section 6 5 3 6 5 1 Targets and messages Section 6 5 4 Automatic GUI updating Section 6 5 5 Data targets Section 6 5 6 Option versus value mode Section 6 5 7 AFXKeywords Section 6 5 8 Expression evaluation Section 6 5 9 Connecting keywords to widgets Section 6 5 10 Boolean integer float and string keyword examples Section 6 5 11 Symbolic constant keyword examples Section 6 5 12 Tuple keyword examples Section 6 5 13 Table keyword example Section 6 5 14 Object key
26. the default or AFXPickStep MANY The highlight level 1 4 The sequence style AFXPickStep ARRAY the default or AFXPickStep TUPLE If the user is allowed to pick only one entity the procedure will automatically advance to the next step after the user picks an entity however the user can back up to the previous step to change the selection If the user is allowed to pick one or more entities the user must commit the selections by clicking mouse button 2 or by clicking the Done button on the prompt line The highlight level controls the color of the selected entities In some procedures different colors are used between steps to distinguish the selections 7 17 PICKING IN PROCEDURE MODES The sequence style controls how a sequence of picked objects is represented in the command string If the sequence style is AFXPickStep ARRAY the picked objects will be represented as the concatenation of slices of arrays for example v 3 4 v 5 8 where v is a vertex array You cannot use the AFXPickStep ARRAY sequence style to pick a combination of entities with multiple types because only objects of the same type can be concatenated In addition you cannot use the AFXPickStep ARRAY sequence style to pick interesting points because interesting points are constructed on the fly and are not accessible from slices of an array If the sequence style is AFXPickStep TUPLE the picked objects will be represented as a tuple of individual ob
27. the next three arguments to the AFXComboBox constructor are the width of the text field the number of visible list items when the list is exposed and the label If you specify the width as zero the combo box will automatically size itself to the widest item in its list For example 8 11 RANGE WIDGETS comboBox AFXComboBox p 0 3 AFXComboBox comboBox appendItem Item 1 comboBox appendItem Item 2 comboBox appendItem Item 3 AFX ComboBox Iten 1 Figure 3 15 An example of a combo box from AFXComboBox 3 3 3 List boxes The AFXListBox widget provides a one of many selection from its items AFXListBox differs from AFXComboBox in that the items displayed by AFXListBox can include icons For example listBox AFXListBox parent 3 AFXListBox keyword listBox appendItem Item 1 thinIcon listBox appendItem Item 2 mediumIcon listBox appendItem Item 3 thickIcon AFXListBox Item 1 M Figure 3 16 An example of a list box from AFXListBox 3 4 Range widgets This section describes the widgets in the Abaqus GUI Toolkit that allow the user to specify a value within certain bounds The following topics are covered e Sliders Section 3 4 1 e Spinners Section 3 4 2 3 4 1 Sliders The AFXSlider widget provides a handle that the user can drag to set a value using only the mouse AFXSlider extends the capability of the FXSlider widget by providing the following e An optional title 3 1
28. 0 w 0 0 The following list describes the arguments to the AFXMainWindow constructor app The application object title A String that will be shown in the title bar of the main window 13 1 THE TITLE BAR icon A 32 x 32 pixel icon used for the application on the desktop minilcon A 16 x 16 pixel used on Windows for the application in the title bar and system tray opts Flags controlling various window behavior X y w h The X Y location of the window and the width and height of the window The default value of zero indicates that the system should calculate these numbers automatically The main window size and location are stored in abaqus v6 12 gpr when the application exits so that when the application is started again it will appear in the same location with the same size Therefore it is recommended that you do not set x y w or h in the main window constructor however if you do those settings will override the settings in abaqus v6 12 gpr The following statement shows how you can access the main window mainWindow getAFXApp getAFXMainWindow The layout of the main window is shown in Figure 13 1 13 2 The title bar By default the string shown in the title bar is constructed from the arguments passed into the constructor as shown in the following statement AFXApp appName vendorName productName majorNumber minorNumber updateNumber prerelease where majorNumber is the vers
29. 1 Error dialog boxes You post error dialog boxes in response to a failure condition that the application cannot resolve Error dialog boxes have the following characteristics The application name is displayed in their title bar An error symbol is displayed on the left side of the dialog box The action area contains only a Dismiss button They are modal For example mainWindow getAFXApp getAFXMainWindow showAFXErrorDialog mainWindow An invalid value was supplied Abaqus CAE x invalid value was supplied Figure 5 1 An example of an error dialog box from showAFXErrorDialog MESSAGE DIALOG BOXES 5 4 2 Warning dialog boxes You post warning dialog boxes in response to a condition that the application needs user assistance to resolve Warning dialog boxes have the following characteristics The application name is displayed in their title bar warning symbol is displayed on the left side of the dialog box e The action area may contain Yes No and Cancel buttons e They are modal To find out which button in the warning dialog box was pressed by the user you must pass the warning dialog box a target and a selector and you must create a message map entry in the form to handle that message In your message handler you can query the warning dialog box using the getPressedButtonId method The following examples illustrate how to create a warning dialog box You must define an
30. 2 Procedure constructor You begin writing a procedure mode by deriving a new class from AFXProcedure In the body of the AFXProcedure constructor you must call the base class constructor and pass in the owner which is the module or toolset GUI to which this procedure belongs Optionally you can pass in a value for the type of procedure The default value for the type is NORMAL The type defines what happens when a new procedure is activated while another procedure is currently executing The type of a procedure can be either NORMAL or SUBPROCEDURE When a normal procedure is activated it cancels any procedure that is currently executing When a subprocedure is activated it suspends a normal procedure or cancels another subprocedure If a procedure is suspended it resumes upon the completion of the subprocedure View procedures for example pan rotate and zoom are special types of procedures that cannot be suspended View procedures are always cancelled when another procedure is activated and they always suspend any currently executing procedure when they are activated By default procedures are identified by the infrastructure using their class name If you need to have multiple instances of a procedure executing at the same time you will need to distinguish their names to the infrastructure by calling the setModeName method After you have derived a new class from AFXProcedure you define the commands and keywords needed for the mode The
31. 4 1 a pointer to the procedure is passed into the dialog box constructor The dialog box will use this pointer to access the mode s keywords If you want the same default values to appear every time you post the dialog box you must call the setKeywordValuesToDefaults method before returning the dialog box as shown in Procedure example Section 7 4 1 7 4 4 getNextStep If your mode contains more than one step you must write the getNextStep method in addition to the getFirstStep method The previous step is passed into the getNext Step method so that you can determine where the user is in the sequence of steps and act accordingly The getNextStep method should return the next step in the sequence or it should return None to indicate that it has finished collecting input from the user The following example which is a modified version of the example in Procedure example Section 7 4 1 illustrates how inputs are collected from the user in a series of three steps rather than just one def getFirstStep self self cmd setKeywordValuesToDefaults self plateWidthDB None self plateHeightDB None db PlateNameDB self self stepl AFXDialogStep self db return self stepl def getNextStep self previousStep if previousStep self stepl if not self plateWidthDB self plateWidthDB PlateWidthDB self self step2 AFXDialogStep self self plateWidthDB return self step2 elif previousStep self step2 7 14
32. 6707 8 simulia kr info 3ds com Puerto Madero Buenos Aires Tel 54 11 4312 8700 Horacio Burbridge 3ds com Stockholm Sweden Tel 46 8 68430450 simulia nordic info 3ds com Warrington Tel 44 1925 830900 simulia uk info 3ds com Authorized Support Centers SMARTtech Sudamerica SRL Buenos Aires Tel 54 11 4717 2717 KB Engineering Buenos Aires Tel 54 11 4326 7542 Solaer Ingenieria Buenos Aires Tel 54 221 489 1738 SMARTtech Mec nica Sao Paulo SP Tel 55 11 3168 3388 Synerma o Ps ry Prague West Tel 420 603 145 769 abaqus synerma cz 3 Dimensional Data Systems Crete Tel 30 2821040012 support 3dds gr ADCOM Givataim Tel 972 3 7325311 shmulik keidar adcomsim co il WorleyParsons Services Sdn Bhd Kuala Lumpur Tel 603 2039 9000 abaqus my worleyparsons com Kimeca NET SA de CV Mexico Tel 52 55 2459 2635 Matrix Applied Computing Ltd Auckland Tel 64 9 623 1223 abaqus tech matrix co nz BudSoft Sp z o o Poznan Tel 48 61 8508 466 info budsoft com pl TESIS Ltd Moscow Tel 7 495 612 44 22 info tesis com ru WorleyParsons Pte Ltd Singapore Tel 65 6735 8444 abaqus sg worleyparsons com Finite Element Analysis Services Pty Ltd Parklands Tel 27 21 556 6462 feas feas co za Principia Ingenieros Consultores S A Madrid Tel 34 91 209 1482 simulia principia es Taiwan Simutech Solution Corporation Taipei R O C Tel 886 2 2507 9550 camilla simutech com tw Thailand WorleyP
33. FXRGB 176 224 230 FXRGB 160 32 240 FXRGB 155 48 255 FXRGB 145 44 238 FXRGB 125 38 205 FXRGB 85 26 139 FXRGB 255 0 0 FXRGB 255 0 0 FXRGB 238 0 0 FXRGB 205 0 0 20 APPENDIX B COLORS AND RGB VALUES String RGB value Red4 FXRGB 139 0 0 RosyBrown FXRGB 188 143 143 RosyBrown1 FXRGB 255 193 193 RosyBrown2 FXRGB 238 180 180 RosyBrown3 FXRGB 205 155 155 RosyBrown4 FXRGB 139 105 105 RoyalBlue FXRGB 65 105 225 RoyalBlue1 FXRGB 72 118 255 RoyalBlue2 FXRGB 67 110 238 RoyalBlue3 FXRGB 58 95 205 RoyalBlue4 FXRGB 39 64 139 SaddleBrown FXRGB 139 69 19 Salmon FXRGB 250 128 114 Salmon1 FXRGB 255 140 105 Salmon2 FXRGB 238 130 98 Salmon3 FXRGB 205 112 84 Salmon4 FXRGB 139 76 57 SandyBrown FXRGB 244 164 96 SeaGreen FXRGB 46 139 87 SeaGreen1 FXRGB 84 255 159 SeaGreen2 FXRGB 78 238 148 SeaGreen3 FXRGB 67 205 128 SeaGreen4 FXRGB 46 139 87 Seashell FXRGB 255 245 238 Seashell1 FXRGB 255 245 238 Seashell2 FXRGB 238 229 222 Seashell3 FXRGB 205 197 191 Seashell4 FXRGB 139 134 130 21 APPENDIX B COLORS AND RGB VALUES String RGB value Sienna Siennal Sienna2 Sienna3 Sienna4 SkyBlue SkyBluel SkyBlue2 SkyBlue3 SkyBlue4 SlateBlue SlateBluel SlateBlue2 SlateBlue3 SlateBlue4 SlateGray SlateGrayl SlateGray2 SlateGray3 SlateGray4 SlateGrey Snow Snowl Snow2 Snow3 Snow4 SpringGreen SpringGreenl FXRGB 160 82 45
34. FXRGB 255 130 71 FXRGB 238 121 66 FXRGB 205 104 57 FXRGB 139 71 38 FXRGB 135 206 235 FXRGB 135 206 255 FXRGB 126 192 238 FXRGB 108 166 205 FXRGB 74 112 139 FXRGB 106 90 205 FXRGB 131 111 255 FXRGB 122 103 238 FXRGB 105 89 205 FXRGB 71 60 139 FXRGB 112 128 144 FXRGB 198 226 255 FXRGB 185 211 238 FXRGB 159 182 205 FXRGB 108 123 139 FXRGB 112 128 144 FXRGB 255 250 250 FXRGB 255 250 250 FXRGB 238 233 233 FXRGB 205 201 201 FXRGB 139 137 137 FXRGB 0 255 127 FXRGB 0 255 127 22 APPENDIX B COLORS AND RGB VALUES String RGB value SpringGreen2 FXRGB 0 238 118 SpringGreen3 FXRGB 0 205 102 SpringGreen4 FXRGB 0 139 69 SteelBlue FXRGB 70 130 180 SteelBluel FXRGB 99 184 255 SteelBlue2 FXRGB 92 172 238 SteelBlue3 FXRGB 79 148 205 SteelBlue4 FXRGB 54 100 139 Tan FXRGB 210 180 140 Tanl FXRGB 255 165 79 Tan2 FXRGB 238 154 73 Tan3 FXRGB 205 133 63 Tan4 FXRGB 139 90 43 Thistle FXRGB 216 191 216 Thistle1 FXRGB 255 225 255 Thistle2 FXRGB 238 210 238 Thistle3 FXRGB 205 181 205 Thistle4 FXRGB 139 123 139 Tomato FXRGB 255 99 71 Tomatol FXRGB 255 99 71 Tomato2 FXRGB 238 92 66 Tomato3 FXRGB 205 79 57 Tomato4 FXRGB 139 54 38 Turquoise FXRGB 64 224 208 Turquoisel FXRGB 0 245 255 Turquoise2 FXRGB 0 229 238 Turquoise3 FXRGB 0 197 205 Turquoise4 FXRGB 0 134 139 B 23 APPENDIX B COLORS AND RGB VALUES String RGB value
35. Gray75 FXRGB 191 191 191 Gray76 FXRGB 194 194 194 Gray77 FXRGB 196 196 196 Gray78 FXRGB 199 199 199 Gray79 FXRGB 201 201 201 Gray8 FXRGB 20 20 20 Gray80 FXRGB 204 204 204 Gray81 FXRGB 207 207 207 Gray82 FXRGB 209 209 209 Gray83 FXRGB 212 212 212 Gray84 FXRGB 214 214 214 Gray85 FXRGB 217 217 217 Gray86 FXRGB 219 219 219 Gray87 FXRGB 222 222 222 Gray88 FXRGB 224 224 224 Gray89 FXRGB 227 227 227 Gray9 FXRGB 23 23 23 Gray90 FXRGB 229 229 229 Gray91 FXRGB 232 232 232 Gray92 FXRGB 235 235 235 Gray93 FXRGB 237 237 237 Gray94 FXRGB 240 240 240 B 9 APPENDIX COLORS AND RGB VALUES String RGB value Gray95 Gray96 Gray97 Gray98 Gray99 Green Green Green2 Green3 Green4 Green Yellow Grey Grey0 Greyl 10 Grey100 11 Grey12 Grey 13 Grey14 Grey15 Grey 16 Grey17 Grey18 Grey19 Grey2 Grey20 Grey21 FXRGB 242 242 242 FXRGB 245 245 245 FXRGB 247 247 247 FXRGB 250 250 250 FXRGB 252 252 252 FXRGB 0 255 0 FXRGB 0 255 0 FXRGB 0 238 0 FXRGB 0 205 0 FXRGB 0 139 0 FXRGB 173 255 47 FXRGB 190 190 190 FXRGB 0 0 0 FXRGB 3 3 3 FXRGB 26 26 26 FXRGB 255 255 255 FXRGB 28 28 28 FXRGB 31 31 31 FXRGB 33 33 33 FXRGB 36 36 36 FXRGB 38 38 38 FXRGB 41 41 41 FXRGB 43 43 43 FXRGB 46 46 46 FXRGB 48 48 48 FXRGB 5 5 5 FXRGB 51 51 51 FXRGB 54 54 54 APPENDIX B COLORS AND RGB VALUES
36. Section 5 6 1 e Constructors Section 5 6 2 e Bailout Section 5 6 3 e Constructor contents Section 5 6 4 e Transitions Section 5 6 5 5 6 1 An overview of data dialog boxes A data dialog box is a dialog box in which data are collected from the user In contrast a message dialog box displays only a message and a toolbox just holds buttons AFKDataDialog is designed to be used in conjunction with a mode to gather data from the user The data are then processed in a command You should use AFXDataDialog if you need to issue a command You should also use AFXDataDialog DATA DIALOG BOXES if the dialog box belongs to a module or nonpersistent toolset so that the GUI infrastructure can properly manage the dialog box when the user switches modules The AFXDataDialog class is derived from AFXDialog and provides the following additional features A bailout mechanism e Standard action area button behavior designed to work with a form Keyword usage Transitions that define GUI state changes in the dialog box 5 6 2 Constructors There are two prototypes of the AFXDataDialog constructor The difference between the two prototypes is the occluding behavior of the dialog box as illustrated in the following examples The following statement creates a dialog box that always occludes the main window when overlapping with the main window AFXDataDialog mode title actionButtonIds 0 Opts DIALOG NORMAL x 0 0
37. and toolsets Section 10 1 The Abaqus GUI Toolkit is not designed to run outside of Abaqus CAE it must be used with Abaqus CAE in order for the infrastructure to function properly 1 2 Prerequisites for using the Abaqus GUI Toolkit To write applications using the Abaqus GUI Toolkit you need to have some experience in the following areas Python programming You should have some experience with the Python language before you write Abaqus CAE kernel scripts You should have similar experience when you program GUI applications Abaqus kernel commands The ultimate goal of the GUI is to send a command to the kernel for execution therefore you should understand how kernel commands work Object oriented programming Python is an object oriented language and writing an application generally consists of deriving your own new classes writing methods for them and manipulating their data You should understand the concepts of object oriented programming GUI design Depending on the complexity of your application it may be helpful to have some training in user interface design and usability testing This will help you create an application that is both intuitive and easy to use Abaqus offers training classes that cover Python kernel scripting and GUI design For more information contact your local sales office Training in GUI design is also available from a number of independent training organizations 1 3 Abaqus GUI Toolkit basics
38. from the doCustomChecks method to stop the command processing The application will then wait for the user to make a selection from the warning dialog box When the user clicks a button in the warning dialog box you must catch the message sent by the dialog box to your form If the user clicks Yes you should continue the command processing as shown in the following example MODE PROCESSING class MyForm AFXForm ID OVERWRITE AFXForm ID LAST def init self owner AFXForm init self owner FXMAPFUNC self SEL COMMAND self ID OVERWRITE MyForm onCmdOverwrite def doCustomChecks self import os if os path exists self fileNameKw getValue db self getCurrentDialog showAFXWarningDialog db File already exists n nOK to overwrite AFXDialog YES AFXDialog NO self self ID OVERWRITE return False return True def onCmdOverwrite self sender sel ptr if sender getPressedButtonId AFXDialog ID CLICKED YES self issueCommands writeToReplay True writeToJournal True return 1 Normally the GUI infrastructure takes care of sending commands to the kernel automatically when the mode is committed If you need to issue a command before the mode is committed you can call issueCommands yourself In other cases you may want to send a command without using the form s infrastructure You can send a command string directly to the kernel using the sendCommand cmd method For more information see Executing command
39. is covered e Chapter 1 Introduction WHAT CAN DO WITH THE Abaqus GUI Toolkit Introduction 1 1 This chapter provides an overview of the Abaqus GUI Toolkit The Abaqus GUI Toolkit is one of the Abaqus Process Automation tools that allow you to modify and extend the capabilities of the Abaqus CAE graphical user interface GUI to enable a wide range of users to generate more efficient Abaqus solutions The following topics are covered What can I do with the Abaqus GUI Toolkit Section 1 1 Prerequisites for using the Abaqus GUI Toolkit Section 1 2 Abaqus GUI Toolkit basics Section 1 3 Organization of the Abaqus GUI Toolkit User s Manual Section 1 4 What can do with the Abaqus GUI Toolkit There are many ways to customize Abaqus products User subroutines allow you to change the way Abaqus Standard and Abaqus Explicit compute analysis results Information on user subroutines can be found in the Abaqus User Subroutines Reference Manual Environment files allow you to change various default settings Information on environment files can be found in the Abaqus Analysis User s Manual Kernel scripts allow you to create new functions to perform modeling or postprocessing tasks Information on kernel scripts can be found in the Abaqus Scripting User s Manual GUI scripts allow you to create new graphical user interfaces GUI scripts are described in this manual The Abaqus GUI Toolkit prov
40. is still intact For example assume that your dialog box contains a table and the user resizes one of the columns of the table If you only destroy the dialog box when it is unposted the table column sizes will be remembered the next time the dialog box is posted To specify that a dialog box should be destroyed when unposted add the DIALOG UNPOST DESTROY flag to the dialog box constructor s opts argument 5 6 3 Bailout AFXDataDialog supports automatic bailout handling through the specification of a bit flag in the dialog box constructor If you request bailout processing and the user changes some values in the dialog box and presses Cancel the application posts a standard warning dialog box The following statement requests bailout processing AFXDataDialog init self form Create Part self OK self CANCEL DIALOG ACTIONS SEPARATOR DATADIALOG BAILOUT i ABAQUS Beam x A Save changes made in the Fatigue Analysis dialog Figure 5 6 An example of a bailout After the standard warning dialog box has been posted the behavior is as follows e Ifthe user clicks Yes from the standard warning dialog box the data dialog box will be processed as if the user had originally pressed OK e If the user clicks No from the standard warning dialog box the data dialog box will be unposted without any processing Ifthe user clicks Cancel from the standard warning dialog box the data dialog box will remain posted and no action wil
41. it will be visible in all modules and it will be applicable to all modules If you do not want your tab to be visible or applicable to all modules you can use the setApplicabilityForTreeTab and setVisibilityForTreeTab methods When the user switches to a new module the application will check to see if the current tab is visible in and applicable to the new module If the tab is not visible it will be hidden If it is not applicable the application will search for the first tab that is applicable to the new module and make that tab current For example def makeMyTab self vf getAFXApp getAFXMainWindow appendTreeTab My Tab My Tab getAFXApp getAFXMainWindow setApplicabilityForTreeTab Tab Part Property getAFXApp getAFXMainWindow setVisibilityForTreeTab Tab Part Property FXLabel vf This is my tab In this case when the user is in the Part module My Tab will be shown If the user clicks on My Tab to make it current and then switches to the Property module My Tab will remain visible and current If the user switches to the Step module My Tab will be hidden and the Model tab will become current because it has been defined as applicable to all modules except the Visualization module 10 4 The Selection toolset The Selection toolset provides a selection capability outside of any procedure In other words it allows users to select objects and then invoke a procedure instead of invoking the
42. list prevents the dialog box from becoming too tall when it is displaying a long list of items 5 4 3 Information dialog boxes You post information dialog boxes to provide an explanatory message Information dialog boxes have the following characteristics The application name is displayed in their title bar CUSTOM DIALOG BOXES An information symbol is displayed on the left side of the dialog box e The action area contains only a Dismiss button e They are modal For example mainWindow getAFXApp getAFXMainWindow showAFXInformationDialog mainWindow This is an information dialog im Mold Designer x i This is information dialog Figure 5 3 An example of an information dialog box from showAFXInformationDialog 5 4 4 Specialized message dialog boxes If you need more flexibility than the standard message dialog boxes you must derive a new dialog box from AFXDialog and provide the specialized handling For more information see Custom dialog boxes Section 5 5 5 5 Custom dialog boxes AFXDialog is the base class for the other dialog box classes in the toolkit If none of the other dialog box classes suit your needs you must derive your dialog box from AFXDialog and provide most of the dialog processing yourself This section describes how you can use AFXDialog to create custom dialog boxes The following topics are covered An overview of custom dialog boxes Section 5 5 1
43. mode must be a procedure mode Because Abaqus CAE highlights objects that the user picks any mode that requires the user to pick in the viewport must also be a procedure mode Procedure modes ensure that only one procedure at a time has control over the scene in the current viewport If two different procedures could highlight different portions of the model for different purposes the resulting display would be confusing and ambiguous 7 2 Mode processing Modes are typically activated by a button in the GUI Once a mode is activated it is responsible for gathering user input processing the input sending a command and performing any error handling associated with the mode or the commands it sends This section describes how modes are processed The following topics are covered The mode processing sequence Section 7 2 1 Activating a mode Section 7 2 2 MODE PROCESSING e Step and dialog box processing Section 7 2 3 Command processing Section 7 2 4 e Work in progress Section 7 2 5 Command error handling Section 7 2 6 7 2 1 The mode processing sequence During the input gathering process the mode allows you to perform some intermediate error checking For example if the user is supposed to enter a value between zero and one but enters a value outside this range you can flag the error before continuing to collect more input After all the inputs are collected from the user the mode verifies
44. of creating GUI commands see Form example Section 7 3 1 and Procedure example Section 7 4 1 6 5 2 GUI commands and current objects Most commands in Abaqus CAE operate on the current object for example the current viewport or the current part As a convenience modes recognize a special syntax when interpreting the object specified in a GUI command If you place s between square brackets following certain repositories the mode replaces the s with the current name You should always use this s syntax as opposed to hard coding a name so that the current name will always be used in commands The following current objects are supported Object Specification Mode Interpretation mdb models s Current model mdb models s parts s Current part mdb models s sketches s Current sketch session odbs s Current output database session viewports 5 Current viewport 6 5 3 Keeping the GUI and commands up to date If a command edits an object you should request that a query be registered on that object by specifying True for the registerQuery argument in the GUI command constructor Registering a query will cause the keywords associated with the AFXGuiCommand to be updated with the kernel values when the mode is started and any time the kernel values change For example AFXGuiCommand mode PointSection mdb models s True GUI COMMANDS In addition modes recognize session vi
45. optional arguments in the widgets constructor argument list Likewise a LAYOUT FIX Y hint will cause placement at the indicated Y position The X and Y positions are specified in the parent s coordinate system LAYOUT_FILL_ROW LAYOUT FILL COLUMN FXMatrix If LAYOUT FILL COLUMN is specified for all child widgets in a certain column of a matrix layout manager the whole column can stretch if the matrix itself is stretched horizontally Analogously if LAYOUT FILL ROW is specified for all child widgets in a certain row the whole row is stretched if the matrix layout manager is stretched vertically LAYOUT_FIX_WIDTH LAYOUT FIX HEIGHT All These options will fix the widget s width or height to the value specified on the constructor You can change the size of the widget using its setWidth and setHeight methods however the layout manager will generally observe the specified dimensions of the widget without trying to modify it unless other options override APPENDIX C LAYOUT HINTS Layout hint Used in Effect Either none one or both of these hints may be specified You will almost never LAYOUT MIN WIDTH default specify these options except perhaps for uio All code legibility If LAYOUT FIX WIDTH or LAYOUT MIN HEIGHT default LAYOUT FIX HEIGHT are not specified these options will cause the parent layout widget to use the default or minimum width and height respec
46. or a pull state push state Ina push state the widgets are collecting and sending user input to the application When a widget is in the push state it does not participate in the automatic GUI updating process Because the widget is not participating in the automatic GUI updating process the user has control over the input rather than the GUI attempting to update the widget pull state In a pull state the widgets are interrogating the application to keep up to date 6 5 6 Data targets In a typical GUI application you will want to do the following 1 Initialize the values in a dialog box 2 Post the dialog box to allow the user to make changes 3 Collect the changes from the dialog box In addition you may want the dialog box to update its state if some application state is updated while the dialog box is posted Data targets are designed to make these tasks easier for the GUI programmer This section describes how the data targets work The following sections describe how the Abaqus GUI Toolkit has extended this concept to keywords that are used to construct commands sent to the kernel A data target acts as a bidirectional intermediary between some application state and GUI widgets More than one widget can be connected to a data target but a data target acts on only one piece of application state When the user uses the GUI to change a value the application state monitored by GUI COMMANDS the data target is updated automaticall
47. or to check some interdependency between values The doCustomChecks method should return True if no errors were encountered otherwise it should return False so that further command processing will be terminated The doCustomChecks method is called by the mode during step and dialog box processing and during command processing 7 2 4 Command processing When the mode finishes collecting inputs from the user it calls a series of methods If needed you can redefine some of the methods to customize the behavior of the mode The following list describes each of the methods called by the mode verifyKeywordValues The verifyKeywordValues method calls the verify method for each keyword of each command associated with the mode and posts an error dialog box if necessary The verifyKeywordValues method returns True if no errors were encountered otherwise it returns False and terminates further command processing doCustomChecks The doCustomChecks method has an empty implementation in the base class You can redefine this method to perform any additional checking of keyword values typically to perform range checking or to check some interdependency between values The doCustomChecks method should return True if no errors were encountered otherwise it should return False so that further command processing will be terminated The doCustomChecks method is called by the mode during step and dialog box processing and during command processing The fol
48. procedure and then selecting the objects Each module defines a set of entities that can be selected in that module If you create your own module then you should set the appropriate selectable entities when your module gets activated 10 7 THE HELP TOOLSET You can use the get Toolset method of the main window to get the selection toolset and then use the setFilterTypes method of the selection toolset e setFilterTypes types defaultType Use the following flags for the types and defaultType arguments e SELECTION FILTER NONE e SELECTION FILTER ALL e SELECTION FILTER VERTEX e SELECTION FILTER EDGE e SELECTION FILTER FACE e SELECTION FILTER CELL e SELECTION FILTER DATUM SELECTION FILTER REF POINT e SELECTION FILTER NODE e SELECTION FILTER ELEMENT SELECTION FILTER FEATURE For example class MyModuleGui AFXModuleGui def activate self toolset getAFXApp getAFXMainWindow getToolset Selection toolset setFilterTypes SELECTION FILTER CELL SELECTION FILTER FACE SELECTION FILTER FACE AFXModuleGui activate self 10 5 The Help toolset The Help toolset contains special methods that allows you to add your own logo and copyright information to the Help About Abaqus dialog box Customized applications must show the standard copyright information displayed by Abaqus CAE or Abaqus Viewer In addition you can customize the copyright information at the top of the About Abaqus dialog box using the fol
49. processing def myStartupCB from myStartupDB import MyStartupDB db MyStartupDB db create db show Initialize the application object 11 2 STARTUP SCRIPT app AFXApp Abaqus CAE SIMULIA app init sys argv Construct the main window CaeMainWindow app Create the application app create Register the custom startup callback NOTE This call must be made after app create setStartupCB myStartupCB Run the application app run The first statement in the script imports all constructors including the AFXApp constructor from the abaqusGui module which contains access to the entire Abaqus GUI Toolkit The sys module is also imported since it is needed to pass arguments into the application s init method After the script imports the sys module it imports the main window constructor This startup script has been customized to include a startup callback function that will display a custom dialog MyStartupDB after the application starts The callback is defined after the import statements and before the application is initialized The next statements instantiate and initialize the application object The application object is discussed in more detail in The application object Section 12 1 The script then instantiates the main window The main window is what the user will see when the application is started The main window is discussed in more detail in Chapter 13 Th
50. squareIcon FXXPMIcon getAFXApp squareData table setItemIcon 1 0 circleIcon table setItemIcon 2 0 squareIcon table setItemIcon 3 0 circleIcon Failed Running Aborted Figure 3 29 Including icons in table cells 3 6 10 Color type If you want to display a color button in a table you must set the type to COLOR If the table is editable the user can use the color button to change the color via the color selection dialog box The color button is a flyout button that can have up to three flyout items one for a specific color one for a default color 3 27 TABLE WIDGET and one for an as is color Refer to the Color Code dialog box in Abaqus CAE to see examples of how these options may be used The options are specified using the flags in the following table Option flag Effect COLOR_INCLUDE_COLOR_ONLY Include only the color flyout item COLOR INCLUDE AS IS Include the as is flyout item COLOR_INCLUDE_DEFAULT Include the default flyout item COLOR_INCLUDE_ALL Include all of the flyout items The following example shows how you can display color buttons in a table FXVerticalFrame gb FRAME SUNKEN FRAME THICK 0 0 0 0 0 0 0 0 table AFXTable vf 4 2 4 2 None 0 AFXTABLE NORMAL AFXTABLE EDITABLE table setLeadingRows 1 table setLeadingRowLabels Name tColor table setColumnType 1 AFXTable COLOR table setColumnColorOptions 1 AFXTable COLOR INCLUDE CO
51. the flyout button the flyout popup is not displayed and the flyout button acts as a regular button A flyout button displays an icon for the current function along with a triangle in the lower right corner Figure 8 2 shows the flyout buttons created by the example Flyout Button 2 Figure 8 2 Toolbox flyout buttons 8 2 6 Registering toolsets Modules can include toolsets simply by registering them Toolsets that are registered with a module will be available when that module is the current module To register a toolset you supply a pointer to the toolset along with bit flags that specify where in the GUI the toolset has defined components The following locations are supported FLAG LOCATION IN GUI GUI IN NONE GUI IN MENUBAR GUI IN TOOL PANE GUI IN TOOLBAR GUI IN TOOLBOX Toolset has no components in standard locations Toolset has components in the menu bar Toolset has components in the Tools menu pull down pane Toolset has components in the toolbar Toolset has components in the toolbox REGISTERING A GUI MODULE The example in GUI module example Section 8 2 registers a toolset that contains elements in the main menu bar and the Tools menu If you do not specify a flag in an area in which you have created some GUI components those components will not be shown in the application 8 2 7 Kernel module initialization In general a GUI module is designed to provide an interface to a k
52. vertical frames whenever possible oid building up e e padding set the padding to zero in nested layout managers hints are described in detail in Appendix Layout hints MODAL VERSUS MODELESS Dialog boxes This section describes the dialog boxes that you can create using the Abaqus GUI Toolkit The following topics are covered An overview of dialog boxes Section 5 1 e Modal versus modeless Section 5 2 e Showing and hiding dialog boxes Section 5 3 Message dialog boxes Section 5 4 Custom dialog boxes Section 5 5 Data dialog boxes Section 5 6 Common dialog boxes Section 5 7 An overview of dialog boxes The following general types of dialog boxes are available in the Abaqus GUI Toolkit Message dialog boxes Message dialog boxes allow you to post error warning or informational messages Custom dialog boxes Custom dialog boxes allow you to build any custom interface However you must supply the infrastructure needed to make the dialog box behave as required Data dialog boxes Data dialog boxes provide support for dialog boxes in which users enter data Data dialog boxes are designed to supply user inputs to forms which automatically issue commands For more information see Form modes Section 7 3 Common dialog boxes Common dialog boxes are dialog boxes that provide standard functionality commonly found in many applications The Fil
53. 05 FXRGB 30 144 255 FXRGB 30 144 255 FXRGB 28 134 238 FXRGB 24 116 205 FXRGB 16 78 139 FXRGB 178 34 34 FXRGB 255 48 48 FXRGB 238 44 44 FXRGB 205 38 38 B 5 APPENDIX COLORS AND RGB VALUES String RGB value Firebrick4 FXRGB 139 26 26 FloralWhite FXRGB 255 250 240 ForestGreen FXRGB 34 139 34 Gainsboro FXRGB 220 220 220 Ghost White FXRGB 248 248 255 Gold FXRGB 255 215 0 Gold1 FXRGB 255 215 0 Gold2 FXRGB 238 201 0 Gold3 FXRGB 205 173 0 Gold4 FXRGB 139 117 0 Goldenrod FXRGB 218 165 32 Goldenrod1 FXRGB 255 193 37 Goldenrod2 FXRGB 238 180 34 Goldenrod3 FXRGB 205 155 29 Goldenrod4 FXRGB 139 105 20 Gray FXRGB 190 190 190 0 FXRGB 0 0 0 Grayl FXRGB 3 3 3 Gray10 FXRGB 26 26 26 Gray100 FXRGB 255 255 255 Gray11 FXRGB 28 28 28 Gray12 FXRGB 31 31 31 Gray 13 FXRGB 33 33 33 Gray14 FXRGB 36 36 36 Gray15 FXRGB 38 38 38 Gray16 FXRGB 41 41 41 Gray17 FXRGB 43 43 43 Gray18 FXRGB 46 46 46 B 6 APPENDIX B COLORS AND RGB VALUES String RGB value Gray 19 FXRGB 48 48 48 Gray2 FXRGB 5 5 5 Gray20 FXRGB 51 51 51 Gray21 FXRGB 54 54 54 Gray22 FXRGB 56 56 56 Gray23 FXRGB 59 59 59 Gray24 FXRGB 61 61 61 Gray25 FXRGB 64 64 64 Gray26 FXRGB 66 66 66 Gray27 FXRGB 69 69 69 Gray28 FXRGB 71 71 71 Gray29 FXRGB 74 74 74 Gray3 FXRGB 8 8 8 Gray30 FXRGB 77 77 77 G
54. 05 85 85 IndianRed4 FXRGB 139 58 58 Ivory FXRGB 255 255 240 Ivoryl FXRGB 255 255 240 Ivory2 FXRGB 238 238 224 Ivory3 FXRGB 205 205 193 Ivory4 FXRGB 139 139 131 Khaki FXRGB 240 230 140 Khakil FXRGB 255 246 143 Khaki2 FXRGB 238 230 133 Khaki3 FXRGB 205 198 115 Khaki4 FXRGB 139 134 78 Lavender FXRGB 230 230 250 LavenderBlush FXRGB 255 240 245 APPENDIX B COLORS AND RGB VALUES String RGB value LavenderBlush1 LavenderBlush2 LavenderBlush3 LavenderBlush4 LawnGreen LemonChiffon LemonChiffon1 LemonChiffon2 LemonChiffon3 LemonChiffon4 LightBlue LightBlue1 LightBlue2 LightBlue3 LightBlue4 LightCoral LightCyan LightCyan1 LightCyan2 LightCyan3 LightCyan4 LightGoldenrod LightGoldenrod1 LightGoldenrod2 LightGoldenrod3 LightGoldenrod4 LightGoldenrodYellow LightGray FXRGB 255 240 245 FXRGB 238 224 229 FXRGB 205 193 197 FXRGB 139 131 134 FXRGB 124 252 0 FXRGB 255 250 205 FXRGB 255 250 205 FXRGB 238 233 191 FXRGB 205 201 165 FXRGB 139 137 112 FXRGB 173 216 230 FXRGB 191 239 255 FXRGB 178 223 238 FXRGB 154 192 205 FXRGB 104 131 139 FXRGB 240 128 128 FXRGB 224 255 255 FXRGB 224 255 255 FXRGB 209 238 238 FXRGB 180 205 205 FXRGB 122 139 139 FXRGB 238 221 130 FXRGB 255 236 139 FXRGB 238 220 130 FXRGB 205 190 112 FXRGB 139 129 76 FXRGB 250 250 210 FXRGB 211 211 211 APPENDIX B COLORS AND RGB VALUES String RGB value LightGree
55. 152 245 255 CadetBlue2 FXRGB 142 229 238 CadetBlue3 FXRGB 122 197 205 CadetBlue4 FXRGB 83 134 139 Chartreuse FXRGB 127 255 0 Chartreusel FXRGB 127 255 0 Chartreuse2 FXRGB 118 238 0 Chartreuse3 FXRGB 102 205 0 Chartreuse4 FXRGB 69 139 0 Chocolate FXRGB 210 105 30 APPENDIX B COLORS AND RGB VALUES String RGB value Chocolate 1 Chocolate2 Chocolate3 Chocolate4 Coral Corall Coral2 Coral3 Coral4 CornflowerBlue Cornsilk Cornsilk1 Cornsilk2 Cornsilk3 Cornsilk4 Cyan Cyanl Cyan2 Cyan3 Cyan4 DarkBlue DarkCyan DarkGoldenrod DarkGoldenrod1 DarkGoldenrod2 DarkGoldenrod3 DarkGoldenrod4 DarkGray FXRGB 255 127 36 FXRGB 238 118 33 FXRGB 205 102 29 FXRGB 139 69 19 FXRGB 255 127 80 FXRGB 255 114 86 FXRGB 238 106 80 FXRGB 205 91 69 FXRGB 139 62 47 FXRGB 100 149 237 FXRGB 255 248 220 FXRGB 255 248 220 FXRGB 238 232 205 FXRGB 205 200 177 FXRGB 139 136 120 FXRGB 0 255 255 FXRGB 0 255 255 FXRGB 0 238 238 FXRGB 0 205 205 FXRGB 0 139 139 FXRGB 0 0 139 FXRGB 0 139 139 FXRGB 184 134 11 FXRGB 255 185 15 FXRGB 238 173 14 FXRGB 205 149 12 FXRGB 139 101 8 FXRGB 169 169 169 B 3 APPENDIX B COLORS AND RGB VALUES String RGB value DarkGreen FXRGB 0 100 0 DarkGrey FXRGB 169 169 169 DarkKhaki FXRGB 189 183 107 DarkMagenta FXRGB 139 0 139 DarkOliveGreen FXRGB 85 107 47 DarkOliveGreenl FXRGB 202 255 112 DarkOli
56. 2 TREE WIDGETS Minimum and maximum range labels The ability to display the current value above the drag handle For example slider AFXSlider p None 0 AFXSLIDER INSIDE BAR AFXSLIDER SHOW VALUE LAYOUT FILL X slider setMinLabelText Min slider setMaxLabelText Max slider setDecimalPlaces 1 slider setRange 20 80 slider setValue 50 Min Max 50 J Figure 3 17 An example of a slider from AFXSlider 3 4 2 Spinners The AFXSpinner widget combines a text field and two arrow buttons The arrows increment the integer value shown in the text field AFXSpinner extends the capability of the FXSpinner widget by providing an optional label For example spinner AFXSpinner p 4 AFXSpinner spinner setRange 20 80 spinner setValue 50 AFXSpinner 504 Figure 3 18 An example of a spinner from AFXSpinner The AFXFloatSpinner widget is similar to the AFXSpinner widget but it allows floating point values 3 5 Tree widgets This section describes the tree widgets in the Abaqus GUI Toolkit A tree widget arranges its children in a hierarchical fashion and allows the various branches to be expanded or collapsed A file browser such TREE WIDGETS as Microsoft Windows Explorer is a common example of an application that makes use of a tree widget The following topics are covered e Tree list Section 3 5 1 e Option tree list Section 3 5 2 3 5 1 Tree list The FXTreeList widget provides a tree str
57. 2 self menuPane create Status x y buttons self getCursorPosition X y Self translateCoordinatesTo self getRoot x y self menuPane popup None x y return 1 Note The AFXTab1e has its own popup menu commands that you should use in place of the approach described in this section 3 1 8 Toolbar and toolbox buttons The AFXToolButton widget displays no text in its button but the button generally has a tool tip You group the buttons created by AFXToolButton into toolbars using AFXToolbarGroups or into toolboxes using AFXToolboxGroups AFXToolbarGroups and AFXToolboxGroups provide visual grouping between buttons in the toolbar or toolbox For example Create toolbar icons group AFXToolbarGroup self AFXToolButton group tMy Module nToolbar Button icon sel Create toolbox icons group AFXToolboxGroup self AFXToolButton group tMy Module nToolbox Button icon sel LABELS AND BUTTONS 3 1 9 Flyout buttons The AFXFlyoutButton widget displays a flyout popup window The flyout popup window contains AFXFlyoutItem widgets and appears when the user presses mouse button 1 on the button and holds down mouse button 1 for a certain time span If the user simply clicks mouse button 1 quickly on the button the flyout popup window will not be displayed and the flyout button will act just like a regular button The AFXFlyoutButton widget displays the icon of the current target along with a right tria
58. 3 7 3 3 7 1 Separators The FXHorizontalSeparator widget and the FXVerticalSeparator widget provide a visual separator to allow separating elements in a GUI The Abaqus GUI Toolkit also includes a FXMenuSeparator widget that you can use to separate items in a menu pane For example FXLabel parent This is a label above an FXHorizontalSeparator FXHorizontalSeparator parent FXLabel parent This is a label below an FXHorizontalSeparator This is a label above an FXHorizontalSeparator This is a label below an FXHorizontalSeparator Figure 3 34 An example of a horizontal separator from FXHorizontalSeparator 3 34 MISCELLANEOUS WIDGETS 3 7 2 Notes and warnings The AFXNote widget provides a convenient way to display notes or warnings ina dialog box AFXNote displays either the word Note the word Warning in a bold font AFXNote also aligns messages that contain more than one line For example AFXNote parent This is an AFXNote information note n that wraps on two lines AFXNote parent This is an AFXNote warning note NOTE WARNING Note This is an SF XNote information note that wraps on two lines Warning This is an AFXNote warning note Figure 3 35 An example of a note and a warning from AFXNote 3 7 3 Progress bar The AFXProgressBar widget provides feedback during a process that takes a long time to complete For example pb AFXProgressBar parent keyword tgt LAYOUT FIX HEIGHT LAY
59. A table is generally connected to an AFXTableKeyword with a selector of 0 unless the table has columns that are not directly related to the data required by the command to be sent to the kernel If the table has columns that are not required by the kernel you can specify the dialog as the target so that the data in the table can be processed appropriately by your code You can also use the AFXColumnItems object to manage selection in particular table column automatically for more information see Table keyword example Section 6 5 14 opts The option flags that you can specify in the table constructor are shown in the following table Option flag Effect AFXTABLE NORMAL default AFXTABLE COLUMN RE SIZABLE LAYOUT FILL X LAYOUT FILL Y AFXTABLE COLUMN RESIZABLE Allows columns to be resized by the user AFXTABLE ROW RESIZABLE Allows rows to be resized by the user AFXTABLE RESIZE AFXTABLE COLUMN RESIZABLE AFXTABLE ROW RESIZABLE AFXTABLE NO COLUMN SELECT Disallows selecting the entire column when its heading is clicked 3 19 TABLE WIDGET Option flag Effect AFXTABLE NO ROW SELECT Disallows selecting the entire row when its heading is clicked AFXTABLE SINGLE SELECT Allows up to one item to be selected AFXTABLE BROWSE SELECT Enforces one single item to be selected at all times AFXTABLE ROW MODE Selecting an item in a row selects the entire row AFXTABLE EDITABLE Allows all items in the table t
60. Button 1 Button 2 C Option Option 2 Button 3 Button 4 Figure 4 6 An example of a rotating region from FXSwitcher 4 9 Tab books The FXTabBook widget uses tab items to control the display of its pages one ata time FXTabBook expects that its odd numbered children are FXTabItems and its even numbered children are some type of layout manager The layout manager contains whatever widgets are to be displayed in that page Clicking a tab item will show the layout manager and all its children associated with that tab while hiding all the other layout managers Typically a horizontal or vertical frame is used for the layout manager and its frame options are set to FRAME RAISED FRAME THICK to provide a standard border You can nest tab books to provide tabs within tabs as shown in the following example tabBookl FXTabBook self None 0 LAYOUT FILL X FXTabItem tabBookl Tab Item 1 tablFrame FXHorizontalFrame tabBookl FRAME RAISED FRAME SUNKEN FXLabel tablFrame This is the region controlled by Tab Item 1 FXTabItem tabBookl Tab Item 2 tab2Frame FXHorizontalFrame tabBook1 FRAME RAISED FRAME SUNKEN tabBook2 FXTabBook tab2Frame None 0 TABBOOK LEFTTABS LAYOUT FILL X FXTabItem tabBook2 Subtab Item 1 None TAB LEFT subTablFrame FXHorizontalFrame tabBook2 FRAME RAISED FRAME SUNKEN 4 7 gt AFXNote subTablFrame This is a note nin sub tab item 1 nthat
61. EL DATA CHANGES in certain situations for more information see Using registerQuery on kernelAccess proxy objects Section 6 8 3 Since registered queries create traffic between the kernel and GUI processes you should unregister queries when you do not need them To unregister a query use the unregisterQuery method and pass the same arguments that you used in the registerQuery method In most cases you register queries within the show method that you write for your dialog box that needs the queries Similarly you unregister queries within the hide method that you write for your dialog box If you do not unregister a query and the query fires when the dialog box is not posted the application may abort if the callback tries to modify a widget in the dialog box If the user creates deletes renames or edits a part in the following example the application will call the onPartsChanged method and update the dialog box class MyDialog AFXDataDialog def onPartsChanged self Code to update the part list in the dialog box def show self from kernelAccess import mdb mdb models Model 1 parts registerQuery self onPartsChanged AFXDataDialog show self def hide self from kernelAccess import mdb mdb models Model 1 parts unregisterQuery self onPartsChanged AFXDataDialog hide self 6 8 3 Using registerQuery On kernelAccess proxy objects It is possible to call the registerQuery method on a kernelAcces
62. Fremont CA Tel 1 510 794 5891 simulia west support 3ds com West Lafayette IN Tel 1 765 497 1373 simulia central support 3ds com Northville MI Tel 1 248 349 4669 simulia greatlakes info 3ds com Woodbury MN Tel 1 612 424 9044 simulia central support 3ds com Mayfield Heights OH Tel 1 216 378 1070 simulia erie info 3ds com Mason OH Tel 1 513 275 1430 simulia central support 3ds com Warwick RI Tel 1 401 739 3637 simulia east support 3ds com Lewisville TX Tel 1 972 221 6500 simulia south info 3ds com Richmond VIC Tel 61 3 9421 2900 simulia au support 3ds com Vienna Tel 43 1 22 707 200 simulia at info 3ds com Maarssen The Netherlands Tel 31 346 585 710 simulia benelux support 3ds com Toronto ON Tel 1 416 402 2219 simulia greatlakes info 3ds com Beijing P R China Tel 8610 6536 2288 simulia cn support 3ds com Shanghai P R China Tel 8621 3856 8000 simulia cn support 3ds com Espoo Tel 358 40 902 2973 simulia nordic info 3ds com Velizy Villacoublay Cedex Tel 33 1 61 62 72 72 simulia fr support 3ds com Aachen Tel 49 241 474 01 0 simulia de info 3ds com Munich Tel 49 89 543 48 77 0 simulia de info 3ds com Chennai Tamil Nadu Tel 91 44 43443000 simulia in info 3ds com Lainate MI Tel 39 02 3343061 simulia ity info 3ds com Tokyo Tel 81 3 5442 6302 simulia jp support 3ds com Osaka Tel 81 6 7730 2703 simulia jp support 3ds com Mapo Gu Seoul Tel 82 2 785
63. ID in the form class from abaqusGui import class MyForm AFXForm ID WARNING range AFXForm ID LAST AFXForm ID LAST 1 def init self owner Construct the base class AFXForm init self owner FXMAPFUNC self SEL COMMAND self ID WARNING MyForm onCmdWarning def doCustomChecks self if someCondition showAFXWarningDialog self getCurrentDialog Save changes made in the dialog AFXDialog YES AFXDialog NO MESSAGE DIALOG BOXES self self ID WARNING return False return True def onCmdWarning self sender sel ptr if sender getPressedButtonId AFXDialog ID CLICKED YES self issueCommands elif sender getPressedButtonId AFXDialog ID CLICKED NO self deactivate im Mold Designer x A Save changes made in the dialog ves No Cancel Figure 5 2 An example of a warning dialog box from showAFXWarningDialog There are two other variations of warning dialog boxes e showAFXDismissableWarningDialog e showAFXItemsWarningDialog The dialog box created by showAFXDismissableWarningDialog contains a check button that allows the user to specify whether the application should continue to post the warning dialog box each time the warning occurs You can check the state of the button by calling the getCheckButtonState method of the warning dialog The dialog box created by showAFXItemsWarningDialog contains a scrolled list of items to be displayed to the user The
64. Keyword cmd name isRequired minLength maxLength opts AFXTableKeyword cmd name isRequired minLength maxLength opts AFXObjectKeyword cmd name isRequired defaultValue The type of data supported by each keyword is implied from the name of its constructor except for AFXObjectKeyword An object keyword is one that supports specifying a variable name as the keyword s value The prototypes for all the keywords are similar The first two arguments of a keyword are A GUI command object e A String specifying the name of the keyword All keywords also support an argument that determines whether the keyword is required or optional If a keyword is required it will always be sent with the command If a keyword is optional it will be sent only if its value changes However if the keyword is connected to a widget that is hidden then the keyword will not be sent regardless of whether it is required or optional Most keywords support the specification of a default value When you construct a keyword its value is set to the default value If you use the keyword s setDefaultValue method to change the default value you will not affect the value of the keyword unless you also call the keyword s setValueToDefault method In contrast if you want to change only the value of the keyword without changing its default value you should use the keywords setValue method When the mode issues the command to the kernel the keywords will be ord
65. LOR ONLY table setItemText 1 0 Part 1 table setItemText 2 0 Part 2 table setItemText 3 0 Part 3 table setItemColor 1 1 FF0000 table setItemColor 2 1 00 00 table setItemColor 3 1 0000FF Figure 3 30 Including icons in table cells 3 28 3 6 11 You can add a popup menu to the table by specifying the appropriate flags using the setPopupOptions method The menu will be posted when the user clicks mouse button 3 anywhere Popup menu TABLE WIDGET over the table The following options are supported in the popup menu Option flag POPUP_NONE default POPUP_CUT POPUP_COPY POPUP_PASTE POPUP_EDIT POPUP_INSERT ROW POPUP_INSERT COLUMN POPUP_DELETE_ROW POPUP_DELETE_COLUMN POPUP_CLEAR_CONTENTS POPUP_MODIFY POPUP READ FROM FILE POPUP WRITE TO FILE POPUP ALL Effect No popup menu will be displayed Adds a Cut button to the popup menu Adds a Copy button to the popup menu Adds a Paste button to the popup menu POPUP CUT POPUP COPY POPUP PASTE Adds Insert Row Before After buttons to the popup menu Adds Insert Column Before After buttons to the popup menu Adds Delete Rows button to the popup menu Adds Delete Columns button to the popup menu Adds Clear Contents Table buttons to the popup menu POPUP INSERT ROW _ INSERT COLUMN POPUP DELETE ROW POPUP DELETE COLUMN POPUP CLEAR CONTENTS Adds Read from File button to the popup menu Note Include PO
66. MIZING A TOOLSET always open a new browser window No exceptions are thrown but you can check the return status of these methods for success 10 6 An example of customizing a toolset To modify an existing toolset you start by deriving a new class from it To modify widgets in the toolset you need to be able to access them The following functions in the Abaqus GUI Toolkit allow you to access a widget e getWidgetFromText widget text The getWidgetFromText function returns widget whose label or tip text matches the specified text and is also a child of the specified widget For example the following statement returns the widget that matches the Save As item in the File menu saveAsWidget getWidgetFromText fileMenu Save As getSeparator widget index The getSeparator function returns the n separator of the specified widget where n is specified by the one based index For example the following statement returns the second separator in the File menu SeparatorWidget getSeparator fileMenu 2 The following example shows how you can modify the File toolset GUI Figure 10 1 shows the File menu before and after the script is executed from sessionGui import FileToolsetGui from myIcons import boltToolboxIconData from myForm import MyForm class MyFileToolsetGui FileToolsetGui def init self Construct the base class FileToolsetGui init self Remove unwanted items from the File menu
67. OUT FIX WIDTH FRAME SUNKEN FRAME THICK AFXPROGRESSBAR SCANNER 0 0 200 25 If you want to control the display of the progress bar you can use the percentage or iterator mode and call setProgress with the appropriate value from abaqusGui import class MyDB AFXDataDialog ID START AFXDataDialog ID LAST def init self form AFXDataDialog init self form My Dialog self OK self CANCEL DECOR RESIZE DIALOG ACTIONS SEPARATOR FXButton self Start Something None self self ID START FXMAPFUNC self SEL COMMAND self ID START MyDB onDoSomething self scannerDB ScannerDB self 3 35 THE CREATE METHOD def onDoSomething self sender sel ptr self scannerDB create self scannerDB showModal self getAFXApp repaint files file 1 txt file 2 txt file 3 txt file 4 txt self scannerDB setTotal len files for i in range 1 len files 1 self scannerDB setProgress i Do something with 11 1 self scannerDB hide class ScannerDB AFXDialog def init self owner AFXDialog init self owner Work in Progress 0 0 DIALOG ACTIONS NONE self scanner AFXProgressBar self None 0 LAYOUT FIX WIDTH LAYOUT FIX HEIGHT FRAME SUNKEN FRAME THICK AFXPROGRESSBAR ITERATOR 0 0 200 22 def setTotal self total self scanner setTotal total def setProgress self progress self scanner setProgress progress Note The setProgress method has no effect on a progress bar that uses
68. PUP INSERT ROW with POPUP READ FROM FILE to allow automatic expansion of the table for data files with more lines than the current table definition Adds Write to File button to the popup menu POPUP EDIT POPUP MODIFY POPUP READ You can also add a custom button to the popup menu by using the table s appendClientPopupItem method as shown in Figure 3 31 The following example shows how you can enable various popup me nu options 3 29 TABLE WIDGET Insert Row Before Insert Row After X Delete Rows Clear Contents Clear Table Read from File My Button Figure 3 31 Popup menu options vf FXVerticalFrame parent FRAME SUNKEN FRAME THICK 0 0 0 0 0 0 0 0 table AFXTable vf 4 3 4 3 None 0 AFXTABLE NORMAL AFXTABLE EDITABLE table setLeadingColumns 1 table setLeadingRows 1 table setLeadingRowLabels XNtY table showHorizontalGrid True table showVerticalGrid True table setColumnWidth 0 30 Center all columns table setColumnJustify 1 table CENTER table setPopupOptions AFXTable POPUP CUT AFXTable POPUP COPY AFXTable POPUP PASTE AFXTable POPUP INSERT ROW AFXTable POPUP DELETE ROW AFXTable POPUP CLEAR CONTENTS 3 30 TABLE WIDGET AFXTable POPUP READ FROM FILE table appendClientPopupItem My Button None self self ID MY BUTTON FXMAPFUNC self SEL COMMAND self ID MY BUTTON MyDB onCmdMyBtn 3 6 12 Colors Items in a table that display chara
69. RAME GROOVE FXRadioButton gb Wireframe FXRadioButton gb Filled FXRadioButton gb Shaded 4 4 RESIZABLE REGIONS Render Style Wireframe Filled Shaded Figure 4 3 An example of a group box with a labeled border from FXGroupBox 4 6 Row and column layout manager The FXMatrix widget arranges its children in rows and columns You can perform the layout row wise using the default value of the opts argument MATRIX BY ROWS or column wise by setting opts MATRIX BY COLUMNS If you specify opts MATRIX BY ROWS the matrix will create the specified number of rows and as many columns as are needed to accommodate all its children Conversely if you specify opts MATRIX_BY COLUMNS the matrix will create the specified number of columns and as many rows as are needed to accommodate all its children For example using the default opts MATRIX BY ROWS setting m FXMatrix parent FXButton m FXButton m FXButton m FXButton m FXButton m FXButton m 4 7 Resizable regions Button Button Button Button Button Button 2 1 2 3 4 5 6 Button 1 Button 3 Button 5 Button 2 Button 4 Button 8 Figure 4 4 An example of a matrix with two rows from FXMatrix The FXSplitter widget splits an area vertically or horizontally The user can drag the cursor on the region between the areas and resize the areas For example 4 5 ROTATING REGIONS sp FxXSplitter pare
70. Run the above example in the GUI create a part then enter the following in the command line interface CLI gt gt gt mdb models Model 1 parts changeKey Part 1 ROD You will get the following error Traceback most recent call last File path and filename of the example script line 9 in onPartsChanged mdb models Model 1 parts partNames 0 registerQuery onPartsChanged Not OK KeyError ROD The error can cause Abaqus CAE to stop responding Setting the second argument on registerQuery to False prevents the callback from being called immediately and prevents this potential error 6 8 4 Recognizing when custom kernel data change To receive notification in the GUI of changes made to custom kernel objects those kernel objects must make use of special classes provided by the customKernel module The customKernel module provides the following special classes all of which are capable of notifying the GUI when the contents of the class changes 6 25 RECEIVING NOTIFICATION OF KERNEL DATA CHANGES CommandRegister allows you to create general classes For more information see CommandRegister class Section 5 6 3 of the Abaqus Scripting User s Manual RepositorySupport allows you to create repositories below other repositories For more information see RepositorySupport Section 5 6 6 of the Abaqus Scripting User s Manual RegisteredDictionary allows you to create custom dictionaries
71. String specifying the name of the toolset The toolset name provides an identifier for the toolset 9 3 Creating toolset components You create menu toolbar and toolbox items in a toolset in the same way that you create those items in a module When you create menu toolbar and toolbox items in a module the module is used as the parent In contrast when you create a toolset component such as menu panes the toolset is used as the parent of the toolset component The toolset is used as the parent because the components need to be managed by the toolset when the toolset is swapped in and out of the GUI For more information on creating these components see Chapter 8 Creating a GUI module 9 4 Registering toolsets You can register a toolset with the main window or with a module If you register the toolset with the main window the toolset will be persistent throughout the session for example the File toolset is always available in an Abaqus CAE session In contrast if you register the toolset with a module the toolset will be swapped in and out with that module s menus and icons for example the Datum toolset is available in an Abaqus CAE session only in selected modules For more information see Registering toolsets Section 8 2 6 MODIFYING AND ACCESSING Abaqus CAE GUI MODULES AND TOOLSETS 10 Customizing an existing module or toolset The previous sections describe how you can create a new module or toolset by starting fro
72. UI module GUI module example Registering a GUI module Switching to a GUI module 9 Creating a GUI toolset 10 11 12 13 An overview of creating a GUI toolset GUI Toolset example Creating toolset components Registering toolsets Customizing an existing module or toolset Modifying and accessing Abaqus CAE GUI modules and toolsets The File toolset The Tree toolset The Selection toolset The Help toolset An example of customizing a toolset PART VI CREATING A CUSTOMIZED APPLICATION Creating an application Design overview Startup script Licensing and command line options Installation The application object The application object Common methods The main window An overview of the main window The title bar CONTENTS 8 1 8 2 8 3 8 4 9 1 9 3 9 4 10 1 10 2 10 3 10 4 10 5 10 6 11 1 11 2 11 3 11 4 12 1 12 2 13 1 13 2 CONTENTS The menu bar 13 3 Toolbars 13 4 The context bar 13 5 The module toolbox 13 6 The drawing area and canvas 13 7 The prompt area 13 8 The message area 13 9 The command line interface 13 10 14 Customizing the main window Modules and toolsets 14 1 The Abaqus CAE main window 14 2 A Icons B Colors and RGB values C Layout hints Part I Overview This part provides an overview of the Abaqus GUI Toolkit and how you use the toolkit to create a customized application This part also describes the layout of this manual The following topic
73. XModuleGui SKETCH If you specify GUI MODULE EXAMPLE AFXModuleGui ASSEMBLY your module must import the assembly kernel module because the assembly kernel module is required to initialize some assembly display options For more information see Kernel module initialization Section 8 2 7 8 2 2 Tree tabs By default the tabs in the TreeToolsetGui are not visible when the user switches into a custom module To specify that a tab should be visible or applicable to a module use the appendApplicableModuleForTreeTab and appendVisibleModuleForTreeTab methods The example in GUI module example Section 8 2 specifies that the Model tab will be applicable and visible in My Module If the user is in the Part module and switches to My Module the Results tab will be hidden and the Model tab will be made current if it was not already current 8 2 3 Menu bar items Menu bar items consist of a menu title that controls a menu pane The menu pane in turn contains menu commands Menu commands are buttons that invoke modes The example in GUI module example Section 8 2 creates a top level menu pane that contains a submenu The menu commands in the submenu specify the mode that the menu command will invoke by sending the mode an activate message For more information see Mode processing Section 7 2 Figure 8 1 shows the menus and submenus created by the example Menul Item 1 Subitem 1 Figure 8 1 Creating
74. ags to the options argument of the widget If you do not pass these flags to the options argument the toolkit will ignore the values that you specified for the width and height Layout hints are described in detail in Appendix C Layout hints 4 11 Layout examples The following examples create three buttons one at a time using the default layout hints As each button is created the figures show the effect on the space remaining in the layout cavity Example 1 The first example starts by creating a single button on the left side of the cavity The default value for the vertical position is LAYOUT so the example places the button on the left side and at the top of the available space gb FXGroupBox parent FXButton gb Button 1 opts LAYOUT SIDE LEFT BUTTON NORMAL Space available for remaining children Figure 4 8 Creating a button on the left side and at the top of the layout cavity The following statement adds a second button on the left side at the top of the available space FXButton gb Button 2 opts LAYOUT SIDE LEFT BUTTON NORMAL 4 10 LAYOUT EXAMPLES 5 Futon 7 Button 2 2 Figure 4 9 Adding second button on the left side at the top of the layout cavity The following statement adds a third button on the left side at the top of the available space FXButton gb Button 3 opts LAYOUT SIDE LEFT BUTTON NORMAL 4 aaa aa
75. alog box is posted by an AFXColorButton For more information see Color buttons Section 3 1 10 5 21 Part IV Issuing commands This part describes how a dialog box can issue commands to the Abaqus CAE kernel The following topics are covered Chapter 6 Commands Chapter 7 Modes THE KERNEL AND GUI PROCESSES 6 Commands This section describes the role of commands in the Abaqus GUI toolkit The following topics are covered e An overview of commands Section 6 1 The kernel and GUI processes Section 6 2 e Executing commands Section 6 3 e Kernel commands Section 6 4 e GUI commands Section 6 5 e AFXTargets Section 6 6 e Accessing kernel data from the GUI Section 6 7 Receiving notification of kernel data changes Section 6 8 6 1 An overview of commands In Abaqus CAE there are two types of commands kernel commands and GUI commands Kernel commands Kernel commands are used to build analyze and postprocess finite element models Kernel commands are documented in the Abaqus Scripting Reference Manual GUI commands GUI commands are used by the user interface to process input gathered from the user and to construct a kernel command string that is sent to the kernel for execution GUI commands are documented in the Abaqus GUI Toolkit Reference Manual 6 2 The kernel and GUI processes Abaqus CAE executes in two processes a kernel process
76. and a GUI process Kernel process The kernel process holds all the data and methods that Abaqus CAE uses to perform modeling operations for example creating parts and meshing the assembly The kernel process can run independently of the GUI process 6 1 THE KERNEL AND GUI PROCESSES GUI process The GUI is a convenient way for the user to specify input to Abaqus CAE A kernel command string is sent from the GUI process to the kernel process via the inter process communication IPC protocol The kernel process interprets and executes the kernel command string If the kernel command throws an exception the exception is propagated back to the GUI process where it should be caught and handled properly typically by posting an error dialog box Abaqus CAE uses an IPC protocol to achieve communication between the kernel and GUI processes For example the GUI often needs to query the kernel for a list of existing part names or for the values of a particular load that is about to be edited from a dialog box Similarly the GUI may need to be notified when some kernel value changes so that the GUI can update itself for example to post new job messages in the Job Monitor dialog box Abaqus CAE uses targets and messages and the GUI updating process built into the Abaqus GUI Toolkit to achieve communication within the GUI process For example an options dialog box may need to update when the current viewport is changed or some widgets in a dia
77. and false icons as shown in the following example FXVerticalFrame gb FRAME SUNKEN FRAME THICK 0 0 0 0 0 0 0 0 table AFXTable vf 4 2 4 2 None 0 AFXTABLE NORMAL AFXTABLE EDITABLE table setLeadingRows 1 table setLeadingRowLabels State tLayer table showHorizontalGrid True table showVerticalGrid True table setColumnType 0 table BOOL table setColumnWidth 0 50 table setColumnJustify 0 AFXTable CENTER from appIcons import lockedData unlockedData trueIcon FXXPMIcon getAFXApp lockedData falselcon FXXPMIcon getAFXApp unlockedData table setDefaultBoolIcons trueIcon falseIcon Figure 3 28 Defining your own true and false icons 3 26 TABLE WIDGET 3 6 9 Icon type If you want to display an icon in an item you must set the type of the column to be ICON and assign the icons to be shown This type of column is not editable by the user The following example shows how you can include an icon in a table cell FXVerticalFrame parent FRAME SUNKEN FRAME THICK 0 0 0 0 0 0 0 0 table AFXTable vf 4 2 4 2 None 0 AFXTABLE NORMAL AFXTABLE EDITABLE table setLeadingRows 1 table setLeadingRowLabels tStatus table showHorizontalGrid True table showVerticalGrid True table setColumnType 0 table ICON table setColumnWidth 0 30 table setColumnJustify 0 AFXTable CENTER from appIcons import circleData squareData circleIcon FXXPMIcon getAFXApp circleData
78. ange4 FXRGB 139 90 0 OrangeRed FXRGB 255 69 0 OrangeRed1 FXRGB 255 69 0 OrangeRed2 FXRGB 238 64 0 OrangeRed3 FXRGB 205 55 0 OrangeRed4 FXRGB 139 37 0 Orchid FXRGB 218 112 214 Orchid FXRGB 255 131 250 Orchid2 FXRGB 238 122 233 Orchid3 FXRGB 205 105 201 Orchid4 FXRGB 139 71 137 PaleGoldenrod FXRGB 238 232 170 PaleGreen FXRGB 152 251 152 PaleGreenl FXRGB 154 255 154 PaleGreen2 FXRGB 144 238 144 PaleGreen3 FXRGB 124 205 124 PaleGreen4 FXRGB 84 139 84 PaleTurquoise FXRGB 175 238 238 PaleTurquoisel FXRGB 187 255 255 PaleTurquoise2 FXRGB 174 238 238 PaleTurquoise3 FXRGB 150 205 205 PaleTurquoise4 FXRGB 102 139 139 PaleVioletRed FXRGB 219 112 147 PaleVioletRed1 FXRGB 255 130 171 PaleVioletRed2 FXRGB 238 121 159 PaleVioletRed3 FXRGB 205 104 137 APPENDIX B COLORS AND RGB VALUES String RGB value PaleVioletRed4 PapayaWhip PeachPuff PeachPuffl PeachPuff2 PeachPuff3 PeachPuff4 Peru Pink Pink1 Pink2 Pink3 Pink4 Plum Plum1 Plum2 Plum3 Plum4 PowderBlue Purple Purplel Purple2 Purple3 Purple4 Red Redl Red2 Red3 FXRGB 139 71 93 FXRGB 255 239 213 FXRGB 255 218 185 FXRGB 255 218 185 FXRGB 238 203 173 FXRGB 205 175 149 FXRGB 139 119 101 FXRGB 205 133 63 FXRGB 255 192 203 FXRGB 255 181 197 FXRGB 238 169 184 FXRGB 205 145 158 FXRGB 139 99 108 FXRGB 221 160 221 FXRGB 255 187 255 FXRGB 238 174 238 FXRGB 205 150 205 FXRGB 139 102 139
79. arsons Pte Ltd Singapore Tel 65 6735 8444 abaqus sg worleyparsons com Turkey A Ztech Ltd Istanbul Tel 90 216 361 8850 info a ztech com tr Complete contact information is available at http www simulia com locations locations html Preface This section lists various resources that are available for help with using Abaqus Unified FEA software Support Both technical engineering support for problems with creating a model or performing an analysis and systems support for installation licensing and hardware related problems for Abaqus are offered through a network of local support offices Regional contact information is listed in the front of each Abaqus manual and is accessible from the Locations page at www simulia com Support for SIMULIA products SIMULIA provides a knowledge database of answers and solutions to questions that we have answered as well as guidelines on how to use Abaqus SIMULIA Scenario Definition Isight and other SIMULIA products You can also submit new requests for support All support incidents are tracked If you contact us by means outside the system to discuss an existing support problem and you know the incident or support request number please mention it so that we can query the database to see what the latest action has been Many questions about Abaqus can also be answered by visiting the Products page and the Support page at www simulia com Anonymous site To facilitate data transfer w
80. baqus CAE User s Manual If you write your own kernel scripting module and functions you should be aware that you can use the journalMethodCall function to record a command in the journal file This option is preferable to using the writeToJournal argument in the sendCommand function Your command should not call journalMethodCall if the command changes the Mdb object using built in Abaqus Scripting Interface commands because these are journaled by default A command that changes the customData of the Mdb should call journalMethodCall For an example that illustrates one common use of the journalMethodCall function see journalMethodCall Section 53 11 1 of the Abaqus Scripting Reference Manual In general you should enclose the sendCommand function in a try block to catch any exceptions that might be thrown by the kernel command In order for exceptions to be caught they should be class based exceptions and not simply strings For example GUI COMMANDS from abaqusGui import sendCommand try sendCommand mdb customData myCommand Cmd 1 50 200 except ValueError x print exception was raised ValueError s x except exc type exc value sys exc info 2 print error s s exc type name exc value 6 4 Kernel commands A kernel command can consist of the following parts object method arguments keywords Commands do not always have an object or even arguments but they will always have a method For
81. be checked out Specifying abaqus cae will check out a token named cae that will give you access to all the Abaqus CAE kernel modules Specifiying abaqus viewer will check out a token called viewer that will give you access to only the visualization kernel module Therefore if your application needs to import any Abaqus module other than the Visualization module you must check out a cae token 11 4 Installation You can use a simpler syntax to start an application that has been installed at a site Installing an application involves the following steps e Add an entry to the abaqus dir SMA site abaqus app file where abaqus_dir is the name of the directory in which Abaqus is installed To determine the location of abaqus dir at your site type abaqus whereami at the operating system prompt The format of entries in the abaqus app file is applicationName cae viewer custom startupScript where applicationName is the name that the user must specify on the command line to start the application The second parameter determines the type of token that the application will check out cae or viewer startupScript is the name of the startup script without any file extension The script must reside in a directory specified in the PYTHONPATH environment variable applicationName and startupScript can be the same Edit the abaqus dir SMA site abaqus aev file You must add the directory that contains the customization script to the d
82. before you call its show method Similarly if you construct icons that are used after a widget has been created you must call the create method on those icons before using them in a widget For example if you want to change a label s icon after it has already been shown in a dialog box you must do the following 1 Construct the new icon 2 Call the new icon s ereate method 3 Pass the icon to the label using the label s setIcon method Widgets and fonts When the user starts an application it sets the default font to be used for all widgets On Windows platforms the application obtains the default font from the desktop settings On Linux platforms the default font is Helvetica The application can issue a command to change its default font After the command is issued all widgets created by the application use the new font Alternatively you can change an individual widget s font by using the setFont method that is available for many widgets You use the getAFXFont method to obtain the current font setting for a widget Possible fonts are FONT PROPORTIONAL FONT MONOSPACE 3 37 WIDGETS AND FONTS e FONT BOLD FONT ITALIC e FONT SMALL The following example shows how you can change the default font for all widgets and the font for a particular widget Get the current default font normalFont getAFXApp getNormalFont Set the font to bold for subsequently created widgets getAFXApp setNormalF
83. cancelled in the first step do not ask the user for confirmation to cancel return AFXProcedure BAILOUT OK else After the first step ask the user for confirmation before cancelling return AFXProcedure BAILOUT NOTOK By default when the context changes in Abaqus CAE all forms are cancelled for example when the user opens a new database or changes the current model If you have a form mode that you do not want to be cancelled you can overwrite the base class implementation in your form code as follows def okToCancel self return False 7 7 MODE PROCESSING 7 2 5 Work in progress If the command sent to the kernel takes more than a certain amount of time approximately one second the GUI will lock and the busy cursor will be displayed If you want to provide additional feedback about the progress of your command you can add work in progress commands to your kernel code For more information see Status commands Section 53 6 of the Abaqus Scripting Reference Manual The following statements illustrate how you can use the milestone command to provide feedback on the progress of a volume computation numObjects 4 for i in range numObjects 1 milestone Computing total volume parts i numObjects compute volume here Computing total volume 3 of 4 parts complete 2 Figure 7 2 Displaying the progress of a command 7 2 6 Command error handling If the command sent to the kernel
84. cedure from constructing dialog boxes more than once by initializing procedure members and then checking the members during getNextStep as shown in the following example def getFirstStep self self plateWidthDB None self plateHeightDB None db PlateNameDB self 7 15 PICKING IN PROCEDURE MODES self stepl AFXDialogStep self db return self stepl def getNextStep self previousStep if previousStep self stepl if not self plateWidthDB self plateWidthDB PlateWidthDB self self step2 AFXDialogStep self return self step2 elif previousStep self step2 if not self plateHeightDB self plateWidthDB self plateHeightDB PlateHeightDB self self step3 AFXDialogStep self return self step3 else return None 7 5 Picking in procedure modes self plateHeightDB This section describes picking in procedure modes The following topics are covered e AFXPickStep Section 7 5 1 e Refining what the user can select Section 7 5 2 Nonpickable entities Section 7 5 3 e Highlighting while selecting Section 7 5 4 Selection options Section 7 5 5 e Allowing the user to type in points Section 7 5 6 Picking by angle Section 7 5 7 e AFXOrderedPickStep Section 7 5 8 e Limitations while selecting Section 7 5 10 7 5 1 AFXPickStep The AFXPickStep class allows the user to pick entities in the current viewport You must create the keywords associated
85. cribed in detail in Part VIII Using plug ins of the Abaqus CAE User s Manual In contrast to create a customized application you build the application from the ground up You should write a customized application if in addition to adding functionality to Abaqus CAE you want to modify some standard features of Abaqus CAE While creating a custom application offers the most flexibility it requires more work than using the Plug in toolset However a custom application allows you to modify aspects of an application that you cannot control using the Plug in toolset Specifically a custom application allows you to do the following Remove Abaqus CAE modules or toolsets When you create a custom application you determine which modules and toolsets are loaded into the application and the order in which they appear Modify Abaqus CAE modules or toolsets If you want to add or remove functionality from an Abaqus CAE module you must derive your module from an Abaqus CAE module and then register your module instead of the Abaqus CAE module You follow a similar procedure if you want to add or remove functionality from an Abaqus CAE toolset e Change the application name and version numbers When you create a custom application you create a startup script that initializes the application object with the name of your application and its version numbers Control the startup command and license token used When you create a custom applicat
86. cters have two sets of colors the normal color and the selected color In addition each item has a background color and a text color To change these colors the table widget provides the following controls e Item text color tem background color e Selected item text color Selected item background color tem color color button The color button is described in Color buttons Section 3 1 10 You can control the text color of items that display characters using the setItemTextColor method Items that display characters include strings numbers and lists You can control the text color of these items when they are selected by using the setSelTextColor method You can control the background color of any item by using the setItemBackColor method You can control the background color of any item when it is selected by using the setSelBackColor method If you do not want the colors to change when the user selects an item you can set the colors used for items that are selected to be the same as the colors used for items that are not selected This approach is shown in the following example itemColor table getItemBackColor 1 1 table setSelBackColor itemColor itemTextColor table getItemTextColor 1 1 table setSelTextColor itemTextColor You can set colors using the color name or by specifying RGB values using the FXRGB function For a list of valid color names and their corresponding RGB values see Appendix B Colo
87. d combo appendItem Software Overlay SOFTWARE OVERLAY getId combo appendItem XOR XOR getId combo appendItem Blend BLEND getId If the keyword is connected to a radio button you should use the ID of the symbolic constant that corresponds to that radio button for the message ID Since the ID of all symbolic constants is greater than zero this tells the keyword to operate in option mode The following example illustrates how symbolic constant keywords can be used with radio buttons from abaqusConstants import Modeling Space gb FXGroupBox self Modeling Space GUI COMMANDS FRAME GROOVE LAYOUT FILL X FXRadioButton gb 3D mode dimensionalityKw THREE D getId LAYOUT SIDE LEFT FXRadioButton gb 2D Planar mode dimensionalityKw TWO D PLANAR getId LAYOUT SIDE LEFT FXRadioButton gb Axisymmetric mode dimensionalityKw AXISYMMETRIC getId LAYOUT SIDE LEFT 6 5 13 Tuple keyword examples In the case of tuple keywords a value of zero for the message ID indicates that the entire tuple will be updated For example you can use a single text field to collect X Y and Z inputs from the user In this case the comma separated string entered by the user is used to set the entire value of the tuple keyword For example if you define a tuple keyword as follows self viewVectorKw AFXTupleKeyword cmd viewVector True 3 3 you can connect the tuple keyword to a single text field as follows
88. defaults AFXDialog AFXDialog Yes Invoke the affirmative action in YES ID_CLICKED_YES response to the question posed by the dialog box AFXDialog AFXDialog No Invoke the negative action in NO ID_CLICKED NO response to the question posed by the dialog box AFXDialog AFXDialog Cancel Do not commit the values in the CANCEL ID_CLICKED_CANCEL dialog box just hide the dialog box AFXDialog AFXDialog Dismiss Hide the dialog box without taking DISMISS ID CLICKED DISMISS any other action Optionally for the AFXDataDialog a bailout may be posted if the user has changed any values since the last commit AFXDialog also supports the following options that determine the location of the action area DIALOG ACTIONS BOTTOM This option places the action area at the bottom of the dialog box and is the default option DIALOG ACTIONS RIGHT This option places the action area on the right side of the dialog box DIALOG ACTIONS NONE This option does not create an action area for example in a toolbox dialog box You can also specify whether a separator should be placed between the action area and the rest of the dialog box by including the following flag in the options DIALOG ACTIONS SEPARATOR The style in Abaqus CAE is to omit a separator if there is already delineation between the action area and the rest of the dialog box for example a frame that stretches across the entire width of the dialog box along the bott
89. dget LISTS AND COMBO BOXES This is an FXText widget Figure 3 13 example of a multi line text entry area from FXText 3 3 Lists and combo boxes This section describes the widgets in the Abaqus GUI Toolkit that allow you to choose one or more items from a list e You use a list widget when there is enough room in the GUI and when it is helpful to display all or most of the choices at the same time You use a combo box to conserve space in the GUI and when it is preferable to display only the current choice The following topics are covered e ists Section 3 3 1 e Combo boxes Section 3 3 2 e List boxes Section 3 3 3 3 3 1 Lists AFXList allows one or more selections from its items The list created by AFXList supports the following selection policies LIST SINGLESELECT The user can select zero or one items LIST BROWSESELECT One item is always selected LIST MULTIPLESELECT The user can select zero or more items 3 10 LISTS AND COMBO BOXES LIST_EXTENDEDSELECT The user can select zero or more items drag shift and control selections are allowed The AFXDialog base class has special code designed to handle double click messages from a list If the user double clicks in list the dialog box first attempts to call the Apply button message handler If the Apply button message handler is not found the dialog attempts to call the Continue button message handler If the Con
90. dialog box you connect the table keyword to a table using a selector value of zero table AFXTable vf 6 3 6 3 form dataKw 0 AFXTABLE NORMAL AFXTABLE EDITABLE If you have a table in which you are interested in the values of only a single column you can make use of the AFXColumnItems object to track selections For example if a table contains Name and Description columns you might only need the names in the selected rows for your command In that case you could use AFXColumnItems to keep a tuple keyword up to date with the names in the selected rows of the table as shown in the following code ci AFXColumnItems referenceColumn 0 tgt form tupleKw sel 0 table AFXTable self 4 2 4 2 ci 0 AFXTABLE NORMAL ROW MODE AFXTABLE EXTENDED SELECT 6 5 15 Object keyword example The AFXObjectKeyword has a variable name for its value In most cases you use an AFXObj ectKeyword in a command that is preceded by some setup commands For example p mdb models Model 1 parts Part 1 session viewports Viewport 1 setValues displayedObject p In this example in the form you would issue the first command manually and use an object keyword as part of an AFXGuiCommand to have the second command issued using as the variable name For example self cmd AFXGuiCommand self setValues session viewports s self doKw AFXObjectKeyword self cmd displayedObject True p You also u
91. e 3 1 You can use the accelerator to invoke the button by pressing the Alt key along with the C key Calculate Figure 3 1 keyboard accelerator applied to a button 3 1 2 Labels The FXLabel widget displays a read only string FXLabel can also display an optional icon FXLabel parent This is an FXLabel tThis is nthe tooltip This is an FXLabel Figure 3 2 An example of a text label from FXLabel 3 2 LABELS AND BUTTONS 3 1 3 Push buttons The FXButton widget contains a label and or an icon When the user clicks the button an immediate action is invoked FXButton parent This is an FXButton This is an FXButton Figure 3 3 An example of a button from FXButton 3 1 4 Check buttons The FXCheckButton widget provides an On Off toggling capability The button also supports a third Maybe or Some state The Maybe state is often used to represent a partial selection for example the AFXOptionTreeList widget makes use of the Maybe state You can set the Maybe state only programmatically the user cannot toggle the button to this state FXCheckButton parent This is an FXCheckButton This is an FXCheckButton Figure 3 4 An example of a check button and a label from FXCheckButton 3 1 5 Radio buttons The FXRadioButton widget provides a one of many selection from a group of buttons FXRadioButton parent This is FXRadioButton 1 FXRadioButton parent This i
92. e ID and method name Objects react to messages using message handlers All message handlers have the same prototype which contains the following e The sender of the message e The message selector e Some user data You can extract the type and ID of the message from the selector using the SELTYPE and SELID functions The following code shows how message maps message IDs and message handlers work together class MyClass BaseClass ID 1 ID 2 ID_LAST range BaseClass ID LAST BaseClass ID LAST 3 def init self GUI COMMANDS BaseClass init self FXMAPFUNC self SEL COMMAND self ID 1 MyClass onCmdPrintMsg FXMAPFUNC self SEL COMMAND self ID 2 MyClass onCmdPrintMsg FXButton self Button 1 None self self ID 1 FXButton self Button 2 None self self ID 2 def onCmdPrintMsg self sender sel ptr if SELID sel self ID 1 print Button 1 was pressed elif SELID sel self ID 2 print Button 2 was pressed return 1 The previous example starts by generating a list of IDs for use in the derived class Since a widget has a specific target the ID of a widget does not have to be globally unique it needs to be unique only within the target s class and base classes To handle this numbering automatically the convention is to define ID LAST in each class A derived class should begin its numbering using the value of ID LAST defined in its base class In addition a derived class sho
93. e Selection dialog box is a typical common dialog box These dialog boxes along with other details related to dialog box construction and behavior are described in this chapter Modal versus modeless A dialog box can be either modal or modeless 5 1 SHOWING AND HIDING DIALOG BOXES Modal A modal dialog box prevents interaction with the rest of the application until the user dismisses the dialog box Modeless A modeless dialog box allows the user to interact with other parts of the GUI while the dialog box is posted In Abaqus CAE all secondary dialog boxes except for tips should be modal dialog boxes A dialog box itself is not defined as modal or modeless the behavior is obtained from the method used to post the dialog box For dialog boxes posted by forms you can set the modal behavior by calling the form s setModal method and providing an argument of either True or False If you call setModa1 with True as its argument the form will post the next dialog box modally You can call the setModa1 method several times within one form if you need to change the modal behavior between the various dialog boxes managed by the form For dialog boxes that you post yourself you can use the showModa1 method instead of the show method described in the next section File Directory selector Section 5 7 1 includes an example that uses the showModa1 method 5 3 Showing and hiding dialog boxes Dialog boxes have show and hide m
94. e are similar methods for adding entities from geometry sets addGeometrySetSelection element sets addElementSetSelection and surfaces addSurfaceSelection When this step is executed the added entities will automatically be highlighted and the user can add or remove from that selection 7 20 7 5 10 PICKING IN PROCEDURE MODES Limitations while selecting The following limitations apply to picking procedures The following entities cannot be picked Sets Surfaces Picking more than one kind of entity at the same time is not supported for a sequence style of ARRAY for example the user cannot pick nodes and elements in the same step Picking Features or Instances cannot be combined with picking other types of entities In addition a sequence style of ARRAY is not supported There is no support for unselecting entities that belong to selected entities For example when the user selects a face Abaqus also selects all the edges belonging to the selected face The user cannot unselect one of those edges Probing is not supported These limitations may be removed in a future release of the Abaqus GUI Toolkit 7 21 Part V GUI modules and toolsets This part describes how you can create your own modules and toolsets This part also describes how you can modify an existing Abaqus CAE module or toolset The following topics are covered Chapter 8 Creating a GUI module Chapter 9 Creating GUI tools
95. e choices shown in the list or combo box do not represent numeric values you must disable expression evaluation For example Form code snippet self orderKw AFXIntKeyword cmd cmd name order isRequired False defaultValue 1 evalExpression False Dialog code snippet combo AFXComboBox self 8 3 Order form orderKw 0 combo appendItem First 1 combo appendItem Second 2 combo appendItem Third 3 The command snippet from this code will look like someCommand orderz2 6 15 GUI COMMANDS 6 5 10 Connecting keywords to widgets Keywords are used in the GUI by setting them as the targets of widgets The AFXDataDialog class takes a mode as one of its constructor arguments The dialog box uses the mode provided in the constructor to access the keywords stored in the mode In addition the dialog box uses the keywords as targets of widgets in the dialog In addition to a target a widget also has a message ID It is important that the appropriate ID be set for the keyword to operate in the proper mode value or option For more information see Data targets Section 6 5 6 In most cases a value of zero should be used for the message ID a value of zero indicates that the keyword should operate in value mode The table below summarizes the message ID usage with keywords and the following sections give examples for each type of keyword Keyword ID Description AFXIntKeyword 0 Keyword opera
96. e main window The application constructor creates all the data structures needed for that object and the app create statement creates all the GUI windows required by the application object Next the custom callback startup function is registered The app run statement displays the application including the custom startup dialog and then enters an event loop The event loop then waits for user interaction When you start your custom application you may want to use the noStartup option in the Abaqus CAE execution procedure to prevent Abaqus CAE from posting its own startup dialog For more information see Abaqus CAE execution Section 3 2 5 of the Abaqus Analysis User s Manual 11 3 INSTALLATION 11 3 Licensing and command line options The startup script described in the previous section is run by specifying the name of the script as the argument to the custom option on the command line To start your application enter one of the following abaqus cae custom startupScript abaqus viewer custom startupScript where startupScript is the name of the startup script for your application and does not include a file extension You are responsible for making sure that the script exists in a directory specified in the PYTHONPATH environment variable defined in the abaqus aev file The abaqus aev file is described in Installation Section 11 4 The first argument to the abaqus command specifies the type of license to
97. e option mode with three radio buttons in the pull state Suppose that the value of the data being monitored by the data target is 13 and the message IDs of the radio buttons are 2 13 and 58 respectively The sequence is as follows 1 During a GUI update the first radio button sendsa 2 SEL UPDATE message to the data target 2 The data target compares the message ID 2 to the value of its data 13 and sends an uncheck message back to the radio button since the values do not match 3 The second radio button then sends 13 SEL UPDATE message to the data target 4 The data target compares the values and sends a check message back to the radio button since the values do match 5 Similarly the third button receives an uncheck message from the data target since the values of the message ID and its data do not match In this way the Abaqus GUI Toolkit automatically maintains the radio button behavior only one button at a time will ever be checked 6 12 GUI COMMANDS ID1 SEL UPDATE Option 1 a ID 2 ID UNCHECK SEL COMMAND ID2 SEL UPDATE The data Option2 a a Data Target data target ID_CHECK SEL_COMMAND updates ID 13 the three radio buttons ID3 SEL UPDATE Q Option 3 ID 58 ID UNCHECK SEL COMMAND Figure 6 5 data target operating on three radio buttons in option mode and a pull state 6 5 8 AFXKeywords Keywords generate the arguments to a GUI command These keywords belo
98. eated However if you construct an icon after you call the widget s create method you must call the icon s create method before you use the icon in the widget For more information see The create method Section 3 8 The format of an XPM icon is simple and you can use any pixmap editor or even a text editor to create the icon data For more details on the XPM format visit the XPM web site The following image editing programs support the XPM format ImageMagick www imagemagick org The GIMP www gimp org You can also find references to pixmap editors in the FAQ page on the XPM web site As an alternative to using the a xCreateXPMIcon method you can define the XPM image data as a Python list of strings and create an icon using the FXXPMIcon method as shown in the following example Note For a list of valid color names and their corresponding RGB values see Appendix B Colors and RGB values To define a transparent color you must define itas None s None notjust None blueIconData 12 12 2 1 c None None n c blue e APPENDIX A ICONS blueIcon FXXPMIcon getAFXApp blueIconData Figure A 1 shows the blue square icon created by this example Figure 1 The blue square icon APPENDIX B COLORS AND RGB VALUES Appendix B Colors and RGB values When you are specifying a color some methods require a string and other methods require an FXColor
99. ection 11 2 6 8 Receiving notification of kernel data changes This section describes how the GUI can be notified when kernel objects and custom kernel objects are modified outside the GUI process The following topics are covered e Automatically registering a query on kernel objects Section 6 8 1 Manually registering a query on kernel objects Section 6 8 2 Using registerQuery on kernelAccess proxy objects Section 6 8 3 Recognizing when custom kernel data change Section 6 8 4 6 22 RECEIVING NOTIFICATION OF KERNEL DATA CHANGES 6 8 1 Automatically registering a query on kernel objects Queries provide a mechanism that allows the GUI process to be notified when data in the kernel change Keeping the GUI and commands up to date Section 6 5 3 describes how you use the registerQuery argument of the AFXGuiCommand constructor The registerQuery argument is a Boolean flag that specifies whether to register a query automatically on the object being edited by the specified kernel command If the kernel object specified in the AFXGui Command constructor changes the infrastructure updates the keywords in the GUI with the latest values As a result you do not need to register a query explicitly By default registerQuery False and the query is not automatically registered For example cmd AFXGuiCommand mode setValues mdb models s parts s True In this example if the user changes the current part the pat
100. efinition of the PYTHONPATH environment variable By convention customization scripts are located in directories underneath abaqus dir customApps You should 11 4 INSTALLATION add your directory near to the end of the PYTHONPATH definition just prior to the current directory This will ensure that you do not override any existing settings in the PYTHONPATH definition To keep the path to your application portable and generic you should use an environment variable to specify the root of the path For a standard Abaqus installation the ABA HOME environment variable refers to the same directory as abaqus dir As a result you can use the ABA HOME environment variable to specify the directory that contains your customization script for example SABA HOME customApps myApp For example to include the myApp directory shown above in the PYTHONPATH you should change the PYTHONPATH definition in abaqus aev from this PYTHONPATH ABA HOME cae Python Lib ABA HOME cae Python Obj ABA HOME cae exec lbr PYTHONPATH to this PYTHONPATH SABA HOME cae Python Lib ABA HOME cae Python Obj SABA HOME cae exec lbr ABA HOME customApps myApp SPYTHONPATH There are syntax differences between UNIX systems and Windows systems By default Abaqus uses UNIX syntax and automatically converts the UNIX syntax to Windows syntax ifthe application is run on a Windows platform However if you need to specify the drive letter of your path on a Wi
101. efore the toolkit does not initiate a GUI update process Messages are normally sent by the GUI infrastructure as the result of some interaction in the GUI However you can send a message directly to an object by calling its handle method The handle GUI COMMANDS method takes three arguments sender selector and userData The sender is generally the object that is sending the message The selector is made up of the message ID and the message type You can use the MKUINT function to create a selector for example 1 1 SEL COMMAND The user data must be None since this feature is not supported in the Abaqus GUI Toolkit 6 5 5 Automatic GUI updating GUI updating is initiated automatically by the Abaqus GUI Toolkit when there are no more events to be handled usually when the GUI is idle and waiting for some user interaction During the automatic GUI update process each widget sends a SEL_UPDATE message to its target asking to be updated In this way the GUI is constantly polling the application state to keep itself up to date For example during automatic GUI updating a check button sends an update message to its target The target checks some application state and determines whether or not the check button should be checked If the button should be checked the target sends back an ID CHECK message otherwise it sends an ID UNCHECK message Widgets in the toolkit are bidirectional that is they can be in either a push state
102. ered in the same order in which they were created in the mode When storing keywords in the mode class the convention is to name the keyword object using the same name as the keyword label plus Kw For example self rKw AFXIntKeyword self cmd r True self tKw AFXFloatKeyword self cmd t True self nameKw AFXStringKeyword cmd name True Part 1 self twistKw AFXBoolKeyword cmd twist 6 14 GUI COMMANDS AFXBoolKeyword ON OFF 0 self typeKw AFXSymConstKeyword cmd type True SHADED getId self imageSizeKw AFXTupleKeyword cmd imageSize False 1 2 AFXTUPLE TYPE FLOAT 6 5 9 Expression evaluation The AFXFloatKeyword and AFXIntKeyword both support expression evaluation This means that you can type a numeric expression into a text field connected to an AFXFloatKeyword or AFXIntKeyword and that expression will get evaluated For example you could type any of the following expressions into a text field connected to an AFXFloatKeyword 3 7 22 2 3 1415 1 5 125 55 8 The expression will get sent in the command so it will appear in the replay and journal files but once the command is processed in the kernel only the resultant value gets stored and the expression is lost Expression evaluation is always available with an AFXFloatKeyword but it is optional for AFXIntKeyword the default is to perform expression evaluation If you connect an AFXIntKeyword to an AFXList or APXComboBox and th
103. ernel module After the GUI collects input from the user it constructs a command string that is sent to the kernel for processing For the command to be recognized on the kernel side the appropriate kernel module must have been imported before the command was sent When a GUI module is loaded for the first time special method named getKernelInitializationCommand is executed This method is empty in the base class implementation and it is up to you to write a method that returns the proper command that will import the appropriate modules on the kernel side The appropriate modules include any module for which your GUI module can issue commands If more than one module is required you can separate the statements by semi colons characters To avoid name space conflicts with modules loaded by Abaqus you should use the import moduleName style for importing modules and not the from moduleName import style as shown in the example in GUI module example Section 8 2 8 2 8 Instantiating the GUI module The final step in the module GUI code is to construct the module You can construct the module by calling the module constructor at the end of the module GUI file This will construct all the objects defined in the constructor body For example MyModuleGui 8 3 Registering a GUI module To make a GUI module accessible to the GUI infrastructure you must register the module in the main window code The register command takes two a
104. es the tab that contains the Model Tree The name of the tab is Model ThemakeMaterialLibraryTab method creates the tab that contains the Material Library The name of the tab is Material Library The makeResultsTab method creates the tab that contains the Results Tree The name of the tab is Results The makeTabs method calls all of the methods listed above In addition the main window has an appendTreeTab method that creates a new tab item in the tabbed area and returns a vertical frame into which you can add your widgets If you want to simply add a tab after the Model and Results tabs you can use appendTreeTab from within your custom code However if you want to change the order of the tabs or remove one of the standard tabs you must derive your own toolset from the Tree toolset For example class MyTreeToolsetGui TreeToolsetGui def makeTabs self self makeModelTab self makeMyTab 10 6 THE SELECTION TOOLSET self makeMaterialLibraryTab self makeResultsTab def makeMyTab self vf getAFXApp getAFXMainWindow appendTreeTab Tab My Tab FXLabel vf This is my tab item The first argument to the appendTreeTab method is the text that you want to show up in the tab button The second argument is the name of the tab which is used for identification purposes in various application programming interfaces such as setCurrentTreeTab name By default when you create a tab
105. et Chapter 10 Customizing an existing module or toolset 8 GUI MODULE EXAMPLE Creating a GUI module This section describes how you can create a GUI module The following topics are covered 8 1 An overview of creating a GUI module Section 8 1 GUI module example Section 8 2 Registering a GUI module Section 8 3 Switching to a GUI module Section 8 4 An overview of creating a GUI module To create a new GUI module you must follow these steps Derive a new class from a module base class Create menus in the menu bar Create icons in the toolbar This step is optional Create icons in the toolbox This step is optional Create modes to collect input from the user and issue commands Modes include procedures and dialog boxes Create methods to handle any special behavior not handled by the module s modes This step is optional These steps are described in detail in the following sections 8 2 GUI module example This section includes the following topics Deriving a new module class Section 8 2 1 Tree tabs Section 8 2 2 Menu bar items Section 8 2 3 Toolbar items Section 8 2 4 Toolbox items Section 8 2 5 Registering toolsets Section 8 2 6 Kernel module initialization Section 8 2 7 Instantiating the GUI module Section 8 2 8 The AFXModuleGui base class provides various module infrastructure support functions For
106. etAFXApp iconData2 AFXToolButton group tTool Tip icon mode 1 AFXMode ID ACTIVATE popup getAFXApp getAFXMainWindow AFXFlyoutItem popup tFlyout Buttonl squareIcon mode 1 AFXMode ID ACTIVATE AFXFlyoutItem popup tFlyout Button 2 circleIcon mode 2 AFXMode ID ACTIVATE AFXFlyoutItem popup tFlyout Button 3 triangleIcon mode 3 AFXMode ID ACTIVATE AFXFlyoutButton group popup Register toolsets self registerToolset MyToolsetGui GUI IN MENUBAR GUI IN TOOL PANE def getKernelInitializationCommand self return import myModule Instantiate the module MyModuleGui 8 2 1 Deriving a new module class To create your own module GUI you begin by deriving a new class from the AFXModuleGui base class Alternatively if there is another module GUI class that provides most of the functionality that you want you can begin by deriving from that class and then make modifications For more information see Chapter 10 Customizing an existing module or toolset Inside the new class constructor body you must call the base class constructor and pass self as the first argument The moduleName is a string used by the GUI infrastructure to identify this module displayTypes are the flag or flags that specify the type of object that is being displayed in this module Possible values are AFXModuleGui PART AFXModuleGui ASSEMBLY AFXModuleGui ODB AFXModuleGui XY PLOT and AF
107. ethods that post or unpost the dialog box from the screen In most cases you do not need to call these methods because the mode infrastructure calls them for you However you may want to write your own show and hide methods to perform some special processing that will be executed just before your application posts or unposts the dialog box For example you can register and unregister queries inside the show and hide methods You must call the base class versions of the show and hide methods or the methods will not behave as expected For example in your dialog class code you could add the following lines def show self Do some special processing here Call base class method AFXDataDialog show self def hide self Do some special processing here MESSAGE DIALOG BOXES Call base class method AFXDataDialog hide self 5 4 Message dialog boxes The AFXMessageDialog class extends the FXMessageDialog class by enforcing certain characteristics of the dialog box for example the window title and message symbol These characteristics make message dialog boxes in Abaqus CAE consistent and easy to use This section describes the message dialog boxes that you can create with the Abaqus GUI Toolkit The following topics are covered e Error dialog boxes Section 5 4 1 e Warning dialog boxes Section 5 4 2 Information dialog boxes Section 5 4 3 e Specialized message dialog boxes Section 5 4 4 5 4
108. ew An application consists of the two fundamental pieces e Kernel code e GUI code The kernel code consists of Python modules that contain functions and classes for performing various tasks for example creating parts or postprocessing results The GUI code provides a convenient user friendly mechanism for gathering the inputs required for the kernel code Kernel coding is described in the Abaqus Scripting User s Manual and the Abaqus Scripting Command Reference Manual To develop the GUI code you begin with a startup script that launches the application from the command line The script creates an application object which interacts with the window manager and controls a main window The main window provides components such as a menu bar a toolbar and a toolbox From that core you add functionality to the application by registering modules and toolsets Modules and toolsets are a way of grouping functionality to be presented to the user For example the Part module in Abaqus CAE groups all the functions related to creating and modifying parts Abaqus CAE modules and toolsets can be included in your application and you can write your own modules and toolsets to provide custom functionality The widget library provides access to various GUI controls such as push buttons check buttons and text fields that are used to build dialog boxes These concepts are illustrated in Figure 11 1 Each of these steps is described in detail in subsequen
109. ewports s as a special repository The mode registers a query on the session automatically so that the command will be kept up to date if the user switches the current viewport The following examples illustrate the special syntax AFXGuiCommand mode setValues session viewports s True AFXGuiCommand mode bringToFront session viewports s True 6 5 4 Targets and messages The Abaqus GUI Toolkit employs a target message system to achieve communication within the GUI process The target message system is in contrast to for example Motif s callback mechanism widgets can send and receive messages from any other widget A message consists of two components e A message type e A message ID The message type indicates what kind of event occurred for example clicking a button The message ID identifies the sender of the message Most widgets in the Abaqus GUI Toolkit take arguments that specify their target and their ID Even if a widget does not take a target and ID as arguments you can set these attributes using the setTarget and setSelector methods For example FXButton parent Label tgt self sel self ID 1 groupBox FXGroupBox parent groupBox setTarget self groupBox setSelector self ID 2 Widgets are capable of sending several types of messages Two of the most common message types are SEL COMMAND and SEL UPDATE The SEL COMMAND message type generally indicates that a widget was
110. extends n over several nlines FXTabItem tabBook2 Subtab Item 2 None TAB LEFT subTab2Frame FXHorizontalFrame tabBook2 FRAME RAISED FRAME SUNKEN Figure 4 7 shows an example of nested tab books Tabbed Dialog Figure 4 7 An example of two subtab pages 4 8 LAYOUT HINTS 4 10 Layout hints The FXPacker FXTopWindow and FXGroupBox widgets accept the following layout hints in their children LAYOUT SIDE TOP Attaches a widget to the top side of the cavity LAYOUT SIDE TOP is the default layout hint LAYOUT SIDE BOTTOM Attaches a widget to the bottom side of the cavity LAYOUT SIDE LEFT Attaches a widget to the left side of the cavity LAYOUT SIDE RIGHT Attaches a widget to the right side of the cavity You should specify only one of the LAYOUT SIDE hints per child The top and bottom hints effectively reduce the height of the available space remaining to place other children The left and right hints effectively reduce the width of the available space remaining to place other children All layout managers support the following layout hints LAYOUT LEFT default and LAYOUT RIGHT The layout manager places the widget on the left or right side of the space remaining in the container LAYOUT TOP default and LAYOUT BOTTOM The layout manager places the widget on the top or bottom side of the space remaining in the container e LAYOUT CENTER X and LAYOUT CENTER The la
111. eyword self cmd width True self heightKw AFXFloatKeyword self cmd height True def getFirstDialog self self cmd setKeywordValuesToDefaults return PlateDB self 7 9 FORM MODES 7 3 2 Form constructor You begin writing a form mode by deriving a new class from AFXForm In the body of the AFXForm constructor you must call the base class constructor and pass in the owner which is the module or toolset GUI to which this form belongs You then define the commands and keywords that the mode will use The keywords are stored as members of the mode so that they can be accessed by dialog boxes If you set registerOQuery True in the AFXGuiCommand constructor the mode will query the kernel object specified by the command when it is activated and will automatically set the values of the command s keywords For more information see Keeping the GUI and commands up to date Section 6 5 3 If there is no kernel object associated with your command for example when creating a new object you can set the keyword values by specifying a default value in the constructor If you have a default object that you want to use to reestablish default values for the dialog box you can use the mode s registerDefaultsObject method to register an object whose values will be queried when the user presses the Defaults button in the dialog box For more information see Defaults objects Sect
112. f this documentation may be reproduced or distributed in any form without prior written permission of Dassault Syst mes or its subsidiary The Abaqus Software is a product of Dassault Syst mes Simulia Corp Providence RI USA Dassault Syst mes 2012 Abaqus the 3DS logo SIMULIA CATIA and Unified FEA are trademarks or registered trademarks of Dassault Systemes or its subsidiaries in the United States and or other countries Other company product and service names may be trademarks or service marks of their respective owners For additional information concerning trademarks copyrights and licenses see the Legal Notices in the Abaqus 6 12 Installation and Licensing Guide SIMULIA Worldwide Headquarters SIMULIA European Headquarters United States Australia Austria Benelux Canada China Finland France Germany India Italy Japan Korea Latin America Scandinavia United Kingdom Argentina Brazil Czech amp Slovak Republics Greece Israel Malaysia Mexico New Zealand Poland Russia Belarus amp Ukraine Singapore South Africa Spain amp Portugal Locations Rising Sun Mills 166 Valley Street Providence RI 02909 2499 Tel 1 401 276 4400 Fax 1 401 276 4408 simulia support 3ds com http www simulia com Stationsplein 8 K 6221 BT Maastricht The Netherlands Tel 31 43 7999 084 Fax 31 43 7999 306 simulia europe info 3ds com Dassault Systemes Centers of Simulation Excellence
113. ge telling it to set its value to the value of the data target s data ID SEL_UPDATE 7 G Data Target data ID_SETINTVALUE SEL_COMMAND data The data target updates the value in the text field Figure 6 4 data target with a text field widget in a pull state GUI COMMANDS 6 5 7 Option versus value mode A data target works in one of two modes value or option The examples in the previous section described the value mode You use the value mode when the actual value of some data is of interest In contrast you use the option mode when you require a selection from many items and the value is not of particular importance For data targets operating in the option mode with a widget in the push state the behavior is similar to the value mode described in the previous section When the user clicks a button the button sends an ID SEL COMMAND message to its target In turn the target responds by sending the sender a message requesting it to update the data target s data to the value of the sender s message ID For data targets operating in the option mode with a widget in the pull state the behavior is slightly different from the value mode described in the previous section During a GUI update the data target sends either a check or uncheck message back to the sender depending on whether the sender s ID matches the value of the data target s data For example Figure 6 5 illustrates a data target operating in th
114. h to the setValues method is updated to reflect the new current part As a result when the user clicks OK to commit a customized dialog box the mode issues a set Values command that modifies the current part 6 8 2 Manually registering a query on kernel objects For objects not directly related to a command such as a repository you may wish to register a query yourself You can register a query on an Abaqus CAE object using the registerQuery method This method takes a callback function as an argument When the object upon which the query is registered changes the infrastructure automatically calls the function supplied in the registerQuery method For example from abaqusGui import def onPartsChanged print The parts repository changed keys mdb models Model 1 parts keys print The new keys are keys mdb models Model 1 parts registerQuery onPartsChanged In the previous example if a part is created deleted renamed or edited the onPartsChanged method will be called The registerQuery method takes an optional second argument that determines whether or not the callback is called when the query is first registered By default this argument is True and the callback will be called when the query is first registered If you specify False as the second argument the query callback is not called when the query is first registered Delaying the query callback can prevent errors 6 23 RECEIVING NOTIFICATION OF KERN
115. he application object takes the following arguments AFXApp appName vendorName productName majorNumber minorNumber updateNumber prerelease The application and vendor names are intended to be keys into the registry The registry is a place to store settings that are persistent between sessions ofthe application for example the size and location of the application on the desktop when the application it starts The registry is currently not used by Abaqus but these keys are included as placeholders for future capabilities The registry will have various sections that allow you to group settings Some settings may apply to all products from a particular vendor and some settings may apply to only a specific product from a vendor By default Abaqus displays the product name and release numbers in the main window s title bar for more information see The title bar Section 13 2 12 2 Common methods You can access the application object using the following statement app getAFXApp The following list shows some of the most commonly used application methods getAFXMainWindow Returns a handle to the main window object getProductName Returns the product name COMMON METHODS getVersionNumbers Returns a tuple of majorNumber minorNumber updateNumber getPrerelease Returns True if this application is a prerelease beep Rings the system bell 12 2 AN OVERVIEW OF THE MAIN WINDOW 13 The main wi
116. he kernel for processing You should not overwrite this method or your mode may not perform properly doCustomTasks This method has an empty implementation in the base class You can redefine this method to perform any additional tasks required after a command is processed by the kernel After calling these methods the issueCommands method will deactivate the mode if the user pressed the OK button The issueCommands method also controls the writing of the command to the replay and journal files The GUI infrastructure always calls issueCommands with writeToReplay True and writeToJournal False If you want to change the behavior you can overwrite this method and specify different values for the arguments If you overwrite the issueCommands method you must specify both arguments and you should always call the base class method from your method or your mode may not perform properly For example def issueCommands self writeToReplay writeToJournal AFXForm issueCommands self writeToReplay True writeToJournal True In most cases you do not need to call issueCommands since the infrastructure will call it automatically however if you interrupt the normal flow of mode processing you must call issueCommands to complete the processing For example if before issuing a command you want to ask the user for permission to execute the command you can post a warning dialog box from the doCustomChecks method In this example you must return False
117. ides programming routines that allow you to create or modify components of the GUI The toolkit allows you to do the following Create a new GUI module A GUI module is a grouping of similar functionality such as the Part module in Abaqus CAE Create a new GUI toolset A GUI toolset is similar to a GUI module in that it groups similar functionality but it generally contains more specific functionality that may be used by one or more GUI modules The Datum tools in Abaqus CAE are an example of a GUI toolset Create new dialog boxes The Abaqus GUI Toolkit provides a full library of widgets from which you can construct your own dialog boxes However the Abaqus GUI Toolkit is not designed to allow you to modify existing Abaqus CAE dialog boxes Remove Abaqus CAE GUI modules and toolsets You can choose which GUI modules to include in your application and which GUI modules to leave out For example the Abaqus Viewer application does not include the modeling related GUI modules it contains only the Visualization module 1 1 Abaqus GUI Toolkit BASICS Remove some top level menus or some items in those top level menus For example you could remove the entire top level Viewport menu to prevent users from manipulating viewports or you could remove the Import and Export menu items from the File menu Perform limited changes to Abaqus CAE GUI modules and toolsets For more information see Modifying and accessing Abaqus CAE GUI modules
118. idth 0 30 Center all columns table setColumnJustify 1 AFXTable CENTER X Y Figure 3 25 Justified column headings 3 6 5 Editing TABLE WIDGET By default no items in a table are editable To make all items in a table editable you must specify AFXTABLE EDITABLE in the table constructor To change the editability of some items in a table you can use the following table methods setColumnEditable column True False setItemEditable row column True False 3 23 TABLE WIDGET 3 6 6 Types By default all items in a table are text items However the table widget also supports the other types of items shown in the following table Type Effect BOOL Item shows an icon clicking on it toggles between a true and false icon COLOR Item shows a color button FLOAT Item shows text a text field is used to edit the value ICON Item shows an icon it is not editable INT Item shows text a text field is used to edit the value LIST Item shows text a combo box is used to edit the value TEXT Item shows text a text field is used to edit the value You can change the type of a column or the type of an individual item using the following table methods setColumnType column type setItemType row column type Setting the type to FLOAT or INT does not affect data entry to the table the user may enter anything into these types of items this allows for expression evaluation However when u
119. including the second separator menubar getAFXApp getAFXMainWindow getMenubar menu getWidgetFromText menubar File getMenu 10 10 Figure 10 1 AN EXAMPLE OF CUSTOMIZING A TOOLSET File Model Viewpor im MyFile Model Viewport New a 4 Open Co Open Ctrl O Close ODB Mc Import Save Ctrl S zx Export Save As Run Script Import Macro Manager Export Custom Button Bun Script Print Ctrl P Macro Manager Exit Ctrl Q Print Ctrl P Exit Ctrl G The toolbar and the File menu before and after executing the example script getWidgetFromText menu New hide getWidgetFromText menu Save hide getWidgetFromText menu Save As hide getSeparator menu 2 hide Remove unwanted items from the toolbar toolbar self getToolbarGroup File getWidgetFromText toolbar New ModelWMnDatabase hide getWidgetFromText toolbar Save ModelWMnDatabase hide Add an item to the File menu just above Exit btn AFXMenuCommand self menu Custom Button None MyForm self AFXMode ID ACTIVATE sep getSeparator menu 6 btn 1linkBefore sep Rename the File menu fileMenu getWidgetFromText menubar fileMenu setText MyFile File Change a toolbar button icon btn getWidgetFromText toolbar Open 10 11 EXAMPLE OF CUSTOMIZING A TOOLSET icon
120. ing statements show how you can create custom action area buttons class ActionAreaDB AFXDialog def init self AFXDialog init self Action Area Example 2 0 DIALOG ACTIONS SEPARATOR FXLabel self Custom action area example dialog self appendActionButton Highlight self self ID CLICKED APPLY self appendActionButton self CANCEL DATA DIALOG BOXES im Action Area Example 2 x Custom action area example dialog Highlight Cancel Figure 5 5 An example of a custom action area 5 5 6 Action button handling AFXDialog and AFXDataDialog provide some automatic handling of the messages that are sent when a button in the action area is clicked If you want to perform some actions other than those provided by the dialog box you must catch the messages sent by the action area buttons and write your own message handler For example if you want to take an action when the user clicks the Apply button in the dialog box you must catch the ID CLICKED APPLY SEL COMMAND message and map it to a message handler in your dialog box For more information see Targets and messages Section 6 5 4 5 6 Data dialog boxes A data dialog box is a dialog box in which data are collected from the user In contrast a message dialog box displays only a message and a toolbox just holds buttons This section describes how you can create a data dialog box The following topics are covered An overview of data dialog boxes
121. ing that is time consuming in this method Generally you should perform tasks such as enabling and disabling or showing and hiding widgets For example def processUpdates self if self form kwl getValue 1 and self form kw2 getValue 2 self btnl disable else self btnl enable DATA DIALOG BOXES Part Display Options I Show dotted lines in hidden render style Sh STOWEO GES STEGER TENET Figure 5 8 An example of using transitions to control how the application stipples widgets If the tasks you need to perform are time consuming you should write your own message handler that is invoked only upon some specific user action For example if you need to scan an ODB for valid data you could make the commit button of the dialog send a message to your dialog box That message would invoke your message handler that does the scanning That way the scanning occurs only when the user commits the dialog not during every GUI update cycle For more information on message handlers see Targets and messages Section 6 5 4 5 6 7 Action area The AFXDataDialog class provides standard handling for all the buttons that can appear in the action area Table 5 2 shows the action that the application takes when each of these buttons is clicked 5 17 COMMON DIALOG BOXES Table 5 2 Action area buttons Button Action OK Send the form an ID COMMIT SEL COMMAND message and its butto
122. ing when the user cancels a procedure In addition the procedure mode clears highlighting in the current step before backing up The color of highlighted entities is controlled by the highlight level set in the AFXPickStep constructor 7 5 5 Selection options The Selection Options dialog box is automatically available in any pick step The available options in the Selection Options dialog box are automatically configured based on the types of entities that the user is picking For example if the user is picking only faces only Faces appears in the combo box in the dialog box Similarly if the user is picking a single entity the drag shape and drag scope buttons are not available As a result procedures generally do not need to set the available selection options explicitly If you need to set these options you can use the procedure s setSelectionOptions method You must set the procedure selection options prior to creating the first pick step For more information see the Abaqus GUI Toolkit Reference Manual Normally a procedure will set these options only at the start of the procedure However during the procedure the user may change the settings and the modified settings will be retained from step to step during the rest of the procedure 7 5 6 Allowing the user to type in points If you want to allow the user to type in the coordinates of a point as an alternative to picking in the viewport you can call the addPointKeyIn method and pa
123. int This mode posts the Print dialog box and issues the print command when the user clicks OK Modules and toolsets Modules and toolsets group functionality together A GUI module is a grouping of similar functionality such as the Part module in Abaqus CAE A GUI toolset is similar to a GUI module in that it groups similar functionality but it generally contains more specific functionality that may PLUG INS AND CUSTOMIZED APPLICATIONS be used by one or more GUI modules The Datum tools in Abaqus CAE are an example of a GUI toolset The application The application is responsible for high level activities such as managing the GUI process used by the application and updating the state of the widgets In addition the application is responsible for interacting with the desktop s window manager 2 3 Plug ins and customized applications There are two ways you can make use of the Abaqus GUI Toolkit through the use of the plug in architecture or by creating a custom application The Plug in toolset is layered on top of Abaqus CAE First the Abaqus CAE application is built and then the Plug in toolset searches specific directories for files that add items into the top level Plug ins menu The Plug in toolset will probably meet your needs if you intend only to add functionality to the standard Abaqus CAE application and it is sufficient to provide access to this functionality through the Plug ins menu in the main menu bar Plug ins are des
124. int dialog box Section 5 7 2 e Color selector dialog box Section 5 7 3 5 7 1 File Directory selector The File Selector dialog box is used to gather a file or directory name from the user It has the following characteristics The title bar can be set e The file filters can be set The following error checking is provided Check to see if the file exists Check for proper permissions Check to see if the selection is a file Allows read only access Accepts keywords and a target The file selection dialog box has the following prototypes AFXFileSelectorDialog form title fileNameKw readOnlyKw opts patterns patternIndexTgt AFXFileSelectorDialog parent title fileNameKw readOnlyKw opts patterns patternIndexTgt You use the first constructor when you have a form associated with the dialog box that issues a command for example the dialog box that appears when you click File Open Database You use the second constructor when the dialog box collects input from the user to be used in another dialog box For example when printing to a file from the Print dialog box the user is presented with a text field to enter a file name and a Select button The Select button posts a file selection dialog box that returns the selected file to the Print dialog box but does not issue any command You must create the fileNameKw argument using the AFXStringKeyword method Similarly you must create the readOnl
125. ion SIMULIA for virtual testing ENOVIA for global collaborative lifecycle management and 3DVIA for online 3D lifelike experiences Dassault Syst mes shares are listed on Euronext Paris 13065 DSY PA and Dassault Systemes ADRs may be traded on the US Over The Counter OTC market DASTY For more information visit www 3ds com JS DASSAULT SUuSTEMES subsidiaries in the US and or other countries Other company product and service names may be trademarks or service marks of their respective owners Dassault Systemes 2012 www 3ds com Rbaqus the 3DS logo SIMULIA CATIA Solidworks DELMIA ENOVIA 3DVIA and Unified FER are trademarks or registered trademarks of Dassault Syst mes or its
126. ion you modify the site configuration file that defines the command used to start the application You also modify the same site configuration file to specify the license token that is checked out when the application starts Part Ill Building dialog boxes This part describes the components of a dialog box and how you create the components using the Abaqus GUI Toolkit The following topics are covered Chapter 3 Widgets Chapter 4 Layout managers Chapter 5 Dialog boxes 3 1 LABELS AND BUTTONS Widgets This section describes how you can create widgets in your application There are many widgets in the Abaqus GUI Toolkit however only the most commonly used widgets are described here You should refer to the Abaqus GUI Toolkit Reference Manual for a complete listing of widget classes The following topics are covered e Labels and buttons Section 3 1 e Text widgets Section 3 2 e Lists and combo boxes Section 3 3 e Range widgets Section 3 4 Tree widgets Section 3 5 Table widget Section 3 6 e Miscellaneous widgets Section 3 7 e The create method Section 3 8 e Widgets and fonts Section 3 9 Labels and buttons This section describes the widgets in the Abaqus GUI Toolkit that use labels and buttons The following topics are covered e An overview of labels and buttons Section 3 1 1 Labels Section 3 1 2 e Push butt
127. ion 6 5 16 By default dialog boxes are posted as modeless or nonmodal You can change the behavior by calling setModal True to have a dialog box posted as modal In most cases you set the behavior only once however you can change the behavior as often as needed by calling the setModa1 method in the getFirstDialog or getNextDialog methods For more information see Modal versus modeless Section 5 2 7 3 3 getFirstDialog You must write the getFirstDialog method for your mode The getFirstDialog method should return the first dialog box of the mode In Form example Section 7 3 1 a pointer to the form is passed into the dialog box constructor The dialog box will use this pointer to access the mode s keywords If you want the same default values to appear every time you post the dialog box you must call the setKeywordValuesToDefaults method before returning the dialog box as shown in Form example Section 7 3 1 7 3 4 getNextDialog If your mode contains more than one dialog box you must write the getNextDialog method in addition to the getFirstDialog method The previous dialog box is passed into the getNextDialog method so that you can determine where the user is in the sequence of dialog boxes and act accordingly The getNextDialog method should return the next dialog box in the sequence or it should return None to indicate that it has finished collecting input from the user The following 7 10 FORM MODES example i
128. ion number minorNumber is the release number updateNumber is the update number and prerelease is the prerelease number The title is generated using the format shown in the following statement productName majorNumber minorNumber updateNumber For example the following statement AFXApp productName Abaqus CAE majorNumber 6 minorNumber 12 updateNumber 1 generates the following string in the title bar Abaqus CAE 6 12 1 13 2 THE TITLE BAR Title bar Title string Module menus Menu bar Persistent toolset menus Help Toolbar Persistent toolset tools Module tools Help Info Context bar Module control Context controls Canvas and drawing area Prompt area Message area Command line interface Figure 13 1 The main window If you do not specify the major minor and update numbers in the application constructor they default to the current Abaqus CAE release numbers Similarly if you specify release numbers but you do not specify a product name the release numbers default to the current Abaqus CAE release numbers If you set the prerelease argument in the AFXApp constructor to True the update number is preceded by PRE For example Abaqus CAE 6 12 PRE1 In addition if the user has opened a model database the title bar string contains the name of the current model database for example Abaqus CAE 6 12 1 MDB c projects cars engines t
129. ipulate viewports The drawing area is a window into the visible part of the canvas You can access the canvas area using the following statement canvas getAFXApp getAFXMainWindow i getCanvas The i_ in the method name indicates that this is an internal method that you should not normally use it is expected that only the GUI infrastructure needs to access this method 13 8 The prompt area The prompt area displays prompts to guide the user as well as work in progress WIP messages You can display messages in the prompt area during procedures For more information see Picking in procedure modes Section 7 5 13 5 THE COMMAND LINE INTERFACE 13 9 The message area The application uses the message area to display informational and warning messages You can send messages to the message area using the following method mainWindow getAFXApp getAFXMainWindow mainWindow writeToMessageArea Warning Some items failed 13 10 The command line interface The command line interface CLI provides an interface to the kernel side Python command interpreter The CLI does not provide any access to the GUI side Python interpreter The user can enter Abaqus scripting interface commands in the CLI which are then sent to the kernel for processing In addition the user can enter standard Python commands in the CLI For example the user can use the CLI as a simple calculator as shown in Figure 13 3
130. ith SIMULIA an anonymous ftp account is available at p simulia com Login as user anonymous and type your e mail address as your password Contact support before placing files on the site Training All offices and representatives offer regularly scheduled public training classes The courses are offered in a traditional classroom form and via the Web We also provide training seminars at customer sites All training classes and seminars include workshops to provide as much practical experience with Abaqus as possible For a schedule and descriptions of available classes see www simulia com or call your local office or representative Feedback We welcome any suggestions for improvements to Abaqus software the support program or documentation We will ensure that any enhancement requests you make are considered for future releases If you wish to make a suggestion about the service or products refer to www simulia com Complaints should be made by contacting your local office or through www simulia com by visiting the Quality Assurance section of the Support page Contents PARTI OVERVIEW Introduction What can I do with the Abaqus GUI Toolkit Prerequisites for using the Abaqus GUI Toolkit Abaqus GUI Toolkit basics Organization of the Abaqus GUI Toolkit User s Manual PART GETTING STARTED 2 Getting started with the Abaqus GUI Toolkit The kernel and GUI What are the components of an Abaqus GUI application Plug in
131. jects for example v 3 v 5 v 6 v 7 The style you choose depends on the format accepted by the command that you intend to issue Some commands in Abaqus CAE accept both styles but some accept only or the other For further details on the arguments to the AFXKPickStep constructor see the Abaqus GUI Toolkit Reference Manual 7 5 2 Refining what the user can select A refinement qualifies the types of pickable entities specified in the AFXPickStep constructor The following example shows how to select only straight edges step AFXPickStep self self edgeKw Select a straight edge AFXPickStep EDGES step setEdgeRefinements AFXPickStep STRAIGHT By default no refinements are set For a complete list of refinements see the Abaqus GUI Toolkit Reference Manual 7 5 3 Nonpickable entities By default the procedure mode prevents previously selected geometric entities from being selected twice in the same procedure If you do not want this behavior you can call the allowRepeatedSelections method The following example shows how to allow repeated selections step AFXPickStep self self edgeKw Select a straight edge AFXPickStep EDGES step allowRepeatedSelections True Disallowing repeated picks works only for geometry items such as vertices edges and faces it does not work for nodes and elements 7 18 PICKING IN PROCEDURE MODES 7 5 4 Highlighting while selecting The procedure mode clears all highlight
132. keywords are stored as members of the mode so that they can be accessed by steps If you set registerQuery True in the AFXGuiCommand constructor the mode will query the kernel object specified by the command when it is activated and automatically set the values of the command s keywords For more information see Keeping the GUI and commands up to date Section 6 5 3 If there is no kernel object associated with your command for example when creating a new object you can set the keyword values by specifying a default value in their constructor If you have a default object that you want to use to reestablish default values for a dialog box you can use mode s registerDefaultsObject method to register an object whose values will be queried when the user presses the Defaults button in the dialog box For more information see Defaults objects Section 6 5 16 By default dialog boxes are posted as modeless You can post a dialog box as modal by calling self setModal True In most cases you set the modality only once in the mode however you can change the modality as often as needed by calling the setModa1 method in the getFirstDialog or getNextDialog methods For more information see Modal versus modeless Section 5 2 7 13 PROCEDURE MODES 7 4 3 getFirstStep You must always write the getFirstStep method for your mode The getFirstStep method should return the first step of the mode In Procedure example Section 7
133. l be taken DATA DIALOG BOXES 5 6 4 Constructor contents You use the constructor of the dialog box to create the widgets that will appear in the dialog box To keep the GUI up to date with the application state and vice versa you use keywords as targets of widgets Keywords are defined as members of a form and the form is passed to the dialog box as a dialog box constructor argument For more information see AF XKeywords Section 6 5 8 The following script shows how you can use keywords to construct a dialog box Figure 5 7 shows the Graphics Options dialog box generated by the example script class GraphicsOptionsDB AFXDataDialog def init self form AFXDataDialog init self form Graphics Options self OK self APPLY self DEFAULTS self CANCEL Hardware frame gb FXGroupBox self Hardware FRAME GROOVE LAYOUT FILL X hardwareFrame FXHorizontalFrame gb 0 0 0 0 0 0 0 0 0 FXLabel hardwareFrame Driver FXRadioButton hardwareFrame OpenGL form graphicsDriverKw OPEN GL getId FXRadioButton hardwareFrame X11 form graphicsDriverKw X11 getId FXCheckButton gb Use double buffering form doubleBuf feringKw displayListBtn FXCheckButton gb Use display lists form displayListsKw View Manipulation frame gb FXGroupBox self View Manipulation FRAME GROOVE LAYOUT FILL X FXHorizontalFrame gb 0 0 0 0 0 0 0 0 0 FXLabel hf Drag mode FXRadioB
134. lines between items TREELIST SHOWS BOXES Show boxes when item can expand TREELIST ROOT BOXES Show root item boxes also The following statements show an example of creating a tree vf FXVerticalFrame gb FRAME SUNKEN FRAME THICK 0 0 0 0 0 0 0 0 tree FXTreeList vf 5 None 0 LAYOUT FILL X LAYOUT FILL Y TREELIST SHOWS BOXES TREELIST ROOT BOXES TREELIST SHOWS LINES TREELIST BROWSESELECT You add an item to a tree by supplying a parent and a text label You begin by adding root items to the tree Root items have a parent of None The Abaqus GUI Toolkit provides several ways of adding items to a tree however the most convenient approach uses the addItemLast method as shown in the following example vf FXVerticalFrame gb FRAME SUNKEN FRAME THICK 0 0 0 0 0 0 0 0 self tree FXTreeList vf 5 None 0 LAYOUT FILL X LAYOUT FILL Y TREELIST SHOWS BOXES TREELIST ROOT BOXES TREELIST SHOWS LINES TREELIST BROWSESELECT optionl self tree addItemLast None Option 1 self tree addItemLast optionl Option 1 self tree addItemLast optionl Option 1b option2 self tree addItemLast None Option 2 self tree addItemLast option2 Option 2a option2b self tree addItemLast option2 Option 2b self tree addItemLast option2b Option 2bi option3 self tree addItemLast None Option 3 3 15 TREE WIDGETS Option 1b Option 2 Option 2a Option 2b Option 2bi Option 3 Fig
135. llowing types of targets are supported e AFXIntTarget initialValue e AFXFloatTarget initialValue e AFXStringTarget initialValue 6 7 Accessing kernel data from the GUI You can use the abaqusGui module or the kernelAccess module to access the kernel mdb and session objects from the GUI in Abaqus CAE Each module has advantages and disadvantages for programming in the GUI You access the objects from each module in the same way from abaqusGui import mdb session or from kernelAccess import mdb session In each case the imported objects are proxies for the actual objects in the kernel 6 21 RECEIVING NOTIFICATION OF KERNEL DATA CHANGES You can query the abaqusGui module mdb and session proxy objects for attributes of objects but they cannot be used for arbitrary method calls repository methods such as keys values and items are allowed The abaqusGui proxy objects are regularly updated from the kernel and accessing them is an in process function call fast However in some cases the proxy objects can get out of date For example when a script is running the proxy objects are not updated until it ends You can use the kernelAccess module mdb and session proxy objects to execute any Abaqus Scripting Interface kernel command In addition to querying attributes of the kernel objects you can call their methods and obtain any return values as if you were executing the code in the kernel The kernelAccess proxy objec
136. log box may need to be grayed out when the user clicks a particular button Figure 6 1 illustrates the communication between the kernel and the GUI processes when the user clicks on a button and then enters values in the dialog box that appears Kernel Process GUI Process User clicks button that will post a dialog box Query is processed Kernel is queried for values Values sent to GUI Values are set dialog box is posted 1 User changes values in dialog box Y GUI responds to user s changes if necessary e g stipples widgets 1 User clicks OK GUI processes Command is lie input and sends command string Done N Throw exception Exception caught error dialog box is posted Figure 6 1 Communication between the kernel and GUI processes EXECUTING COMMANDS 6 3 Executing commands All commands are ultimately executed in the kernel process but there are several ways this can be accomplished e You can execute kernel commands from a file by using the start or replay options on the command line e You can execute kernel commands from a file by using File Run Script You can type kernel commands in the Abaqus CAE CLI The GUI mode infrastructure can send a command string from the GUI to the kernel process for execution see Comma
137. lowing example shows how you can use the doCustomChecks method to find an invalid value and in response to post an error dialog box and put the cursor into the appropriate widget If the keyword is connected to a text field in the dialog the onKeywordError method finds the text field widget select its contents and places the focus on the widget def doCustomChecks self if self lengthKw getValue gt 1000 showAFXErrorDialog self getCurrentDialog Length must be less than 1000 self getCurrentDialog onKeywordError self lengthKw return False 7 4 MODE PROCESSING issueCommands The issueCommands method is responsible for constructing the command string issuing it to the kernel handling any exceptions from the command and deactivating the mode if necessary The issueCommands method calls the following methods getCommandString This method returns string that represents the commands collected from each command associated with the mode Required keywords are always sent with the command but optional keywords are sent only if their value has changed The commands are issued to the kernel in the same order as the commands were constructed in the mode If your command does not fit the standard style of the command generated by the mode you can redefine this method to generate your own command string sendCommandString This method takes the command string returned from the getCommandString method and sends it to t
138. lowing methods setCustomCopyrightStrings customCopyrightVersion customCopyrightInfo 10 8 THE HELP TOOLSET e setCustomLogoIcon logoIcon For example from abaqusGui import from sessionGui import HelpToolsetGui from myIcons import class MyMainWindow AFXMainWindow def init self app windowTitle Add custom copyright info to the About Abaqus dialog helpToolset HelpToolsetGui product getAFXApp getProductName major minor update getAFXApp getVersionNumbers prerelease getAFXApp getPrerelease if prerelease release s s S PRE S product major minor update else release s 8 8 product major minor update info Copyright 2003 nMy Company helpToolset setCustomCopyrightStrings release info icon FXXPMIcon app myIconData helpToolset setCustomLogoIcon icon self registerHelpToolset helpToolset GUI IN MENUBAR An alternative way to provide help in your application is to use special methods that allow you to post a URL in a web browser For example from uti import webBrowser status webBrowser displayURL http www simulia com status webBrowser openWithURL file D users someUser someFile html You can use any valid URL syntax such as http or file displayURL will display the URL currently open browser window if there are none it will open a new window openWithURL will 10 9 AN EXAMPLE OF CUSTO
139. m an empty base class and adding all the functionality that you need Alternatively you may find that you want to use most of the functionality of an existing module or toolset If a suitable module or toolset exists it may be easier for you to derive a new module or toolset from it and then add or remove functionality from it This chapter describes how to make various modifications to an existing module or toolset The following topics are covered Modifying and accessing Abaqus CAE GUI modules and toolsets Section 10 1 e The File toolset Section 10 2 e The Tree toolset Section 10 3 e The Selection toolset Section 10 4 The Help toolset Section 10 5 e An example of customizing a toolset Section 10 6 10 1 Modifying and accessing Abaqus CAE GUI modules and toolsets Deriving a new class to create modified Abaqus CAE modules and toolsets allows you to customize existing functions without changing the original functions You can also access existing Abaqus CAE functions from within new dialogs that you create with the Abaqus GUI Toolkit The following topics are covered in this section e Abaqus CAE GUI modules and toolsets Section 10 1 1 Accessing Abaqus CAE functions Section 10 1 2 10 1 1 Abaqus CAE GUI modules and toolsets The Abaqus GUI Toolkit is designed to allow you to add your own modules and toolsets It is generally not recommended that you modify Abaqus CAE module
140. menus 8 2 4 Toolbar items Toolbar items are displayed across the top of the main window under the menu bar and consist of a button that contains an icon Toolbar items are placed in a group that is shown only when its module or toolset is current The group also contains a separator that provides a visual distinction from the other groups of icons in the toolbar The example in GUI module example Section 8 2 creates a toolbar group and adds a button to the toolbar The new button invokes the same mode that will be invoked by the first menu item in the example For more information see Mode processing Section 7 2 GUI MODULE EXAMPLE 8 2 5 Toolbox items Toolbox items are displayed along the left edge of the main window and consist of a button that contains an icon As with toolbar items toolbox items are placed in a group that is shown only when its module or toolset is current Similarly toolbox groups are spaced apart to provide a visual distinction from the other groups of icons in the toolbox The example in GUI module example Section 8 2 creates a toolbox group and adds a button to the toolbox The new button invokes the same mode as the first menu item in the example Toolboxes can also contain flyout menus When the user presses mouse button 1 on the flyout button and holds it down for a certain time span a flyout button displays a popup window containing buttons If the user just quickly clicks mouse button 1 on
141. mn it will be numbered automatically You can set more than one label at once in a heading by using t to separate the labels in a single string By default no grid lines are drawn around items You can control the visibility of the horizontal and vertical grid lines individually by using the following table methods showHorizontalGrid True False showVerticalGrid True False By default the height of the rows is determined by the font being used for the table The default width of a column is 100 pixels You can override these values using the following table methods setRowHeight row height Height is in pixels setColumnWidth column width Width is in pixels The following example illustrates the use of some of these methods vf FXVerticalFrame parent FRAME SUNKEN FRAME THICK 0 0 0 0 0 0 0 0 table AFXTable vf 4 3 4 3 table setLeadingColumns 1 table setLeadingRows 1 table setLeadingRowLabels X tY table showHorizontalGrid True table showVerticalGrid True table setColumnWidth 0 30 X Y Figure 3 23 Leading rows and columns 3 6 3 Spanning You can make an item in a header row or column span more than one row or column as shown in the following example vf FXVerticalFrame parent FRAME SUNKEN FRAME THICK 0 0 0 0 0 0 0 0 3 21 TABLE WIDGET table AFXTable vf 4 3 4 3 table setLeadingColumns 1 table setLeadingRows 2 Corner item table setItemSpan 0 0 2 1 S
142. mples The following statement creates a dialog box that always occludes the main window when overlapping with the main window AFXDialog title actionButtonIds 0 opts DIALOG NORMAL x 0 y 0 0 h 0 The following statement creates a dialog box that always occludes its owner widget usually a dialog box when overlapping with the widget AFXDialog owner title actionButtonIds 0 opts DIALOG NORMAL x 0 0 w 0 0 e The following statement creates a dialog box that can be occluded by any other windows in the application AFXDialog app title actionButtonIds 0 opts DIALOG NORMAL x 0 0 w 0 0 When you construct a dialog box you will start by deriving from the AFXDialog class The first thing you should do in the constructor body is call the base class constructor to properly initialize the dialog Then you would build the contents of your dialog by adding widgets For example CUSTOM DIALOG BOXES class MyDB AFXDialog My constructor def init self Call base class constructor AFXDialog init self My Dialog self DISMISS Add widgets next 5 5 3 Sizing and location By default the user cannot resize a dialog box However if a dialog box contains text fields or lists that can be stretched to show more entries the user should be allowed to resize the dialog box Resizing can be allowed by specifying the DECOR flag in the dialog box constructo
143. n LightGrey LightPink LightPink1 LightPink2 LightPink3 LightPink4 LightSalmon LightSalmon1 LightSalmon2 LightSalmon3 LightSalmon4 LightSeaGreen LightSkyBlue LightSkyBlue1 LightSkyBlue2 LightSkyBlue3 LightSkyBlue4 LightSlateBlue LightSlateGray LightSlateGrey LightSteelBlue LightSteelBlue1 LightSteelBlue2 LightSteelBlue3 LightSteelBlue4 LightYellow LightYellow1 FXRGB 144 238 144 FXRGB 211 211 211 FXRGB 255 182 193 FXRGB 255 174 185 FXRGB 238 162 173 FXRGB 205 140 149 FXRGB 139 95 101 FXRGB 255 160 122 FXRGB 255 160 122 FXRGB 238 149 114 FXRGB 205 129 98 FXRGB 139 87 66 FXRGB 32 178 170 FXRGB 135 206 250 FXRGB 176 226 255 FXRGB 164 211 238 FXRGB 141 182 205 FXRGB 96 123 139 FXRGB 132 112 255 FXRGB 119 136 153 FXRGB 119 136 153 FXRGB 176 196 222 FXRGB 202 225 255 FXRGB 188 210 238 FXRGB 162 181 205 FXRGB 110 123 139 FXRGB 255 255 224 FXRGB 255 255 224 APPENDIX B COLORS AND RGB VALUES String RGB value LightYellow2 FXRGB 238 238 209 LightYellow3 FXRGB 205 205 180 LightYellow4 FXRGB 139 139 122 LimeGreen FXRGB 50 205 50 Linen FXRGB 250 240 230 Magenta FXRGB 255 0 255 Magental FXRGB 255 0 255 Magenta2 FXRGB 238 0 238 Magenta3 FXRGB 205 0 205 Magenta4 FXRGB 139 0 139 Maroon FXRGB 176 48 96 Maroonl FXRGB 255 52 179 Maroon2 FXRGB 238 48 167 Maroon3 FXRGB 205 41 144 Maroon4 FXRGB 139 28 98 MediumAquamarine FXRGB 102 205 170 Medi
144. n ID Apply Send the form an ID COMMIT SEL COMMAND message and its button ID Continue Send the form an ID GET NEXT SEL COMMAND message Defaults Send the form an ID SET DEFAULTS SEL COMMAND message Cancel Check for bailout send the form an ID DEACTIVATE SEL COMMAND message x in title bar Perform the Cancel button action If your dialog has more than one apply button you can handle this by routing messages from the button to the apply message handler in the form In the form you can use the getPressedButtonId method to determine which button was pressed and take the appropriate action For example in your dialog constructor self appendActionButton Plot self self ID PLOT FXMAPFUNC self SEL COMMAND self ID PLOT AFXDataDialog onCmdApply self appendActionButton Highlight self self ID HIGHLIGHT FXMAPFUNC self SEL COMMAND self ID HIGHLIGHT AFXDataDialog onCmdApply and in your form code def doCustomChecks self if self getPressedButtonId self getCurrentDialog ID PLOT Enable plot commands disable highlight commands else Enable highlight commands disable plot commands return True 5 7 Common dialog boxes The Abaqus GUI Toolkit provides some pre built dialog boxes for handling common operations This section provides details on how to use these dialog boxes The following topics are covered e File Directory selector Section 5 7 1 COMMON DIALOG BOXES e Pr
145. nd processing Section 7 2 4 for details e You can issue a kernel command directly from the GUI using the sendCommand function The sendCommand function takes three arguments A required string argument specifying the command to be executed in the kernel Two optional Boolean arguments writeToReplay and writeToJournal The optional Boolean arguments control whether or not the sendCommand function writes the command to the replay or journal file By default the sendCommand function writes the command to the replay file but not to the journal file If the command modifies the model in any way you should record the command in both the replay and journal files However if the command modifies only session data such as the view of the viewport you should record the command in the replay file but you should not record it in the journal file By convention the user should be able to completely recreate the result of an interactive session by replaying its replay file Only the commands that are written to the journal file will be available for data recovery in the event that the application aborts Abaqus Scripting Interface commands automatically journal themselves As a result if you use the sendCommand function to issue an Abaqus Scripting Interface command you should not set writeToJournal True Otherwise the command will be recorded twice in the journal file For more information see Abaqus CAE command files Section 9 5 of the A
146. ndow This section describes the layout components and behavior of the Abaqus main window The following topics are covered e An overview of the main window Section 13 1 e The title bar Section 13 2 e The menu bar Section 13 3 e Toolbars Section 13 4 e The context bar Section 13 5 e The module toolbox Section 13 6 e The drawing area and canvas Section 13 7 The prompt area Section 13 8 e The message area Section 13 9 e The command line interface Section 13 10 13 1 An overview of the main window Interactive Abaqus products consist of a single main window that contains several GUI infrastructure components The main window itself provides only GUI infrastructure support You add specific functionality to the application by registering modules and toolsets with the main window Registering modules and toolsets is discussed in detail in Modules and toolsets Section 14 1 The main window is designed to work with the concept of GUI modules which contain their own menu bar toolbar and toolbox entries The main window shows only the components for one module at a time The main window is responsible for swapping these components in and out as the user visits the various modules of the application The following statement shows the constructor that you use to create the main window AFXMainWindow app title icon None miniIcon None opts DECOR ALL x 0 y
147. ndow base class provides the GUI infrastructure to allow user interaction the manipulation of modules and the display of objects in the viewport This section describes how you add functionality to an application by deriving from the main window base class and then registering modules and toolsets Part Il Getting Started This part describes an application that uses the Abaqus GUI Toolkit This part also describes how you can use the Abaqus GUI Toolkit to create plug ins The following topic is covered e Chapter 2 Getting started with the Abaqus GUI Toolkit 2 WHAT ARE THE COMPONENTS OF AN Abaqus GUI APPLICATION Getting started with the Abaqus GUI Toolkit 2 1 This chapter provides an overview of a customized GUI application The following topics are covered e The kernel and GUI Section 2 1 e What are the components of an Abaqus GUI application Section 2 2 e Plug ins and customized applications Section 2 3 The kernel and GUI 2 2 Abaqus CAE executes in two separate processes the kernel and the GUI The role of the kernel is to provide access to Abaqus databases and the commands that create and modify those databases The role of the GUI is to collect user input which is then packaged as a command string and sent to the kernel for execution The GUI is not essential to the execution of Abaqus an entire model can be constructed analyzed and post processed through the use of kernel scripts wi
148. ndows system you must use Windows syntax To use Windows syntax you must make the following changes to the entire PYTHONPATH line UNIX Windows r NAME NAME The following example shows abaqus aev file that refers to a drive letter and has been modified to run on a Windows system ABA PATH SABA HOME ABA HOME cae PYTHONPATH ABA HOME cae Python Lib ABA_HOME cae Python 0bj 11 5 INSTALLATION HOME cae exec lbr d boltApp1 PYTHONPATH ABA LIBRARY PATH SABA HOME cae ABA SELECT SABA HOME cae exec lbr ABA HOME cae Python Obj lbr SABA HOME cae External Acis ABA HOME cae External SABA HOME cae External ebt ABA HOME exec Use the following syntax to start your application abaqus applicationName 11 6 COMMON METHODS 12 The application object This section describes the Abaqus application object The application object manages the message queue timers chores GUI updating and other system facilities The following topics are covered The application object Section 12 1 e Common methods Section 12 2 12 1 The application object The application object manages the message queue timers chores GUI updating and other system facilities Each application will have an application object which you typically create in the application s startup file For more information see Startup script Section 11 2 The constructor for t
149. ng to the command but the keywords are also stored as members of the mode As a result you can easily connect the keywords to widgets in a dialog box that updates the value of the keywords For more information see Chapter 5 Dialog boxes AFXKeyword is the base class for keywords in the toolkit The AFXKeyword class derives from a data target so it automatically keeps the GUI and application data synchronized with each other For more information see Data targets Section 6 5 6 The AFXKeyword class extends the functionality of the FXDataTarget class by holding additional values such as the name of the keyword a default value and a previous value The keyword s GUI command uses this information to construct a kernel command string You can designate a keyword as optional or required A required keyword is always issued by the GUI command An optional keyword whose values have not changed since the last commit of the command is not issued by the GUI command Ifnone of the keywords has changed since the last commit no GUI command will be issued when the mode is committed The following types of keywords are supported AFXIntKeyword cmd name isRequired defaultValue AFXFloatKeyword cmd name isRequired defaultValue GUI COMMANDS AFXStringKeyword cmd name isRequired defaultValue AFXBoolKeyword cmd name booleanType isRequired defaultValue AFXSymConstKeyword cmd name isRequired defaultValue AFXTuple
150. ngle in the lower right corner to indicate that a flyout popup window can be invoked For example group AFXToolbarGroup self popup FXPopup getAFXApp getAFXMainWindow AFXFlyoutItem popup tFlyout Button 1 squareIcon AFXFlyoutItem popup tFlyout Button 2 circleIcon AFXFlyoutItem popup tFlyout Button 3 triangleIcon AFXFlyoutButton group popup popup create Flyout Button 2 Figure 3 8 An example of flyout buttons from AFXFlyoutItem 3 1 10 Color buttons The AFXColorButton widget displays a push button that shows a color Clicking the button posts the color selection dialog box which the user can use to change the value of the color for the button For example AFXColorButton parent Color Color Bl Figure 3 9 An example of an AFXColorButton When connected to an APXStringKeyword this widget will assign the value of the button s current color to the keyword in hex format for example FF0000 3 7 TEXT WIDGETS 3 2 Text widgets This section describes the widgets in the Abaqus GUI Toolkit that allow the user to input text The following topics are covered e Single line text field widget Section 3 2 1 e Multi line text widget Section 3 2 2 3 2 1 Single line text field widget The AFXTextField widget provides a single line text entry 4 AFXTextField extends the capability of the standard FXTextField widget with the following An optional label e Support fo
151. nt LAYOUT FILL X LAYOUT FIX HEIGHT SPLITTER VERTICAL 0 0 0 100 1 FXHorizontalFrame sp FRAME SUNKEN FRAME THICK FXLabel hfl This is area 1 hf2 FXHorizontalFrame sp FRAME SUNKEN FRAME THICK FXLabel hf2 This is area 2 This is area 1 This is area 2 Figure 4 5 An example of resizable areas laid out vertically by FXSplitter 4 8 Rotating regions The FXSwitcher widget manages children that are positioned on top of each other FXSwitcher allows you to select which child should be shown by either sending it a message or calling its setCurrent method When sending a message you must set the message ID to FXSwitcher ID OPEN FIRST for the first child You must then increment the message ID from that value for the subsequent children as shown in the following example For more information on messages see Targets and messages Section 6 5 4 To use the setCurrent method you should provide the zero based index of the child that you want to display For example to display the first child you should call the setCurrent method with an index value of zero For example sw FXSwitcher parent FXRadioButton hf Option 1 sw FXSwitcher ID OPEN FIRST FXRadioButton hf Option 2 sw FXSwitcher ID OPEN FIRST 1 1 FXHorizontalFrame sw FXButton hfl Button 1 FXButton hfl Button 2 hf2 FXHorizontalFrame sw FXButton hf2 Button 3 FXButton hf2 Button 4 4 6 TAB BOOKS Option C Option2
152. nt dialog box See Print dialog box Section 5 7 2 for an example of how to use the getPrintForm method In addition the Abaqus GUI Toolkit provides two virtual methods that you can modify to change the behavior of your application when a database is opened Normally after an output database is opened Abaqus CAE will enter the Visualization module Similarly if you are in the Visualization module and you open a model database Abaqus CAE enters the first module listed in the Module list in context bar To change this behavior you can overwrite the switchToOdbModule and switchToMdbModule methods These methods return True if they are successful For example from abaqusGui import class MyFileToolsetGui FileToolsetGui 10 5 THE TREE TOOLSET 10 3 def switchToMdbModule self Always switch to the Property module currentModuleGui getCurrentModuleGui if currentModuleGui and currentModuleGui getModuleName Property switchModule Property return True def switchToOdbModule self Do not switch modules return True The Tree toolset The Tree toolset provides a tabbed area that contains the Model Tree and the Results Tree in Abaqus CAE For more information see Working with the Model Tree and the Results Tree Section 3 5 of the Abaqus CAE User s Manual The Tree toolset contains the following methods that you can use to customize the appearance of the tabbed area The makeModelTab method creat
153. nul Item 1 Submenu Subitem 1 Figure 3 7 An example of cascading menu buttons from AFKMenuCascade In addition to specifying a mnemonic using the amp syntax described in Labels and buttons Section 3 1 you can specify an accelerator in the menu item s label You specify an accelerator by separating it from the button s text by a t For example AFXMenuCommand self menu Graphics Options tCtrl G None GraphicsOptionsForm self AFXMode ID ACTIVATE 3 1 7 Popup menus You can create a popup menu that appears when the user clicks mouse button 3 over a widget For example the following statements illustrate how you can create a popup menu that contains two buttons that appear when the user clicks mouse button 3 over a tree widget In the dialog box constructor def init self form FXMAPFUNC self SEL RIGHTBUTTONPRESS self ID TREE MyDB onCmdPopup FXMAPFUNC self SEL COMMAND self ID TESTI MyDB onCmdTest1 FXMAPFUNC self SEL COMMAND self ID TEST2 MyDB onCmdTest2 self menuPane None FXTreeList self 5 self self ID TREE LAYOUT FILL X LAYOUT FILL Y TREELIST SHOWS BOXES TREELIST SHOWS LINES TREELIST ROOT BOXES TREELIST BROWSESELECT LABELS AND BUTTONS def onCmdPopup self sender sel ptr if not self menuPane self menuPane FXMenuPane self FXMenuCommand self menuPane Testl None self self ID TEST1 FXMenuCommand self menuPane Test2 None self self ID TEST
154. o be edited By default the user can select multiple items in a table To change this behavior you should use the appropriate flag to specify either single select mode or browse select mode In addition you can specify whether the entire row should be selected when the user selects any item in the row Abaqus CAE exhibits this behavior in manager dialogs that contain more than one column The following statements creates a table with default settings 4 Tables do not draw a frame around their border Therefore add a frame widget with zero padding vf FXVerticalFrame gb FRAME SUNKEN FRAME THICK 0 0 0 0 0 0 0 0 table AFXTable vf 4 2 4 2 Figure 3 22 table created with default settings 3 6 2 Rows and columns The table supports leading rows and columns Leading rows and columns are displayed as buttons using a bold text Leading rows are displayed at the top of the table and leading columns are displayed on the left side of the table 3 20 TABLE WIDGET The number of rows and columns that you specify in the table constructor are the total number of rows and columns including the leading rows and columns By default the table has no leading rows or columns you must set the leading rows and columns after the table is constructed using the appropriate table methods You can also specify the labels to be displayed in these rows and columns If you do not specify any labels for a leading row or colu
155. ollow these steps e Derive a new class from a toolset base class Create menus in the menu bar This step is optional Create items in the Tools menu This step is optional Create buttons in the toolbar This step is optional Create buttons in the toolbox This step is optional Create modes to collect input from the user and to issue commands 9 2 GUI Toolset example The AFXToolsetGui base class provides various toolset infrastructure support functions For example the AFXToolsetGui base class keeps track of the menus in a toolset along with the toolbar and toolbox buttons so that they can be swapped in and out automatically as the user changes modules To create your own toolset GUI you begin by deriving from the AFXToolsetGui class Alternatively if there is another module GUI class that provides most of the functionality that you want you can begin by deriving from that class and then making modifications For more information see Chapter 10 Customizing an existing module or toolset The following example shows how to create a new toolset class by deriving from AFXToolsetGui from abaqusGui import class MyToolsetGui AFXToolsetGui 9 1 REGISTERING TOOLSETS def init self Construct the base class AFXToolsetGui init self toolsetName In the constructor of the new class you call the constructor of the base class The APXToolsetGui class takes the following argument toolsetName A
156. ollowing sections Details of how you construct modules and toolsets are given in Chapter 8 Creating a GUI module and Chapter 9 Creating a GUI toolset from abaqusGui import class CaeMainWindow AFXMainWindow def init self app windowTitle Construct the GUI infrastructure AFXMainWindow init self app windowTitle Register the persistent toolsets self registerToolset FileToolsetGui GUI IN MENUBAR GUI IN TOOLBAR self registerToolset ModelToolsetGui GUI IN MENUBAR self registerToolset CanvasToolsetGui GUI IN MENUBAR self registerToolset ViewManipToolsetGui GUI IN MENUBAR GUI IN TOOLBAR self registerToolset TreeToolsetGui GUI IN MENUBAR self registerToolset AnnotationToolsetGui GUI IN MENUBAR GUI IN TOOLBAR self registerToolset CustomizeToolsetGui GUI IN TOOL PANE self registerToolset SelectionToolsetGui GUI IN TOOLBAR registerPluginToolset self registerHelpToolset HelpToolsetGui GUI IN MENUBAR GUI IN TOOLBAR Register modules self registerModule Part Part 14 2 THE Abaqus CAE MAIN WINDOW self registerModule Property Property self registerModule Assembly Assembly self registerModule Step Step self registerModule Interaction Interaction self registerModule Load Load self registerModule Mesh Mesh self registerModule Job Job self registerModule Visualization Visualization self registe
157. om of the dialog box The following statements illustrate how you define an action area in a dialog box with a separator CUSTOM DIALOG BOXES class ActionAreaDB AFXDialog def init self AFXDialog init self Action Area Examplel self OK self APPLY self CANCEL DIALOG ACTIONS SEPARATOR FXLabel self Standard action area example dialog im Action rea Example 1 x Standard action area example dialog OK Apply Figure 5 4 An example of a standard action area 5 5 5 Custom action area button names The flags in Table 5 1 cover all the semantics you might need in a dialog box As a result there is no need for any additional custom flags however there may be cases where you want to use a different label for one of the standard actions To use a different label for one of the standard actions you do not specify any button flags in the constructor arguments however you use the appendActionButton method to add your own action area buttons The appendActionButton method has two prototypes appendActionButton buttonId appendActionButton text tgt sel The first version of the prototype creates a standard action area button as defined in Table 5 1 The second version of the prototype creates a button whose label is given as the text argument In addition the second version allows you to set the target and selector so that you can catch messages from this button and act accordingly The follow
158. ons Section 3 1 3 e Check buttons Section 3 1 4 e Radio buttons Section 3 1 5 e Menu buttons Section 3 1 6 Popup menus Section 3 1 7 e Toolbar and toolbox buttons Section 3 1 8 e Flyout buttons Section 3 1 9 e Color buttons Section 3 1 10 3 1 LABELS AND BUTTONS 3 1 1 An overview of labels and buttons Several widgets in the Abaqus GUI Toolkit support labels If you want to put a label before a text field for example you should use AFXText Field instead of creating a horizontal frame and adding a label widget and a text field widget The following sections describe the specific widgets that support labels The label and button constructors all take a text string argument This text string can consist of three parts where each part is separated by t The three parts of the text string are Text The text displayed by the widget Tip text The text displayed when the cursor is held over the widget for a short period of time If there is only an icon associated with a widget you must supply the tip text Help text The text displayed in the application s status bar assuming that the application has a status bar In addition you can define a keyboard accelerator for the widget by preceding one of the characters in the text with an ampersand amp character For example if you specify the string amp Calculate fora button the button label will appear as shown in Figur
159. ont getAFXFont FONT BOLD FXLabel self Bold font Restore the default font getAFXApp setNormalFont normalFont Set the font of a widget after it is created 1 FXLabel self Sample text l setFont getAFXFont FONT MONOSPACE 3 38 AN OVERVIEW OF LAYOUT MANAGERS 4 Layout managers This section describes how to use the various layout managers in the Abaqus GUI Toolkit to arrange widgets in a dialog box The following topics are covered e An overview of layout managers Section 4 1 e Padding and spacing Section 4 2 e Horizontal and vertical frames Section 4 3 Vertical alignment for composite children Section 4 4 General purpose layout managers Section 4 5 Row and column layout manager Section 4 6 Resizable regions Section 4 7 Rotating regions Section 4 8 e Tab books Section 4 9 Layout hints Section 4 10 Layout examples Section 4 11 Tips for specifying layout hints Section 4 12 4 1 An overview of layout managers A layout manager places its children in a certain arrangement in its interior Layout managers use a combination of layout hints and packing styles to determine how to place and size their children Layout managers in the Abaqus GUI Toolkit calculate relative sizes and relative positions as opposed to absolute coordinates This relative approach accounts automatically for changes such as different font sizes and window resi
160. orientation so that the label is above the text field AFXTextField parent 8 AFXTextField None 0 AFXTEXTFIELD CHECKBUTTON AFXTEXTFIELD VERTICAL Integer AFXTextField Figure 3 12 An example of a check button with a labeled text field from AFXTextField Non editable variation In some cases you may want to change the behavior of a text field so that it cannot be edited by the user for example when a particular check button in the dialog box is not set In this case you can make the text field non editable when the check button is unset by calling the setEditable False method of the AFXTextField widget Read only variation 3 2 2 In some cases you may want to change the behavior of a text field so that it cannot be edited by the user and appears as a label making it clear that the user cannot change its contents For example when you are using the Load module in Abaqus CAE there are some values that you can specify in the analysis step in which the load was created but you cannot change in subsequent steps The AFXTextField widget supports a read only state through the setReadOnlyState method For example tf AFXTextField parent 8 String AFXTextField in read only mode keyword tf setReadOnlyState True Multi line text widget FXText provides a multi line text entry area For example text FXText parent None 0 LAYOUT FIX WIDTH LAYOUT FIX HEIGHT 0 0 300 100 text setText This is an FXText wi
161. ou connect a table keyword to a table that contains lists you must set the column type of the table keyword appropriately If the list contains only text you can set the column type to AFXTABLE TYPE STRING which sets the value of the keyword to the text ofthe item selected in the list Similarly if the list contains only icons you can set the column type to AFXTABLE TYPE INT which sets the value of the keyword to the index of the item selected in the list If the list contains both text and icons you can use either setting for the column type 3 6 8 Boolean type If you want to allow the user to specify a value in a table be either True or False you must set the type of the column to be BOOL The value of a Boolean item is toggled each time the user clicks the item By default a blank icon represents False and a check mark icon represents True The following example illustrates how you can include Boolean items in a table vf FXVerticalFrame gb FRAME SUNKEN FRAME THICK 0 0 0 0 0 0 0 0 table AFXTable vf 4 2 4 2 None 0 AFXTABLE NORMAL AFXTABLE EDITABLE table setLeadingRows 1 table setLeadingRowLabels NlgeomNtStep table showHorizontalGrid True table showVerticalGrid True 3 25 TABLE WIDGET table setColumnType 0 table BOOL table setColumnWidth 0 50 table setColumnJustify 0 AFXTable CENTER Figure 3 27 Boolean items in a table If you do not want to use the default icons you can set your own true
162. pan top row item over 2 columns table setItemSpan 0 1 1 2 table setLeadingRowLabels Coordinates table setLeadingRowLabels XNtY 1 table showHorizontalGrid True table showVerticalGrid True table setColumnWidth 0 30 Coordinates Figure 3 24 An example of spanning two header columns 3 6 4 Justification By default the table displays entries left justified You can change how items are justified by using the following table methods setColumnJustify column justify setItemJustify row column justify If you supply a value of 1 for the column number the setColumn methods apply the setting to all columns in the table The following table shows the possible values for the justify argument Option flag Effect AFXTable LEFT Align items to the left side of the cell AFXTable CENTER Center items horizontally 3 22 Option flag Effect AFXTable RIGHT Align items to the right side of the cell AFXTable TOP Align items to the top of the cell AFXTable MIDDLE Center items vertically AFXTable BOTTOM Align items to the bottom of the cell The following example shows how you can change the justification vf FXVerticalFrame gb FRAME SUNKEN FRAME THICK 0 0 0 0 0 0 0 0 table AFXTable vf 4 3 4 3 table setLeadingColumns 1 table setLeadingRows 1 table setLeadingRowLabels XNtY table showHorizontalGrid True table showVerticalGrid True table setColumnW
163. ple The new toolset will also appear in the Part module in place of the standard Datum toolset In your main window file class MyMainWindow AFXMainWindow def init self app windowTitle def makeCustomToolsets self from myDtmToolsetGui import MyDtmGui Store the toolset as a member of the main window if you want to register it in one of your modules too self myDtmGui MyDtmGui 10 4 THE FILE TOOLSET In your module GUI file class MyModuleGui AFXModuleGui def init self mw getAFXApp getAFXMainWindow self registerToolset mw myDtmGui GUI IN TOOL PANE GUI IN TOOLBOX 10 1 2 Accessing Abaqus CAE functions If you want to launch an Abaqus CAE function from your own dialog you can do so by connecting the appropriate target and selector to one of your buttons You can get the target and selector for a particular function by using the main window s getTargetFromFunction and getSelectorFromFunction methods For example mainWindow getAFXApp getAFXMainWindow target mainWindow getTargetFromFunction Part gt Create selector mainWindow getSelectorFromFunction Part gt Create FXButton self Create Part tgt target sel selector The list of valid function names can be found in the Functions tab page in the Tools Customize dialog box 10 2 The File toolset The File toolset contains a method called getPrintForm that allows you to access the form that posts the Pri
164. r Note Dialog boxes created by AFXDialog do not support minimizing and maximizing they ignore these flags if they are included in the dialog box constructor You should never specify the size and location of the dialog box in its constructor The Abaqus GUI Toolkit will place the dialog box on the screen and determine its proper size 5 5 4 Action area The action area of a dialog box contains buttons such as OK and Cancel These buttons allow the user to commit values from the dialog box to close the dialog box or to perform some other action AFXDialog supports the automatic creation of an action area and its buttons through the use of bit flags in the dialog box constructor You can use the flags described in Table 5 1 to include standard action area buttons Table 5 1 Action area flags Button flag Message ID Label Semantics AFXDialog AFXDialog OK Commit the values in the dialog OK ID_CLICKED OK box process them and then hide the dialog box AFXDialog AFXDialog Continue Commit the values in the dialog CONTINUE ID CLICKED CONTINUE box hide it and continue collecting input from the user in another dialog box or prompt CUSTOM DIALOG BOXES Button flag Message ID Label Semantics AFXDialog AFXDialog Apply Same as OK except the dialog box APPLY ID_CLICKED_APPLY is not hidden AFXDialog AFXDialog Defaults Reset the values in the dialog box DEFAULTS ID_CLICKED DEFAULTS to their
165. r a toggled version and a read only state e An additional numeric type complex e Horizontal and vertical layouts For example AFXTextField parent 8 String AFXTextField String AFXTextField f Figure 3 10 An example of a single line text field from AFXTextField Text fields are generally connected to keywords and the type of the keyword determines the type of input allowed in the text field For example if the text field is connected to an integer keyword the keyword will verify that the input in the text field is a valid integer You do not need to specifiy any option flags for the text field to get this behavior Complex text fields are an exception to this to display the extra field needed to collect complex input you must specify the bit flag shown in the following example AFXTextField parent 8 Complex AFXTextField None 0 AFXTEXTFIELD COMPLEX Complex AF xX TextField f f i Figure 3 11 An example of a single line complex numeric field from AFXTextField 3 8 TEXT WIDGETS Toggled variation In many cases a check button precedes a labeled text field The check button allows the user to toggle the component on or off when the component is toggled off the text field becomes disabled The AFXText Field widget creates a check button with this behavior when you supply the AFXTEXTFIELD CHECKBUTTON flag The following example creates a check button with a text field It also configures the widget in a vertical
166. rModule Sketch Sketch 14 2 2 Importing modules The abaqusGui module provides access to the entire Abaqus GUI Toolkit in addition to the modules such as FileToolsetGui that must be registered with the main window 14 2 3 Constructing the base class The first statement in the CaeMainWindow constructor initializes the class by calling the base class constructor In general you should always call the base class constructor of the class from which you are deriving unless you know that you will overwrite the functionality of the class 14 2 4 Registering persistent toolsets Toolsets that are registered with the main window as opposed to being registered with a module are available in the GUI when the application first starts up In addition toolsets that are registered with the main window remain available throughout a session as the user switches modules To register a toolset you call the registerToolset method and pass in an instance of the toolset class You can register a help toolset with the application using the registerHelpToolset method A toolset that is registered in this manner always appears to the right of all other menus in the menu bar For more information see Registering toolsets Section 8 2 6 Note Every application must register viewManipToolsetGui 14 2 5 Registering modules Registering modules puts the module names into the Module combo box in the context bar The order in which the modules are regi
167. raises an exception the mode infrastructure calls the handleException method The handleException posts an error dialog with the message contained in the exception Alternatively if you want to perform your own error handling you can redefine the handleException method as shown in the following example def handleException self exception exceptionType exception 0 exceptionValue exception 1 Do some special error handling here Post an error dialog 7 8 FORM MODES db self getCurrentDialog showAFXErrorDialog db str exceptionValue 7 3 Form modes A form mode gathers input from the user using one or more dialog boxes This section describes the two methods used by forms for posting dialog boxes The following topics are covered e Form example Section 7 3 1 e Form constructor Section 7 3 2 e getFirstDialog Section 7 3 3 e getNextDialog Section 7 3 4 e Collecting input from the GUI Section 7 3 5 7 3 1 Form example The following example illustrates how to write a form mode This first example contains only one dialog box a subsequent example will extend this form to include multiple dialog boxes from abaqusGui import from plateDB import PlateDB class PlateForm AFXForm def init self owner AFXForm init self owner self cmd AFXGuiCommand self Plate examples self nameKw AFXStringKeyword self cmd name True self widthKw AFXFloatK
168. ray31 FXRGB 79 79 79 Gray32 FXRGB 82 82 82 Gray33 FXRGB 84 84 84 Gray34 FXRGB 87 87 87 Gray35 FXRGB 89 89 89 Gray36 FXRGB 92 92 92 Gray37 FXRGB 94 94 94 Gray38 FXRGB 97 97 97 Gray39 FXRGB 99 99 99 Gray4 FXRGB 10 10 10 Gray40 FXRGB 102 102 102 Gray41 FXRGB 105 105 105 Gray42 FXRGB 107 107 107 Gray43 FXRGB 110 110 110 APPENDIX B COLORS AND RGB VALUES String RGB value Gray44 Gray45 Gray46 Gray47 Gray48 Gray49 Gray5 Gray50 Gray51 Gray52 Gray53 Gray54 Gray55 Gray56 57 58 59 Gray6 Gray60 Gray61 Gray62 Gray63 Gray64 Gray65 Gray66 Gray67 Gray68 Gray69 FXRGB 112 112 112 FXRGB 115 115 115 FXRGB 117 117 117 FXRGB 120 120 120 FXRGB 122 122 122 FXRGB 125 125 125 FXRGB 13 13 13 FXRGB 127 127 127 FXRGB 130 130 130 FXRGB 133 133 133 FXRGB 135 135 135 FXRGB 138 138 138 FXRGB 140 140 140 FXRGB 143 143 143 FXRGB 145 145 145 FXRGB 148 148 148 FXRGB 150 150 150 FXRGB 15 15 15 FXRGB 153 153 153 FXRGB 156 156 156 FXRGB 158 158 158 FXRGB 161 161 161 FXRGB 163 163 163 FXRGB 166 166 166 FXRGB 168 168 168 FXRGB 171 171 171 FXRGB 173 173 173 FXRGB 176 176 176 B 8 APPENDIX B COLORS AND RGB VALUES String RGB value Gray7 FXRGB 18 18 18 Gray70 FXRGB 179 179 179 Gray71 FXRGB 181 181 181 Gray72 FXRGB 184 184 184 Gray73 FXRGB 186 186 186 Gray74 FXRGB 189 189 189
169. rguments one for the name to be displayed in the Module combo box in CAE and a second that specifies the name of the module to import For more information see Registering modules Section 14 2 5 In most cases you register the module in the main window code by calling the module constructor at the end of the module GUI file If the example shown in GUI module example Section 8 2 resides in a file named myModuleGui py myModuleGui must be used as the second argument to the registerModule method as shown in the following statement Register modules self registerModule displayedName My Module moduleImportName myModuleGui SWITCHING TO A GUI MODULE 8 4 Switching to a GUI module When the user selects a module from the Module list in the context bar the GUI infrastructure does the following Calls the deactivate method of the current GUI module Calls the activate method of the GUI module selected by the user You can write your own activate or deactivate methods if you need to perform any special processing when entering or leaving a module If you need to issue a command to the kernel when the user changes modules you must use the sendCommandString method of the AFXModuleGui object to issue the command If you do not use the sendCommandString method the application may hang while trying to process the command You should enclose the statements that call the sendCommandString method in a try block to catch any excep
170. rmation see Tab books Section 4 9 4 2 Padding and spacing Layout managers and most widgets provide some default padding so that widgets are spaced apart from each other These values are commonly found near the end of the widget s list of arguments For example FXPacker pl pr pt pb In general you should accept the default values for padding However if you have nested layout managers you should set the padding values to zero Layout managers also provide spacing between their children These values are commonly found at the end of the widget s list of arguments For example FXPacker hs vs VERTICAL ALIGNMENT FOR COMPOSITE CHILDREN In general you should accept the default values for spacing Some compound widgets such as AFXText Field AFXComboBox and AFXSpinner have two padding values one for the padding of the internal text field widget and a second for the entire widget that includes a label You set the padding for the internal text field widget by passing padding values into the widget constructor You set the padding for the entire widget by calling one of the padding methods on the widget for example setPadLeft 4 3 Horizontal and vertical frames The FXHorizontalFrame and FXVerticalFrame widgets arrange their children in rows or columns respectively For example vf FXVerticalFrame parent FXButton vf Button 1 FXButton vf Button 2 FXButton vf Button 3 But
171. rom another dialog box def onCmdDirectory self sender sel ptr if not self dirDb self dirDb AFXFileSelectorDialog self Select a Directory self form dirNameKw None AFXSELECTFILE DIRECTORY self dirDb create self dirDb showModal return 1 5 7 2 Print dialog box The Print dialog box provides standard printing functionality To post the Print dialog box from a button in your dialog box you first access the print form mode by using the getPrintForm method 5 20 COMMON DIALOG BOXES of the FileToolsetGui class This can be done by storing a pointer to the form as shown in the following example from sessionGui import FileToolsetGui class MyMainWindow AFXMainWindow def init self app windowTitle fileToolset FileToolsetGui self printForm fileToolset getPrintForm self registerToolset fileToolset GUI IN MENUBAR GUI IN TOOLBAR Then you can use the print form in your dialog box class as shown below printForm getAFXApp getAFXMainWindow printForm FXButton parent Print None printForm AFXMode ID ACTIVATE To access the print form you must construct and register the file toolset However you cannot access the print form from within a plug in As a result you can only use the approach described here in a customized application 5 7 3 Color selector dialog box The AFXColorSelector widget provides the ability to choose a color from a predefined palette of colors This di
172. rs and RGB values Both methods are illustrated in the following example FXVerticalFrame parent FRAME SUNKEN FRAME THICK 0 0 0 0 0 0 0 0 table AFXTable vf 4 2 4 2 None 0 AFXTABLE NORMAL AFXTABLE EDITABLE table setLeadingRows 1 table setLeadingRowLabels Name tDescription 3 31 TABLE WIDGET table table table table table table showHorizontalGrid True showVerticalGrid True setItemTextColor 1 0 Blue setItemTextColor 1 1 FXRGB 0 0 255 setItemBackColor 3 0 Pink setItemBackColor 3 1 FXRGB 255 192 203 Name Description Part 1 Solid extrusion Part 2 2D planar Part 3 Axisymmetric Figure 3 32 Setting colors for table items 3 6 13 Sorting You can set a column in a table to be sortable If a column is set to be sortable and the user clicks on its heading a graphic will be displayed in the heading that shows the order of the sort You must write the code that performs the actual sorting in the table the table itself provides only the graphical feedback in the heading cell For example class MyDB AFXDataDialog def init self Handle clicks in the table FXMAPFUNC self SEL CLICKED self ID TABLE MyDB onClickTable Create a table vf FXVerticalFrame parent FRAME SUNKEN FRAME THICK 0 0 0 0 0 0 0 0 self sortTable AFXTable vf 4 3 4 3 self Self ID TABLE AFXTABLE NORMAL AFXTABLE EDITABLE 3 32 def TABLE WIDGET self so
173. rtTable setLeadingRows 1 self sortTable setLeadingRowLabels Name tX tyY self sortTable setColumnSortable 1 True self sortTable setColumnSortable 2 True onClickTable self sender sel ptr Status x y buttons self sortTable getCursorPosition column self sortTable getColumnAtX x row self sortTable getRowAtY Ignore clicks on table headers if row 0 or column 0 return values index 1 for row in range 1 self sortTable getNumRows values append self sortTable getItemFloatValue row column index index 1 values sort if self sortTable getColumnSortOrder column AFXTable SORT ASCENDING values reverse items for value index in values name self sortTable getItemValue index 0 xValue self sortTable getItemValue index 1 yValue self sortTable getItemValue index 2 items append name xValue yValue row 1 for name xValue yValue in items self sortTable setItemValue row 0 name self sortTable setItemValue row 1 xValue self sortTable setItemValue row 2 yValue row 1 3 33 MISCELLANEOUS WIDGETS Figure 3 33 Sorting table items 3 7 Miscellaneous widgets This section describes a set of miscellaneous widgets in the Abaqus GUI Toolkit that you can use in your applications The following topics are covered e Separators Section 3 7 1 Notes and warnings Section 3 7 2 Progress bar Section
174. s Section 6 3 deactivate After the mode has issued its commands successfully it will call the deactivate method to perform various cleanup tasks unless the mode loops or an Apply button was pressed in which case the mode returns to wait for further input from the user If you need to perform your own MODE PROCESSING cleanup tasks for your mode you can overwrite this method but you should be sure to call the base class method as well to ensure that the mode is terminated properly as shown in the following example def deactivate self Do your processing here Call the base class method AFXForm deactivate self cancel If you need to cancel a mode programmatically as opposed to the user clicking on a Cancel button you can call the mode s cance1 method taking the default values for its arguments The cancel method will call the deactivate method so the mode s cleanup tasks will still be performed If you want to give the user a chance to confirm whether a mode should be cancelled you can have a bailout dialog invoked If you are writing a form mode you can specify the bailout flag in the constructor of your dialog box If you are writing a procedure mode you should write the checkCancel method The return value of the checkCancel method determines if the user will be prompted for confirmation when the procedure is cancelled For example def checkCancel self if self getCurrentStep self stepl If
175. s FXRadioButton 2 FXRadioButton parent This is FXRadioButton 3 3 3 LABELS AND BUTTONS This is FXRadioButton 1 C This is FXRadioButton 2 C This is FXRadioButton 3 Figure 3 5 An example of radio buttons from FXRadioButton 3 1 6 Menu buttons A menu consists of the following A menu title created by AFXMenuTitle A menu pane created by AFXMenuPane e A menu command created by AFKMenuCommand The menu title resides in a menu bar and controls the display of the menu pane associated with the menu title The menu pane contains menu commands Menu commands are buttons that generally invoke some action A menu pane can also contain a cascading menu created by AFXMenuCascade A cascading menu provides submenus within a menu Figure 3 6 illustrates the components of a menu MenuTitle MenuTitle MenuTitle fe MenuCommand MenuCommand MenuCommand MenuCascade gt Menu Bar MenuCommand E d MenuCommand Menu Pane Figure 3 6 The components of a menu The following example illustrates the use of cascading menus menu AFXMenuPane self AFXMenuTitle self amp Menul None menu AFXMenuCommand self menu amp Item 1 None forml AFXMode ID ACTIVATE subMenu AFXMenuPane self AFXMenuCascade self menu amp Submenu None subMenu AFXMenuCommand self subMenu amp Subitem 1 None LABELS AND BUTTONS form2 AFXMode ID ACTIVATE Me
176. s a modified version of the example in getFirstDialog Section 7 3 3 that illustrates how inputs are collected from the user in a series of three dialog boxes rather than just one def getFirstDialog self self dialogl PlateDB1 self return self dialogl def getNextDialog self previousDb if previousDb self dialogl self dialog2 PlateDB2 self return self dialog2 elif previousDb self dialog2 self dialog3 PlateDB3 self return self dialog3 else return None 7 3 5 Collecting input from the GUI To collect input from the user via the GUI the keywords defined in the mode must be connected to widgets in the dialog box The AFXDataDialog class takes a mode argument in its constructor Because the form stores keywords the dialog box can access these keywords and assign them to be targets of widgets in the dialog box As a result the GUI can update the keywords or if the kernel is updated while the dialog box is posted the keywords can update the GUI For more information see Chapter 5 Dialog boxes The following example shows how the form s keywords are connected to the widgets in the dialog box class PlateDB AFXDataDialog def init self mode AFXDataDialog init self mode Create Plate self OK self CANCEL DIALOG ACTIONS SEPARATOR va AFXVerticalAligner self AFXTextField va 15 Name mode nameKw 0 AFXTextField va 15 Width mode widthKw 0 AFXTextField va 15 Height
177. s and customized applications Running the prototype application PART BUILDING DIALOG BOXES 3 Widgets Labels and buttons Text widgets Lists and combo boxes Range widgets Tree widgets Table widget Miscellaneous widgets The create method Widgets and fonts 4 Layout managers An overview of layout managers Padding and spacing Horizontal and vertical frames CONTENTS 1 1 1 2 1 3 14 2 1 2 2 2 3 2 4 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 9 4 1 4 2 4 3 CONTENTS Vertical alignment for composite children 4 4 General purpose layout managers 4 5 Row and column layout manager 4 6 Resizable regions 4 7 Rotating regions 4 8 Tab books 4 9 Layout hints 4 10 Layout examples 4 11 Tips for specifying layout hints 4 12 5 Dialog boxes An overview of dialog boxes 5 1 Modal versus modeless 5 2 Showing and hiding dialog boxes 5 3 Message dialog boxes 5 4 Custom dialog boxes 5 5 Data dialog boxes 5 6 Common dialog boxes 5 7 PART ISSUING COMMANDS 6 Commands An overview of commands 6 1 The kernel and GUI processes 6 2 Executing commands 6 3 Kernel commands 6 4 GUI commands 6 5 AF XTargets 6 6 Accessing kernel data from the GUI 6 7 Receiving notification of kernel data changes 6 8 7 Modes An overview of modes 7 1 Mode processing 7 2 Form modes 7 3 Procedure modes 7 4 Picking in procedure modes 7 5 PART GUI MODULES AND TOOLSETS 8 Creating a GUI module An overview of creating a G
178. s and toolsets because future changes to Abaqus CAE may break your application However if you do have a need to modify some of the Abaqus CAE modules or toolsets you can make changes by deriving a new class from one of them and then adding or removing components To derive a new class you must know the appropriate class name and you must call that class s constructor in your constructor The table below lists the class names and registered names for all the Abaqus CAE modules that are available in the Abaqus GUI Toolkit You can import these class names from abaqusGui MODIFYING AND ACCESSING Abaqus CAE GUI MODULES AND TOOLSETS When you register a module derived from one of the Abaqus CAE modules you must use the name shown in the table for the displayedName argument in the main window s registerModule method If you do not use the name shown some GUI infrastructure components may not function correctly Class name Name PartGui Part PropertyGui Property AssemblyGui Assembly StepGui Step InteractionGui Interaction LoadGui Load MeshGui Mesh OptimizationGui Optimization JobGui Job VisualizationGui Visualization SketchGui Sketch When you register a toolset you must specify in the registerToolset method in which locations the menu bar the toolbar or the toolbox the toolset creates the widget If you omit a toolset location flag the GUI for that toolse
179. s module The constructor takes a single string argument By convention the string argument uses all capital letters with an underscore between words and the variable name is the same as the string argument For example from symbolicConstants import SymbolicConstant AS IS SymbolicConstant AS IS In the case of symbolic constant keywords you can use a value of zero or the value of the ID ofa symbolic constant for the message ID Symbolic constants have a unique integer ID that is used to set the value of symbolic constant keywords along with a string representation that is used in the generation of the command To access the integer ID of a symbolic constant use its getId method If the keyword is connected to a list or combo box widget you should use a value of zero for the ID in the widget constructor The AFXList AFXComboBox and AFXListBox widgets have been designed to handle symbolic constant keywords as targets When items are added to a list or combo box a symbolic constant s ID is passed in as user data These widgets react by setting their value to the item whose user data matches the value of their target as opposed to setting their value to the item whose index matches the target s value The following example illustrates how a combo box can be connected to a symbolic constant keyword combo AFXComboBox hwGb 18 4 Highlight method mode highlightMethodHintKw 0 combo appendItem Hardware Overlay HARDWARE OVERLAY getI
180. s module proxy object instead ofthe abaqusGui proxy object However internally the query is always registered on the abaqusGui proxy object The two kinds of proxy objects are not always perfectly synchronized In most cases this 6 24 RECEIVING NOTIFICATION OF KERNEL DATA CHANGES will not matter However it can cause a problem if the query is registered while a change is being made on the kernel For example from kernelAccess import mdb def onPartsChanged print The parts repository changed keys mdb models Model 1 parts keys OK print The new keys are keys if keys mdb models Model 1 parts keys 0 registerQuery onPartsChanged Not OK Internally the registerQuery method will be called on abaqusGui mdb mdb models Model 1 l parts registerQuery onPartsChanged If a changeKey command that affects the names in the parts repository is subsequently issued the above example will fail The keys part names are obtained using the kernelAccess mdb proxy object and contain the changed name However the registerQuery method based on the abaqusGui proxy object does not see the new names until the changeKey command is completed The registerQuery on the newly named part object using keys 01 is being called within the callback before the changeKey command is completed and the callback is using the new name Since the abaqusGui proxy for the parts repository has not yet been updated a Keyerror is raised
181. s state up to date based on the state of the application This section describes how ORGANIZATION OF THE Abaqus GUI Toolkit USER S MANUAL those tasks are accomplished using the Abaqus GUI Toolkit and the two types of commands in Abaqus CAE kernel commands and GUI commands Modes A mode is a mechanism for gathering input from the user processing that input and then issuing a command to the kernel This section describes the modes that are available in the Abaqus GUI Toolkit Creating a GUI module This section describes how you can create a GUI module Creating a GUI toolset This section describes how you can create a GUI toolset Customizing an existing module or toolset The previous sections describe how you can create a new module or toolset Alternatively the Abaqus GUI Toolkit allows you to derive a new module or toolset from an existing module or toolset and to add or remove functionality from it Creating an application This section explains how to create an application such as Abaqus CAE It also describes the high level infrastructure that is responsible for running the application The application object This section describes the Abaqus application object The application object manages the message queue timers chores GUI updating and other system facilities The main window This section describes the layout components and behavior of the Abaqus main window Customizing the main window The main wi
182. se AFXObj ectKeyword in procedures that require picking For more information see Picking in procedure modes Section 7 5 6 20 ACCESSING KERNEL DATA FROM THE GUI 6 5 16 Defaults objects A defaults object can be used to restore the values of the keywords in a command to their default values when the user presses the Defaults button in the dialog box You can register a defaults object with a command as follows self registerDefaultsObject cmd session defaultGraphicsOptions In addition the AFXGuiCommand class has a setKeywordValuesToDefaults method that you can use to initialize the state of all keywords in a command In most cases you use the setKeywordValuesToDefaults method to initialize the state of all keywords in the getFirstDialog method of the mode As a result the application will initialize the value of the keywords in a command each time the dialog box is posted If no defaults object is specified the command uses the default values specified in the keyword s constructor when the user presses the Defaults button in the dialog box 6 6 AFXTargets Targets are similar to keywords in that they automatically keep their data synchronized with the GUI however targets do not participate in command processing Targets are typically used to monitor the value of some widget in the GUI that is not directly related to a command for example selecting the type of load to create from the Create Load dialog box The fo
183. se transitions can be described as follows e If the value of the render style keyword equals WIREFRAME send the Show dotted lines button an ID DISABLE message e Ifthe value of the render style keyword equals WIREFRAME send the Show edges in shaded button an ID DISABLE message e Ifthe value of the render style keyword equals WIREFRAME send the Show silhouette edges button an ID ENABLE message You can write these transitions with the Abaqus GUI Toolkit as follows self addTransition form renderStyleKw AFXTransition EQ WIREFRAME getId showDottedBtn MKUINT FXWindow ID DISABLE SEL COMMAND None self addTransition form renderStyleKw AFXTransition EQ WIREFRAME getId showEdgesBtn MKUINT FXWindow ID DISABLE SEL COMMAND None self addTransition form renderStyleKw AFXTransition EQ WIREFRAME getId showSilhouetteBtn MKUINT FXWindow ID ENABLE SEL COMMAND None You can also pass additional user data to the object using the last argument of the addTransition method Figure 5 8 shows an example that uses transitions to control how the application stipples widgets 5 6 6 Updating your GUI If the GUI behavior of your dialog box cannot be described in terms of simple transitions for example if you need to stipple a button based on the setting of two other buttons you can use the processUpdates method to update your GUI The processUpdates method is called during each GUI update cycle so you should not do anyth
184. sing the table s getItemIntValue or getItemFloatValue methods you should be sure that the type of the item that you are reading is INT or FLOAT respectively or the wrong value may be returned In general you should make use of the AFXTableKeyword and set the column types so that the table s values are automatically evaluated correctly 3 6 7 List type If you want to allow the user to specify a value in a column by selecting from a list of items you must first set the column to be of type LIST You then create a list and assign it to that column When the user clicks on an item in that column the table will display a noneditable combo box that contains the entries from the list The following example illustrates how you can create a combo box within a table cell vf FXVerticalFrame gb FRAME SUNKEN FRAME THICK 0 0 0 0 0 0 0 0 table AFXTable vf 4 2 4 2 None 0 AFXTABLE NORMAL AFXTABLE EDITABLE table setLeadingRows 1 table setLeadingRowLabels Size tQuantity 3 24 TABLE WIDGET table showHorizontalGrid True table showVerticalGrid True listId table addList Small tMedium tLarge table setColumnType 0 AFXTable LIST table setColumnListId 0 listId Medium Figure 3 26 combo box within a table cell You can also add list items that contain icons using the appendListItem method of the table icon createGIFIcon myIcon gif table appendListItem listId Extra large icon When y
185. ss it a tuple keyword The addPointKeyIn method posts a text field on the prompt line The type of the keyword passed into the addPointKeyIn method determines what values are collected from the user for example two or three values and whether those values are float or integer types For example in the constructor of your procedure you could define an additional keyword as shown in the following code self pointKwl AFXObjectKeyword self cmd point True self pointKw2 AFXTupleKeyword self cmd point True 3 3 AFXTUPLE TYPE FLOAT In one of the steps of your procedure you could add a key in option as shown below step AFXPickStep self self pointKwl Select a point AFXPickStep POINTS step addPointKeyIn self pointKw2 Ifa step has a key in text field the user enters some values in the text field and the user commits the values by pressing Enter those values will be used in the command Alternatively if a step has a key in 7 19 PICKING IN PROCEDURE MODES text field and the user selects an entity in the viewport that entity will be used in the command regardless of whether anything was typed in the text field The mode automatically takes care of deactivating whichever keyword needs to be deactivated based on these rules In the previous example if the user types in a point 5 will be deactivated and se f pointKw2 will be activated In addition self pointKw2 will contain the value entered by the user
186. ss methods perform additional processing necessary to make the mode function properly 7 2 MODE PROCESSING activate gt verifyKeywordValues getFirstStep Dialog f Y v gt Get user input N doCustomChecks More N steps Y Y verifyCurrentKeywordValues N getCommandString Y Y sendCommandString N doCustomChecks Y handleException Y N doCustomTasks N Y getNextStep Dialog deactivate or Loop Figure 7 1 The mode processing sequence 7 2 3 Step and dialog box processing After a mode is activated it cycles through a sequence of events collecting inputs from the user and verifying the inputs After the user commits each step or dialog box the mode calls the following methods verifyCurrentKeywordValues The verifyCurrentKeywordValues method calls the verify method for each keyword associated with the current step or dialog box and the method posts an error dialog box if necessary The verifyCurrentKeywordValues method returns True if no errors were encountered otherwise it returns False and terminates further processing MODE PROCESSING doCustomChecks The doCustomChecks method has an empty implementation in the base class You can redefine this method to perform any additional checking of keyword values typically to perform range checking
187. stered is the order in which the modules will appear in the Module combo box in the context bar 14 3 THE Abaqus CAE MAIN WINDOW To register a module you call the registerModule method The registerModule method takes the following arguments displayedName A string that the application will display in the Module combo box in the context bar modulelmportName A string that specifies the name of the module to be imported It is your responsibility to ensure that this name is the same as your GUI module file name without the py extension For more information see Instantiating the GUI module Section 8 2 8 kernellnitializationCommand A string that specifies the name of the Python command sent to the kernel when the module is loaded 14 4 APPENDIX A ICONS Appendix A Icons The Abaqus GUI Toolkit supports the following formats for creating icons XPM e BMP e GIF e PNG You can use most image editing programs to produce icon images in one of the supported formats After you have created the image file you construct the icon by calling the appropriate method as shown in the following example icon afxCreatePNGIcon myIcon png FXLabel self A label with an icon icon In some cases you may need to call the icon s create method before using it in a widget In the previous example it is not necessary to call the icon s create method because the label widget creates the icon when the label is cr
188. t sections 11 2 Startup script Every application is started from a short startup script The startup script performs the following tasks e Initializes an application object The application object is responsible for high level functions such as managing message queues and timers and updating the GUI and controlling the main window It is not a visible object STARTUP SCRIPT Startup script Starts the application from the command line 1 Application object Interacts with window manager controls main window 1 Main window GUI Infrastructure main menus toolbar toolbox etc T GUI Modules Toolsets Functionality grouped by task e g Part module Datum toolset 1 Modes Responsible for gathering user input processing commands Dialogs prompts User input mechanisms 1 Widgets GUI controls buttons text fields lists etc Figure 11 1 An overview of GUI code e Instantiates a main window The main window is what the user sees when the application is first started and provides access to all of the application s functionality e Creates and runs the application Once the application is run it enters an event loop where it waits to react to user input such as the click of a mouse The following illustrates a typical startup script from abaqusGui import import sys from caeMainWindow import CaeMainWindow Define a custom callback myStartupCB that will be invoked once the application has finished its startup
189. t will not appear in that location The table below shows the class name for each of the Abaqus CAE toolsets along with the flags that indicate the locations in which the toolset creates the widgets You can import these class names from abaqusGui To register the plug in toolset you call registerPluginToolset you do not use the registerToolset method When you unregister a toolset you must use the name shown in the table as the argument to the module s unregisterToolset method Class name Name Toolset locations AmplitudeToolsetGui Amplitude GUI IN TOOL PANE AnnotationToolsetGui Annotation GUI IN MENUBAR GUL IN TOOLBAR CanvasToolsetGui Canvas GUI IN MENUBAR CustomizeToolsetGui Customize GUI IN TOOL PANE DatumToolsetGui Datum GUI IN TOOLBOX GUI IN TOOL PANE 10 2 MODIFYING AND ACCESSING Abaqus CAE GUI MODULES AND TOOLSETS Class name Name Toolset locations EditMeshToolsetGui Mesh Editor GUI IN TOOLBOX GUI IN TOOL PANE FileToolsetGui File GUI IN MENUBAR GUI IN TOOLBAR HelpToolsetGui Help GUI IN MENUBAR GUI IN TOOLBAR ModelToolsetGui Model GUI IN MENUBAR PartitionToolsetGui Partition GUI IN TOOLBOX GUI IN TOOL PANE QueryToolsetGui Query GUI IN TOOLBAR GUI IN TOOL PANE RegionToolsetGui Region GUI IN TOOL PANE RepairToolsetGui Repair GUI IN TOOLBOX GUI IN TOOL PANE SelectionToolsetGui Selection GUI IN TOOLBAR TreeToolsetGui Tree
190. tes in value mode Use this when the keyword is connected to a text field list combo box or spinner gt 0 Keyword operates in option mode Use this when the keyword is connected to a radio button AFXFloatKeyword 0 Keyword operates in value mode AFXStringKeyword 0 Keyword operates in value mode AFXBoolKeyword 0 Keyword operates in value mode This keyword should be used only with widgets that allow only Boolean values such as FXCheckButton AFXSymConstKeyword 0 Keyword operates in value mode Use this value when the keyword is connected to a list or combo box 70 Keyword operates in option mode Use the value of the Symbolic Constant s ID when the keyword is connected to a radio button Do not use this keyword with FXCheckButton AFXTupleKeyword 0 Keyword operates in value mode Use this value when the entire tuple is gathered from a single widget 1 Keyword operates in value mode for only the nth 2 element of the tuple where n ID Use this value when 3 the input for each element is gathered from separate widgets GUI COMMANDS Keyword ID Description AFXTableKeyword 0 Keyword operates in value mode AFXObjectKeyword 0 Keyword operates in value mode 6 5 11 Boolean integer float and string keyword examples The following statements illustrate the use of Boolean integer float and string keywords Boolean keyword with a checkbox FXCheckButton self Show node labels mode nodeLabelsKw
191. the input constructs the command and sends the command to the kernel If there is an exception thrown by the kernel the mode will handle the exception The mode processing sequence is shown in Figure 7 1 To provide custom processing in your mode you can overwrite many of the methods shown in Figure 7 1 If you overwrite a method you should use the exact same prototype for your method including the same default values that the method may have Refer to the Abaqus GUI Toolkit Reference Manual to determine the prototype of a method 7 2 2 Activating a mode A mode is usually activated by sending it a message with its ID set to ID ACTIVATE and a type of SEL COMMAND This message causes the activate method of the mode to be called For more information see Targets and messages Section 6 5 4 If you need to do any processing before a mode begins to collect input from the user you can redefine the activate method For example you can check that the current viewport contains a part before beginning a mode that requires the user to pick something on a part as shown in the following method def activate self if getDisplayedObjectType PART AFXForm activate self else ShowAFXErrorDialog getAFXApp getAFXMainWindow A part must be displayed in the current viewport If you write your own activate or deactivate method you must call the base class version of that method if no error conditions are encountered The base cla
192. the scanner mode The progress bar has several different modes as shown in Figure 3 36 3 8 The create method Most widgets in the Abaqus GUI Toolkit employ a two stage creation process In the first stage the widget constructor builds the data structures for the widget In the second stage the toolkit calls the widget s create method The create method constructs all the windows required by the widget so that the widget can be displayed on the screen In most cases the application startup script first calls the constructors of all the widgets required to build the initial structure of an application by constructing the main window The script then calls the 3 36 WIDGETS AND FONTS Scanner Mode Percentage Mode 3496 Iterator Mode mt Figure 3 36 Three modes of the progress bar widget application object s create method This call traverses the entire widget hierarchy calling the create method of each widget For more information and an example script see Startup script Section 11 2 If you create widgets after the startup script has called the application s create method the create method must be called on those new widgets otherwise they will not be visible on the screen If your dialog box is posted by a form or by a procedure the infrastructure calls the create method on the dialog box However if you post a dialog box yourself you must call the create method on the dialog box
193. the settings of all the children of the branch if the branch is toggled off all the children are toggled off and vice versa For example tree AFXOptionTreeList parent 6 tree addItemLast Item 1 item tree addItemLast Item 2 item addItemLast Item 3 item addItemLast Item 4 item addItemLast Item 5 1 w 2 3 Iv Item 4 5 Figure 3 20 example of an option tree list AFXOptionTreeList 3 6 Table widget The AFXTable widget arranges items in rows and columns similar to a spreadsheet The table can have leading rows and columns which serve as headings Figure 3 21 shows an example of how the Abaqus GUI Toolkit lays out a table TABLE WIDGET leading row x Y 1 2 3 items leading column Figure 3 21 The layout of a table The AFXTable widget has many options and methods that allow a lot of flexibility when you are trying to configure a table for specific purposes These options and methods are discussed in the following sections The following topics are covered e Table constructor Section 3 6 1 e Rows and columns Section 3 6 2 e Spanning Section 3 6 3 e Justification Section 3 6 4 e Editing Section 3 6 5 Types Section 3 6 6 ist type Section 3 6 7 e Boolean type Section 3 6 8 e Icon type Section 3 6 9 e Color type Section 3 6 10 e Popup menu Section 3 6 11 e Colors Section 3 6 12 e
194. the user Presenting only one module makes the interface less complicated because the interface shows fewer GUI controls and allows the user to focus on one major task at a time Abaqus is designed to manipulate modules by swapping in one module s GUI while swapping out the previous module s GUI when requested by the user Toolsets are similar to modules in that they group functionality into logical units However toolsets generally contain less functionality than modules because toolsets focus on one particular task for example partitioning Toolsets can be used in more than one module 14 2 The Abaqus CAE main window This section describes how you can create an application by deriving a new class from the AFXMainWindow class and registering the modules and toolsets used by your application The following topics are covered e Main window example Section 14 2 1 Importing modules Section 14 2 2 e Constructing the base class Section 14 2 3 Registering persistent toolsets Section 14 2 4 e Registering modules Section 14 2 5 THE Abaqus CAE MAIN WINDOW 14 2 1 Main window example To create a main window for a particular application you start by deriving a new class from the AFXMainWindow class In the constructor of the main window you register the modules and toolsets used by your application The following script constructs the Abaqus CAE main window The script is described in detail in the f
195. thout ever invoking the GUI Typically when you develop some custom functionality you start by creating the kernel commands that implement that functionality These commands can be debugged by executing them from the command line interface CLI in Abaqus CAE Once you have determined that the kernel commands are working correctly from the CLI you can design a GUI to collect the user inputs needed by your commands What are the components of an Abaqus GUI application There are many components involved in creating a GUI application Figure 2 1 shows an overview of these components and how they are connected This section provides a brief overview of each component The components are discussed in more detail in subsequent chapters Widgets At the lowest level of an application you use widgets to collect input from the user through a graphical user interface For example a text field widget presents a box into which the user can type numbers Similarly a check button widget presents a small box that the user can click on to toggle an option on or off Layout managers Layout managers arrange widgets by providing alignment options For example a horizontal frame arranges widgets in a row A vertical frame arranges widgets in a column 2 1 WHAT ARE THE COMPONENTS OF AN Abaqus GUI APPLICATION S File Model viewport View Job Adaptivity Co execution Optimization Tools Plug ins Help x
196. tinue button message handler is not found the dialog attempts to call the OK button message handler As a result you do not need to do anything in your script to get this behavior However if you have special double click processing needs you can turn off this double click behavior by specifying AFXLIST NO AUTOCOMMIIT as of the list s option flags If you turn off the double click behavior you must catch the SEL DOUBLECLICKED message from the list in your dialog box and handle it appropriately Note Because the list may be used in combination with other types of widgets the list does not draw a border around itself As a result if you want a border around the list you must provide the border by placing the list inside some other widget such as a frame If you do not want a horizontal scrollbar use the HSCROLLING OFF flag this flag forces the list to size its width to fit its widest item The following is an example of a list within a vertical frame vf FXVerticalFrame parent FRAME THICK FRAME SUNKEN 0 0 0 0 0 0 O list AFXList vf 3 tgt sel LIST BROWSESELECT HSCROLLING OFF list appendItem Thin list appendItem Medium list appendItem Thick Thin Medium Thick Figure 3 14 An example of a list with a frame from AFXList 3 3 2 Combo boxes AFXComboBox provides one of many selection from its items AFXComboBox combines a read only text field with a drop down list After the parent argument
197. tions generated by the kernel command To switch to a GUI module using a script you can use the switchModule method For example if you want to switch to your module upon application startup you can add the following line to the application startup file switchModule My Module This line should appear just before the app run statement You can use the setSwitchModuleHook function method to set a callback function that will be invoked when the user switches into a GUI module Every time the user switches into a GUI module your function will be called and the name of the module will be passed into the function For example def onModuleSwitch moduleName if moduleName Part Do part module tasks elif moduleName Mesh Do mesh module tasks etc setSwitchModuleHook onModuleSwitch GUI TOOLSET EXAMPLE 9 Creating a GUI toolset Toolsets are similar to modules except that they can be used in more than one module Toolsets typically have less functionality than modules because toolsets specialize in performing a specific task such as partitioning This section describes how you can create a GUI toolset The following topics are covered e An overview of creating a GUI toolset Section 9 1 e GUI Toolset example Section 9 2 e Creating toolset components Section 9 3 e Registering toolsets Section 9 4 9 1 An overview of creating a GUI toolset To create a new GUI toolset you must f
198. tively About SIMULIA SIMULIA is the Dassault Systemes brand that delivers a scalable portfolio of Realistic Simulation solutions including the Abaqus product suite for Unified Finite Element Analysis multiphysics solutions for insight into challenging engineering problems and lifecycle management solutions for managing simulation data processes and intellectual property By building on established technology respected quality and superior customer service SIMULIA makes realistic simulation an integral business practice that improves product performance reduces physical prototypes and drives innovation Headquartered in Providence RI USA with R amp D centers in Providence and in V lizy France SIMULIA provides sales services and support through a global network of regional offices and distributors For more information visit www simulia com About Dassault Systemes As a world leader in 3D and Product Lifecycle Management PLM solutions Dassault Syst mes brings value to more than 100 000 customers in 80 countries A pioneer in the 3D software market since 1981 Dassault Systemes develops and markets PLM application software and services that support industrial processes and provide a 3D vision of the entire lifecycle of products from conception to maintenance to recycling The Dassault Systemes portfolio consists of CATIA for designing the virtual product SolidWorks for 3D mechanical design DELMIA for virtual product
199. ton 1 Button 2 Button 3 Figure 4 1 An example of a vertical frame from FXVerticalFrame 4 4 Vertical alignment for composite children The AFXVerticalAligner widget is designed to align children that contain multiple children AFXVerticalAligner does the following 1 Finds the maximum width of the first child of each of its children 2 Sets the width of all the first children to the maximum width For example va AFXVerticalAligner parent AFXTextField va 16 Name AFXTextField va 16 Address AFXTextField va 16 Phone Number 4 3 GENERAL PURPOSE LAYOUT MANAGERS 4 5 Name f Address E Phone Number f Figure 4 2 An example of vertical alignment from AFXVerticalAligner General purpose layout managers The Abaqus GUI Toolkit includes three general purpose layout managers that have similar layout capabilities FXPacker FXPacker is a general purpose layout manager AFXDialog AFXDialog provides similar capabilities to FXPacker As a result you do not need to provide a top level layout manager as the first child in a dialog box you can use the layout capabilities of the dialog box instead FXGroupBox FXGroupBox provides the same capabilities as FXPacker In addition FXGroupBox can display a labeled border around its children Abaqus CAE uses the FRAME GROOVE flag to produce a thin border around the children of the group box For example gb FXGroupBox parent Render Style F
200. ts are always up to date because accessing them calls the kernel object synchronously creating inter process communication IPC traffic This immediate interaction with the kernel creates a performance disadvantage when you use the kernelAccess proxy objects instead of the abaqusGui module proxy objects For example call the get Volume method of the Part object from kernelAccess import mdb session partNames mdb models Model 1 parts keys v mdb models Model 1 parts Part 1 getVolume This procedure involves GUI kernel communication via the IPC mechanism so it is not recommended for use where performance is a concern In other words you should only use this procedure for accessing data or calling methods that do not take a long time to execute If performance does become a problem you can access the mdb and session objects from the abaqusGui module instead of the kernelAccess module Although you can import the kernelAccess module in a script that is executed before the application startup script has completed you cannot query the mdb and session objects until the application startup script has completed In other words you can import the kernelAccess module in your scripts in code that is executed during the initial construction of the GUI however you should not attempt to access either the mdb or session object until it is needed because of some user interaction in the GUI For more information see Startup script S
201. ts with both the FX and AFX prefix for example FXTable and AFXTab1e you should use the AFX version since it provides enhanced functionality for building applications using Abaqus Organization of the Abaqus GUI Toolkit User s Manual This manual is organized by functionality and is designed to guide developers through the process of writing an application by explaining how to use the components of the toolkit and by providing snippets of example code A separate Abaqus GUI Toolkit Reference Manual that contains an alphabetical listing of all of the toolkit calls is provided The Abaqus GUI Toolkit is based on the FOX GUI toolkit While this manual explains some of the basic concepts of the FOX toolkit it does not provide details for many other aspects of the FOX toolkit For more details on the FOX GUI toolkit refer to the FOX web site This manual consists of the following sections Widgets This section describes some of the most commonly used widgets in the Abaqus GUI Toolkit Layout managers This section describes how to use the various layout managers in the Abaqus GUI Toolkit to arrange widgets in a dialog box Dialog boxes This section describes the dialog boxes that you can create using the Abaqus GUI Toolkit Commands In an application that employs a graphical user interface the interface must collect input from the user and communicate that input to the application In addition the graphical user interface must keep it
202. ucture of children that can be expanded and collapsed The FXTreeList constructor is defined by the following prototype FXTreeList p nvis tgt None sel 0 opts TREELIST NORMAL x 0 y 0 w 0 h 0 The arguments to the FXTreeList constructor are described in the following list parent The first argument in the constructor is the parent An FXTreeList does not draw a frame around itself therefore you may want to create an FXVerticalFrame to use as the parent of the tree You should zero out the padding in the frame so that the frame wraps tightly around the tree number of visible items The number of items that will be visible when the tree is first displayed target and selector You can specify a target and selector in the tree constructor arguments opts The option flags that you can specify in the tree constructor are shown in the following table Option flag Effect TREELIST NORMAL default TREELIST EXTENDEDSELECT TREELIST EXTENDEDSELECT Extended selection mode allows the user to drag select ranges of items TREELIST SINGLESELECT Single selection mode allows the user to select up to one item TREELIST BROWSESELECT Browse selection mode enforces one single item to be selected at all times TREELIST MULTIPLESELECT Multiple selection mode is used for selection of individual items TREELIST AUTOSELECT Automatically select under cursor 8 14 TREE WIDGETS Option flag Effect TREELIST SHOWS LINES Show
203. uld define its own ID LAST as the last ID in the derived class A class that derives from the derived class will then be able to make use of that ID to begin its numbering ID LAST should not be used by any widget The only purpose of ID LAST is to provide an automatic numbering scheme between classes The example continues by constructing a message map by adding entries using the FXMAPFUNC function In this example when a message of type SEL COMMAND and an ID of ID 1 or ID 2 is received the script calls the onCmdPrintMsg method The two button widgets have their target set to self MyClass However when each widget sends a message the widget sends a different message ID and the message handler checks the ID to determine who sent the message For example if the user clicks the first button the button sends a ID 1 SEL COMMAND message to MyClass The class s message map routes that message to the onCmdPrintMsg method The onCmdPrintMsg method checks the ID of the incoming message and prints Button 1 was pressed It is important that your message handlers return the proper value to ensure that the GUI is kept up to date Returning a 1 in a message handler tells the toolkit that the message was handled In turn if a message is handled the toolkit assumes that something may have changed that requires an update and the toolkit initiates a GUI update process Returning a 0 in a message handler tells the toolkit that the message was not handled ther
204. umBlue FXRGB 0 0 205 MediumOrchid FXRGB 186 85 211 MediumOrchid1 FXRGB 224 102 255 MediumOrchid2 FXRGB 209 95 238 MediumOrchid3 FXRGB 180 82 205 MediumOrchid4 FXRGB 122 55 139 MediumPurple FXRGB 147 112 219 MediumPurplel FXRGB 171 130 255 MediumPurple2 FXRGB 159 121 238 MediumPurple3 FXRGB 137 104 205 MediumPurple4 FXRGB 93 71 139 MediumSeaGreen FXRGB 60 179 113 APPENDIX B COLORS AND RGB VALUES String RGB value MediumSlateBlue MediumSpringGreen MediumTurquoise MediumVioletRed MidnightBlue MintCream MistyRose MistyRose1 MistyRose2 MistyRose3 MistyRose4 Moccasin NavajoWhite NavajoWhite1 NavajoWhite2 NavajoWhite3 NavajoWhite4 Navy NavyBlue None OldLace OliveDrab OliveDrab1 OliveDrab2 OliveDrab3 OliveDrab4 Orange Orangel FXRGB 123 104 238 FXRGB 0 250 154 FXRGB 72 209 204 FXRGB 199 21 133 FXRGB 25 25 112 FXRGB 245 255 250 FXRGB 255 228 225 FXRGB 255 228 225 FXRGB 238 213 210 FXRGB 205 183 181 FXRGB 139 125 123 FXRGB 255 228 181 FXRGB 255 222 173 FXRGB 255 222 173 FXRGB 238 207 161 FXRGB 205 179 139 FXRGB 139 121 94 FXRGB 0 0 128 FXRGB 0 0 128 FXRGB 0 0 0 0 FXRGB 253 245 230 FXRGB 107 142 35 FXRGB 192 255 62 FXRGB 179 238 58 FXRGB 154 205 50 FXRGB 105 139 34 FXRGB 255 165 0 FXRGB 255 165 0 APPENDIX B COLORS AND RGB VALUES String RGB value Orange2 FXRGB 238 154 0 Orange3 FXRGB 205 133 0 Or
205. urbo 1 cae If the name of the current model database including the path exceeds 50 characters the name will be abbreviated by showing only the first and last 25 characters separated by If you do not want the default title processing you can override it by specifying a title in the AFXMainWindow constructor If you specify a title in the AFXMainWindow constructor the Abaqus GUI Toolkit ignores the arguments in the application constructor and uses the title specified The model database name and the name of the current viewport when maximized will continue to be shown in the title bar even if you override the default title processing You can access the string shown in the window title bar using the following statement title getAFXApp getAFXMainWindow getTitle 13 3 TOOLBARS 13 3 The menu bar The menu bar consists of the following three areas Persistent toolset menus Module menus Help menu The persistent toolset menus and the help menu are shown when the application is first started and they remain visible throughout the user s session The module menus reflect the current module and are swapped in and out as the user visits the various modules You can access the menu bar using the following statement menubar getAFXApp getAFXMainWindow getMenubar 13 4 Toolbars By default Abaqus CAE displays all of the toolbars in a row underneath the main menu bar as shown in Figure 13 2
206. ure 3 19 An example of a tree widget You can also specify icons to be used for each tree item The open icon is displayed next to an item when it is selected the closed icon is displayed when the item is not selected These icons are not associated with the expanded collapsed state of a branch For example Microsoft s Windows Explorer uses open and closed folder icons to show the selected state You can check if an item is selected using the tree s isItemSelected method The tree widget will send its target a SEL COMMAND message whenever the user clicks on an item You can handle this message and then traverse all the items in the tree to find the selected item The following example uses a message handler that assumes that the tree is browse select and allows the user to select only one item at a time def onCmdTree self sender sel ptr w self tree getFirstItem while if self tree isItemSelected w Do something here based on the selected item w break if w getFirst w w getFirst continue while not w getNext and w getParent w w getParent w w getNext 3 16 TABLE WIDGET 3 5 2 Option tree list The AFXOptionTreeList widget provides a tree structure of children that can be toggled The tree structure includes branches along with leaves at the end of a branch The user can toggle the leaves of the tree on or off The user can also toggle the entire branch on or off The toggle controls
207. utton hf Fast wireframe form dragModeKw FAST getId 5 14 DATA DIALOG BOXES Graphics Options Eq Hardware Driver OpenGL C x11 Use double buffering Use display lists View Manipulation Drag mode C Fast wireframe As is Auto fit after rotations OK E Defaults Figure 5 7 Graphics Options data dialog box FXRadioButton hf As is form dragModekw AS IS getId FXCheckButton gb Auto fit after rotations form autoFitKw 5 6 5 Transitions Transitions provide a convenient way to change the GUI state in a dialog box Transitions are used to stipple widgets or to rotate regions when some other control in the dialog box is activated If the behavior in your dialog box can be described in terms of simple transitions you can use the addTransition method to produce the state changes Transitions compare the value of a keyword with a specified value If the operator condition is met a message is sent to the specified target object Transitions have the following prototype addTransition keyword operator value tgt sel ptr For example when the user selects Wireframe as the render style in the Part Display Options dialog box Abaqus CAE does the following Stipples the Show dotted lines in hidden render style button Stipples the Show edges in shaded render style button Checks the Show silhouette edges button DATA DIALOG BOXES The
208. veGreen2 FXRGB 188 238 104 DarkOliveGreen3 FXRGB 162 205 90 DarkOliveGreen4 FXRGB 110 139 61 DarkOrange FXRGB 255 140 0 DarkOrangel FXRGB 255 127 0 DarkOrange2 FXRGB 238 118 0 DarkOrange3 FXRGB 205 102 0 DarkOrange4 FXRGB 139 69 0 DarkOrchid FXRGB 153 50 204 DarkOrchidl FXRGB 191 62 255 DarkOrchid2 FXRGB 178 58 238 DarkOrchid3 FXRGB 154 50 205 DarkOrchid4 FXRGB 104 34 139 DarkRed FXRGB 139 0 0 DarkSalmon FXRGB 233 150 122 DarkSeaGreen FXRGB 143 188 143 DarkSeaGreenl FXRGB 193 255 193 DarkSeaGreen2 FXRGB 180 238 180 DarkSeaGreen3 FXRGB 155 205 155 DarkSeaGreen4 FXRGB 105 139 105 DarkSlateBlue FXRGB 72 61 139 DarkSlateGray FXRGB 47 79 79 APPENDIX B COLORS AND RGB VALUES String RGB value DarkSlateGray1 DarkSlateGray2 DarkSlateGray3 DarkSlateGray4 DarkSlateGrey DarkTurquoise Dark Violet DeepPink DeepPink1 DeepPink2 DeepPink3 DeepPink4 DeepSkyBlue DeepSkyBlue1 DeepSkyBlue2 DeepSkyBlue3 DeepSkyBlue4 DimGray DimGrey DodgerBlue DodgerBlue1 DodgerBlue2 DodgerBlue3 DodgerBlue4 Firebrick Firebrick1 Firebrick2 Firebrick3 FXRGB 151 255 255 FXRGB 141 238 238 FXRGB 121 205 205 FXRGB 82 139 139 FXRGB 47 79 79 FXRGB 0 206 209 FXRGB 148 0 211 FXRGB 255 20 147 FXRGB 255 20 147 FXRGB 238 18 137 FXRGB 205 16 118 FXRGB 139 10 80 FXRGB 0 191 255 FXRGB 0 191 255 FXRGB 0 178 238 FXRGB 0 154 205 FXRGB 0 104 139 FXRGB 105 105 105 FXRGB 105 105 1
209. with pick steps in the same order as the pick steps in which the keywords are used 7 16 PICKING IN PROCEDURE MODES For example if you have two pick steps you must create the keyword passed into the first pick step before you create the second keyword which is passed into the second pick step Creating the keywords associated with pick steps in the same order as the pick steps in which the keywords are used ensures that the necessary setup commands are issued in the proper order for the command to work correctly You can specify many parameters when picking items from the viewport You specify some of these parameters in the AFXPickStep constructor and you specify other parameters by calling various methods of the pick step To construct a pick step you must at least supply the following A procedure An object keyword A prompt for the prompt line A bit flag or flags specifying which type of entities may be picked The following example shows how you can write a pick step class MyProcedure AFXProcedure def init self owner AFXProcedure init self owner self cmd AFXGuiCommand self myMethod myObject self nodeKw AFXObjectKeyword self cmd node True def getFirstStep self return AFXPickStep self self nodeKw Select a node AFXPickStep NODES Optional parameters in the constructor allow you to specify the following Whether the user should pick one entity or one or more entities AFXPickStep ONE
210. word example Section 6 5 15 Defaults objects Section 6 5 16 Constructing GUI commands GUI COMMANDS You use the AFXGuiCommand class to construct a GUI command The AFXGuiCommand class takes the following arguments mode Modes are activated through a control in the GUI typically a menu button Once a mode is activated it is responsible for gathering user input processing the input sending a command and performing any error handling associated with the mode or the commands it sends For a detailed discussion of modes see Chapter 7 Modes The Abaqus GUI toolkit provides two modes Form modes Form modes provide an interface to dialog boxes Form modes gather input from the user using one or more dialog boxes Procedure modes Procedure modes provide an interface that guides the user through a sequence of steps by prompting for input in the prompt area of the application method A String specifying the method of the kernel command objectName A String specifying the object of the kernel command GUI COMMANDS registerQuery A Boolean specifying whether or not to register a query on the object For example the following statement creates a command to edit graphics options cmd AFXGuiCommand self setValues session graphicsOptions True If you have more than one GUI command in a mode the commands are processed in the same order in which they are created in the mode For more examples
211. y Conversely when the application state is updated the widget connected to the data target is updated automatically As described in Automatic GUI updating Section 6 5 5 widgets can be in a push state or a pull state Push state In a push state the widgets are collecting and sending user input to the application Figure 6 3 illustrates how a data target works with a widget that is in a push state The sequence is as follows 1 First the user enters a value of 7 in the text field and then presses Enter 2 This triggers the text field widget to send an ID SEL COMMAND message to its target the data target 3 The data target responds by sending the sender the text field widget a message requesting the value in the text field The data target uses that value to update the value of its data ID SEL COMMAND Z Data Target data ID_GETINTVALUE SEL_COMMAND data The user enters a value into the text field Figure 6 3 A data target with a text field widget in push state Pull state In a pull state the widgets are interrogating the application to keep up to date Figure 6 4 illustrates how a data target works with a widget that is in a pull state The sequence is as follows 1 When the GUI is idle it initiates a GUI update 2 The GUI update triggers each widget to sendan ID SEL UPDATE message to its target 3 In this case the data target responds by sending the sender the text field widget a messa
212. yKw argument using the AFXBoolKeyword method If the user clicks OK the file selection dialog box automatically updates the fileNameKw and readOnlyKw arguments In addition when the dialog box is posted it will set the current directory based on the path of the fileNameKw argument This means that the dialog box remembers the last directory visited by the user when the application posts the dialog box again The following flags are available for the opts argument AFXSELECTFILE EXISTING Allows the selection of an existing file only COMMON DIALOG BOXES AFXSELECTFILE_MULTIPLE Allows the selection of multiple existing files only AFXSELECTFILE_DIRECTORY Allows the selection of an existing directory only AFXSELECTFILE_REMOTE_HOST Allows the opening of files on a remote host You specify the patterns argument as a series of patterns separated by n The value of the target specified by the patternIndexTgt argument determines which pattern is initially shown when the dialog box is posted The following is an example of how a file selection dialog box can be posted from a form def getFirstDialog self patterns Output Database odb nAll Files db AFXFileSelectorDialog self Open ODB self nameKw self readOnlyKw AFXSELECTFILE EXISTING patterns self patternIndexTgt db setReadOnlyPatterns odb self setModal True return db The following is an example of how a directory selection dialog box can be posted f
213. yout manager centers the widget in the X or Y direction in the parent The manager adds extra spacing around the widget to place it at the center of the space available to it The widget s size will be its default size unless you specify LAYOUT FIX WIDTH or LAYOUT FIX HEIGHT e LAYOUT FILL X and LAYOUT FILL You can specify either none one or both of these layout hints LAYOUT FILL X causes the parent layout manager to stretch or to shrink the widget to accomodate the available space If you place more than one child with this option side by side the manager subdivides the available space proportionally to the children s default size LAYOUT FILL Y has the identical effect in the vertical direction FXPacker FXTopWindow and FXGroupBox must use LAYOUT LEFT and LAYOUT RIGHT with LAYOUT SIDE TOP and LAYOUT SIDE BOTTOM The Abaqus GUI Toolkit ignores hints if they do not make sense for example FXHorizontalFrame ignores LAYOUT TOP and LAYOUT BOTTOM Similar rules apply for the other hints 4 9 LAYOUT EXAMPLES The majority of widgets in the Abaqus GUI Toolkit have width and height arguments in their constructors In most cases you can accept the default value of zero for these arguments which allows the application to determine the proper size of the widget However in some cases you will need to set specific values for the width and height of a widget To set the width and height you must pass the LAYOUT FIX WIDTH and LAYOUT FIX HEIGHT fl
214. zing The following layout managers are available in the Abaqus GUI Toolkit FXHorizontalFrame Arranges widgets horizontally For more information see Horizontal and vertical frames Section 4 3 FXVerticalFrame Arranges widgets vertically For more information see Horizontal and vertical frames Section 4 3 AFXVerticalAligner Vertically aligns the first child of its children For more information see Vertical alignment for composite children Section 4 4 PADDING AND SPACING FXPacker Arranges widgets in a general manner For more information see General purpose layout managers Section 4 5 AFXDialog Same capabilities as PXPacker For more information see General purpose layout managers Section 4 5 FXGroupBox Same capabilities as FXPacker but allows a titled border For more information see General purpose layout managers Section 4 5 FXMatrix Arranges widgets in rows and columns For more information see Row and column layout manager Section 4 6 FXSplitter Splits an area vertically or horizontally and allows you to resize the areas For more information see Resizable regions Section 4 7 FXSwitcher Swaps children on top of each other rotating regions For more information see Rotating regions Section 4 8 FXTabBook Displays one tab or one page of widgets at a time The user selects the tab to view by clicking a tab button For more info
Download Pdf Manuals
Related Search
Related Contents
HDServer Modules User Manual NIGHT OWL CAM-PT624-B surveillance camera 幅広い作業環境に対応。荷を傷めない強力繊維スリング 取扱説明書 ardeagroupe.com Fiche Technique produit CODE GENCOD Condt MGE UPS Systems UPS User's Manual Copyright © All rights reserved.
Failed to retrieve file