Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Beginner Python Script Problem

Status
Not open for further replies.

DanStro

Mechanical
Dec 11, 2004
393
I am just learning Abaqus (both main program and scripting) so I will apologize ahead of time if this is a dumb question.

I have written the script below to create an axisymmetric part that I will then use Abaqus to analyze. But when it gets to the last line of the code I get the error "Shell extrude feature failed". My first guess was that the endpoints of the first and last line are not connected to the endpoints of the spline. But after manually drawing it and looking at the .rec file I don't see anything in that code specifying this connection either.

I need to use a spline because eventually the sketch will not be a simple circular arc.

Does anyone have any suggestions?

Any help is appreciated.
Dan

<CODE>
import math
from part import *
from sketch import *

model=mdb.models['Model-1']

# Basic lens data
lensS1SemiDiameter=15.0
lensS2SemiDiameter=15.0
s1Radius=20.0
s2Radius=100.0
centerThickness=8.0

# Number of increments to split the semiDiameter into
numOfIncrements=15
s1SemiDiameterIncremement=lensS1SemiDiameter/numOfIncrements
s2SemiDiameterIncremement=lensS2SemiDiameter/numOfIncrements

surfValues=[]

curY=0
curNum=0
while curY<=lensS1SemiDiameter:
curSagValue=s1Radius-math.sqrt(s1Radius**2-curY**2)
surfValues=surfValues+[(curY,curSagValue)]
#print "surfValues=",surfValues[curNum]
curNum=curNum+1
curY=curY+s1SemiDiameterIncremement

# Create the sketch
sketchName='test'
model.ConstrainedSketch(name=sketchName,sheetSize=200.0)
theSketch=model.sketches[sketchName]

# Pass the array all at once to the spline command
theSketch.Spline(points=(surfValues))

# Conncect the spline end points with lines
theSketch.Line(point1=(surfValues[0][0],0.0),point2=(0.0,-10.0))
theSketch.Line(point1=(0.0,-10.0),point2=(15.0,-10.0))
theSketch.Line(point1=(15.0,-10.0),point2=(15.0,surfValues[15][1]))

# Create the part, name it, and set the sketch to it
partName='tmpLens'
model.Part(dimensionality=AXISYMMETRIC, name=partName, type=DEFORMABLE_BODY)
model.parts[partName].BaseShell(sketch=theSketch)
 
Replies continue below

Recommended for you

As far as I remember, for the AXISYMMETRIC models, you have to create a construction line in the sketch, representing the axis of symmetry. This is done implicitly by ABAQUS/CAE when you use the GUI to do the modeling but you have to do it yourself if you script the model generation. (The same thing if you use the the 3D Revolve approach, you have to sketch the axis of rotation.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor