The script does the following:
The new viewport and the shaded part are shown in Figure 1. Figure 1. The example creates a new viewport and a part.
The example scripts from this guide can be copied to the user's working directory by using the Abaqus fetch utility: abaqus fetch job=scriptName where scriptName.py is the name of the script (see Fetching sample input files). Use the following command to retrieve the script for this example: abaqus fetch job=modelAExample
Note: Abaqus does not install the sample scripts by default during the installation procedure. As a result, if the Abaqus fetch utility fails to find the sample script, the script may be missing from your Abaqus installation. You must rerun the installation procedure and request Abaqus sample problems from the list of items to install. To run the program, do the following:
Note: If Abaqus/CAE is already running, you can run the script by selecting from the main menu bar. The example follows: """ modelAExample.py A simple example: Creating a part. """ from abaqus import * from abaqusConstants import * backwardCompatibility.setValues(includeDeprecated=True, reportDeprecated=False) import sketch import part myModel = mdb.Model(name='Model A') mySketch = myModel.ConstrainedSketch(name='Sketch A', sheetSize=200.0) xyCoordsInner = ((-5 , 20), (5, 20), (15, 0), (-15, 0), (-5, 20)) xyCoordsOuter = ((-10, 30), (10, 30), (40, -30), (30, -30), (20, -10), (-20, -10), (-30, -30), (-40, -30), (-10, 30)) for i in range(len(xyCoordsInner)-1): mySketch.Line(point1=xyCoordsInner[i], point2=xyCoordsInner[i+1]) for i in range(len(xyCoordsOuter)-1): mySketch.Line(point1=xyCoordsOuter[i], point2=xyCoordsOuter[i+1]) myPart = myModel.Part(name='Part A', dimensionality=THREE_D, type=DEFORMABLE_BODY) myPart.BaseSolidExtrude(sketch=mySketch, depth=20.0) myViewport = session.Viewport(name='Viewport for Model A', origin=(10, 10), width=150, height=100) myViewport.setValues(displayedObject=myPart) myViewport.partDisplay.setValues(renderStyle=SHADED) |