Some arguments of a command are required, and some arguments are optional. In the Abaqus Scripting Reference Guide the required arguments are listed first, followed by the optional arguments. If the argument is optional, the default value is provided. The default value is the value of an optional argument when you call a method and omit the argument. The setValues method is a special case. All of the arguments to the setValues method are optional, but any argument that you omit retains its current value; Abaqus does not assign a default value to the argument. Some objects have no constructors; Abaqus creates the objects for you. For such objects the documentation describes the initial value of an optional argument. The initial value given for the argument is the initial value assigned to the corresponding member when Abaqus creates the object. For example, the defaultViewportAnnotationOptions object has no constructor; Abaqus creates the defaultViewportAnnotationOptions object when you start a session. When you create a new viewport, the settings are copied from the current viewport. You can use the setValues method to modify the value of a member; for example, to modify the value of the triad member of the defaultViewportAnnotationsOptions object. When you call session.defaultViewportAnnotationOptions.setValues(triad=OFF), the value of the triad member is set to off. The other member values remain unchanged; this behavior is called “as is” behavior because the values remain “as is.” The setValuesInStep method displays similar “as is” behavior. Keyword and positional arguments are described in Creating functions. We recommend that you use keyword arguments since they can be supplied in any order and they make your scripts easier to read and debug; for example, newViewport = session.Viewport(name='myViewport', origin=(10, 10), width=100, height=50) If you choose not to use keywords, the arguments must be provided in the order in which they are documented. newViewport = session.Viewport('myViewport', (10, 10), 100, 50) You can use a combination of keyword and positional arguments. Keyword arguments can be supplied after positional arguments; however, positional arguments cannot be entered after keyword arguments. For example, you can use the following statement: newViewport = session.Viewport('myViewport', (10, 10), width=100, height=50) However, you cannot use the following statement: newViewport = session.Viewport(name='myViewport', (10, 10), 100, 50) You will find it easier to use keyword arguments so that you do not have to concern yourself with the positional requirements. |