Booleans

Python defines two Boolean values, True and False. The type of a Python Boolean is <type 'bool'>.

myPythonBoolean = True  
type(myPythonBoolean)
<type 'bool'>
In addition, the Abaqus Scripting Interface defines a Boolean object, derived from the SymbolicConstant object, which can take the values ON and OFF. For example, noPartsInputFile is a member of a Model object that indicates whether the input file will be written with parts and assemblies. The type of the noPartsInputFile member is <type 'AbaqusBoolean'>.

Abaqus recommends that you use the Python Boolean in your scripts and that you convert existing scripts to use the Python Boolean.

The value of a Boolean argument can appear to be ambiguous; for example,

newModel = mdb.ModelFromInputFile(name='beamTutorial',
     inputFileName='Deform')  
newModel.setValues(noPartsInputFile=False) 
print newModel.noPartsInputFile
OFF 

Because of this ambiguity, you should test a Boolean for a positive or negative value, as opposed to comparing it to a specific value like 0, OFF, or False. For example, the following statements show how you should test the value of a Boolean member:

if (newModel.noPartsInputFile):
    print 'Input file will be written without parts \
        and assemblies. '
else:
    print 'Input file will be written with parts \
        and assemblies.'