Exemplo n.º 1
0
 def __init__(self, form, step, lines):
     # Save the step
     self.step = step
     # Call super constructor
     abaqusGui.AFXDataDialog.__init__(self, form, 'Error', self.CANCEL,
                                      abaqusGui.DIALOG_ACTIONS_SEPARATOR)
     # Configure the continue button
     no_btn = self.getActionButton(self.ID_CLICKED_CANCEL)
     no_btn.setText('OK')
     # Display text
     for line in lines:
         abaqusGui.FXLabel(p=self, text=line)
Exemplo n.º 2
0
 def __init__(self, form, step, name, lines):
     # Call super constructor
     abaqusGui.AFXDataDialog.__init__(self, form, 'Confirm',
                                      self.CONTINUE | self.CANCEL,
                                      abaqusGui.DIALOG_ACTIONS_SEPARATOR)
     # Save the step
     self.step = step
     # Configure the ok button
     yes_btn = self.getActionButton(self.ID_CLICKED_CONTINUE)
     yes_btn.setText('Yes')
     # Configure the continue button
     no_btn = self.getActionButton(self.ID_CLICKED_CANCEL)
     no_btn.setText('No')
     # Store data
     self.name = name
     # Display text
     for line in lines:
         abaqusGui.FXLabel(p=self, text=line)
Exemplo n.º 3
0
 def __init__(self, parent, form, keyword, text, geometry, quantity,
              type_text, highlight_level):
     # Create necessary parent widgets
     self.frame = abaqusGui.FXHorizontalFrame(p=parent,
                                              opts=0,
                                              x=0,
                                              y=0,
                                              w=0,
                                              h=0,
                                              pl=0,
                                              pr=0,
                                              pt=0,
                                              pb=0,
                                              hs=abaqusGui.DEFAULT_SPACING,
                                              vs=abaqusGui.DEFAULT_SPACING)
     self.frame.setSelector(99)
     self.label = abaqusGui.FXLabel(p=self.frame,
                                    text=text + ' ' + ' (None)',
                                    ic=None,
                                    opts=abaqusGui.LAYOUT_CENTER_Y
                                    | abaqusGui.JUSTIFY_LEFT)
     self.handler = PickHandler(form, keyword, 'Pick ' + type_text + ' ',
                                geometry, quantity, self.label,
                                highlight_level)
     # Call super constructor
     abaqusGui.FXButton.__init__(
         self,
         p=self.frame,
         text='\tPick ' + type_text + ' in Viewport',
         ic=abaqusGui.afxGetIcon('select', abaqusGui.AFX_ICON_SMALL),
         tgt=self.handler,
         sel=abaqusGui.AFXMode.ID_ACTIVATE,
         opts=abaqusGui.BUTTON_NORMAL | abaqusGui.LAYOUT_CENTER_Y,
         x=0,
         y=0,
         w=0,
         h=0,
         pl=2,
         pr=2,
         pt=1,
         pb=1)
