Members of an Abaqus object are read-only; consequently, you cannot change their value with a simple assignment statement. You use the setValues() method to change the value of a member. For example, the setValues() statement in the following script changes the thickness of a shell section: >>> import section >>> shellSection = mdb.models['Model-1'].HomogeneousShellSection( name='Steel Shell', thickness=1.0, material='Steel') >>> print 'Original shell section thickness = ' \ , shellSection.thickness Original shell section thickness = 1.0 >>> shellSection.setValues(thickness=2.0) >>> print 'Final shell section thickness = ' \ , shellSection.thickness Final shell section thickness = 2.0 You cannot use assignment to change the value of the Shell object. >>> myShell.thickness = 2.0 TypeError: readonly Attribute The following statements illustrate the use of constructors, methods, and members: >>> # Create a Section object >>> mySection = mdb.models['Model-1'].HomogeneousSolidSection( name='solidSteel', material='Steel', thickness=1.0) >>> # Display the type of the object >>> print 'Section type = ', type(mySection) Section type = <type 'HomogeneousSolidSection'> >>> # List the members of the object >>> print 'Members of the section are:' , mySection.__members__ Members of the section are: ['category', 'dimension', 'layout', 'material', 'name', 'thickness'] >>> # List the methods of the object >>> print 'Methods of the section are: ', mySection.__methods__ Methods of the section are: ['setValues'] >>> # Print the value of each member in a nice format >>> for member in mySection.__members__: ... print 'mySection.%s = %s' % (member, getattr(mySection, member)) mySection.category = SOLID mySection.dimension = THREE_DIM mySection.layout = HOMOGENEOUS mySection.material = Steel mySection.name = solidSteel mySection.thickness = 1.0 You use the Access description provided with each object in the Abaqus Scripting Reference Guide to determine how you access the object. You append a method or member to this description when you are writing a script. Similarly, you use the Path description provided with each constructor in the Abaqus Scripting Reference Guide to determine the path to the constructor. |