Procedure example

This section provides an example of how to write a one-step procedure mode.

Steps in a procedure are posted using the following methods:

  • getFirstStep

  • 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):

    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def __init__(self, owner):

        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)

    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def getFirstStep(self):

        self.cmd.setKeywordValuesToDefaults()
        db = PlateDB(self)
        return AFXDialogStep(self, db)