Exemplo n.º 4
0
 def __init__(self, form, step):
     # Call super constructor
     abaqusGui.AFXDataDialog.__init__(self, form,
                                      'New Periodic Boundary Condition',
                                      self.CONTINUE | self.CANCEL,
                                      abaqusGui.DIALOG_ACTIONS_SEPARATOR)
     # Save the form
     self.form = form
     # Save the step
     self.step = step
     # Define command map
     abaqusGui.FXMAPFUNC(self, abaqusGui.SEL_COMMAND, self.ID_MODEL,
                         InputDialog.on_message)
     abaqusGui.FXMAPFUNC(self, abaqusGui.SEL_COMMAND, self.ID_PART,
                         InputDialog.on_message)
     abaqusGui.FXMAPFUNC(self, abaqusGui.SEL_COMMAND, self.ID_MASTER,
                         InputDialog.on_message)
     abaqusGui.FXMAPFUNC(self, abaqusGui.SEL_COMMAND, self.ID_SLAVE,
                         InputDialog.on_message)
     abaqusGui.FXMAPFUNC(self, abaqusGui.SEL_COMMAND, self.ID_EX_MASTER,
                         InputDialog.on_message)
     abaqusGui.FXMAPFUNC(self, abaqusGui.SEL_COMMAND, self.ID_USE_EX_MASTER,
                         InputDialog.on_message)
     abaqusGui.FXMAPFUNC(self, abaqusGui.SEL_COMMAND, self.ID_EX_SLAVE,
                         InputDialog.on_message)
     abaqusGui.FXMAPFUNC(self, abaqusGui.SEL_COMMAND, self.ID_USE_EX_SLAVE,
                         InputDialog.on_message)
     abaqusGui.FXMAPFUNC(self, abaqusGui.SEL_COMMAND, self.ID_PLANE,
                         InputDialog.on_message)
     abaqusGui.FXMAPFUNC(self, abaqusGui.SEL_COMMAND, self.ID_SYM,
                         InputDialog.on_message)
     # Configure the ok button
     ok_btn = self.getActionButton(self.ID_CLICKED_CONTINUE)
     ok_btn.disable()
     ok_btn.setText('Create')
     # Configure the continue button
     close_btn = self.getActionButton(self.ID_CLICKED_CANCEL)
     close_btn.setText('Close')
     # Define the width of the input widgets
     widget_width = 21
     # Horizontal frame to tile widgets horizontally
     frame_h = abaqusGui.FXHorizontalFrame(p=self)
     # Left of frame: configuration
     config = abaqusGui.FXGroupBox(p=frame_h, text='Configuration')
     # Vertical aligner to align widgets vertically in the first column
     aligner = abaqusGui.AFXVerticalAligner(p=config)
     # Add combo box to select the model
     mdls = mdb.models.keys()
     self.cbx_model = abaqusGui.AFXComboBox(p=aligner,
                                            ncols=widget_width,
                                            nvis=len(mdls),
                                            text='Select Model',
                                            tgt=self,
                                            sel=self.ID_MODEL)
     index = 0
     for mdl in mdls:
         self.cbx_model.appendItem(text=mdl, sel=index)
         index = index + 1
     # Add combo box to select the part
     self.cbx_part = abaqusGui.AFXComboBox(p=aligner,
                                           ncols=widget_width,
                                           nvis=0,
                                           text='Select Part',
                                           tgt=self,
                                           sel=self.ID_PART)
     self.cbx_part.disable()
     # Add combo boxes to select the master surface, but set it as disabled by default
     self.cbx_master = abaqusGui.AFXComboBox(p=aligner,
                                             ncols=widget_width,
                                             nvis=0,
                                             text='Master Surface',
                                             tgt=self,
                                             sel=self.ID_MASTER)
     self.cbx_master.disable()
     # Add combo boxes to select the slave surface, but set it as disabled by default
     self.cbx_slave = abaqusGui.AFXComboBox(p=aligner,
                                            ncols=widget_width,
                                            nvis=0,
                                            text='Slave Surface',
                                            tgt=self,
                                            sel=self.ID_SLAVE)
     self.cbx_slave.disable()
     # Add a check box to enable the definition of exempts for the master surface, and a selection combo box
     frame_em = abaqusGui.FXHorizontalFrame(p=aligner,
                                            opts=0,
                                            x=0,
                                            y=0,
                                            w=0,
                                            h=0,
                                            pl=0,
                                            pr=0,
                                            pt=0,
                                            pb=0,
                                            hs=abaqusGui.DEFAULT_SPACING,
                                            vs=abaqusGui.DEFAULT_SPACING)
     abaqusGui.FXLabel(p=frame_em,
                       text='Master Exempt',
                       ic=None,
                       opts=abaqusGui.LAYOUT_CENTER_Y
                       | abaqusGui.JUSTIFY_LEFT)
     frame_em_sub = abaqusGui.FXHorizontalFrame(
         p=frame_em,
         opts=0,
         x=0,
         y=0,
         w=0,
         h=0,
         pl=0,
         pr=0,
         pt=0,
         pb=0,
         hs=abaqusGui.DEFAULT_SPACING,
         vs=abaqusGui.DEFAULT_SPACING)
     self.check_ex_master = abaqusGui.FXCheckButton(
         p=frame_em_sub, text='', tgt=self, sel=self.ID_USE_EX_MASTER)
     self.cbx_ex_master = abaqusGui.AFXComboBox(p=frame_em_sub,
                                                ncols=widget_width - 4,
                                                nvis=0,
                                                text='',
                                                tgt=self,
                                                sel=self.ID_EX_MASTER)
     self.check_ex_master.disable()
     self.cbx_ex_master.disable()
     # Add a check box to enable the definition of exempts for the master surface, and a selection combo box
     frame_es = abaqusGui.FXHorizontalFrame(p=aligner,
                                            opts=0,
                                            x=0,
                                            y=0,
                                            w=0,
                                            h=0,
                                            pl=0,
                                            pr=0,
                                            pt=0,
                                            pb=0,
                                            hs=abaqusGui.DEFAULT_SPACING,
                                            vs=abaqusGui.DEFAULT_SPACING)
     abaqusGui.FXLabel(p=frame_es,
                       text='Slave Exempt',
                       ic=None,
                       opts=abaqusGui.LAYOUT_CENTER_Y
                       | abaqusGui.JUSTIFY_LEFT)
     frame_es_sub = abaqusGui.FXHorizontalFrame(
         p=frame_es,
         opts=0,
         x=0,
         y=0,
         w=0,
         h=0,
         pl=0,
         pr=0,
         pt=0,
         pb=0,
         hs=abaqusGui.DEFAULT_SPACING,
         vs=abaqusGui.DEFAULT_SPACING)
     self.check_ex_slave = abaqusGui.FXCheckButton(p=frame_es_sub,
                                                   text='',
                                                   tgt=self,
                                                   sel=self.ID_USE_EX_SLAVE)
     self.cbx_ex_slave = abaqusGui.AFXComboBox(p=frame_es_sub,
                                               ncols=widget_width - 4,
                                               nvis=0,
                                               text='',
                                               tgt=self,
                                               sel=self.ID_EX_SLAVE)
     self.check_ex_slave.disable()
     self.cbx_ex_slave.disable()
     # Add text field for the name
     self.txt_name = abaqusGui.AFXTextField(p=aligner,
                                            ncols=widget_width + 2,
                                            labelText='PBC Name',
                                            tgt=self,
                                            sel=self.ID_NAME)
     # Add combo box to select the plane
     self.cbx_plane = abaqusGui.AFXComboBox(p=aligner,
                                            ncols=widget_width,
                                            nvis=3,
                                            text='Match Plane',
                                            tgt=self,
                                            sel=self.ID_PLANE)
     self.cbx_plane.appendItem(text=PLANES[0], sel=0)
     self.cbx_plane.appendItem(text=PLANES[1], sel=1)
     self.cbx_plane.appendItem(text=PLANES[2], sel=2)
     # Add combo box to select the symmetry
     self.cbx_sym = abaqusGui.AFXComboBox(p=aligner,
                                          ncols=widget_width,
                                          nvis=3,
                                          text='Symmetry',
                                          tgt=self,
                                          sel=self.ID_SYM)
     self.cbx_sym.appendItem(text=SYMMETRY[0], sel=0)
     self.cbx_sym.appendItem(text=SYMMETRY[1], sel=1)
     self.cbx_sym.appendItem(text=SYMMETRY[2], sel=2)
     # Set currently selected items to -1 (to force an update on first opening of the GUI)
     self.currentModel = -1
     self.currentPart = -1
     self.currentMaster = -1
     self.currentSlave = -1
     self.currentMExempt = -1
     self.currentSExempt = -1
     self.currentName = ''
     self.currentPlane = -1
     self.currentSym = -1
     # Define highlighted sets
     self.highlight_m = ''
     self.highlight_s = ''
     self.highlight_em = ''
     self.highlight_es = ''
     # Force initial updates
     self.on_model_selected()
     self.on_plane_selected()
     self.on_sym_selected()