×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Beginner Python Script Problem

Beginner Python Script Problem

Beginner Python Script Problem

(OP)
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)

RE: Beginner Python Script Problem

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.)

RE: Beginner Python Script Problem

(OP)

Thanks xerf. That did the trick.  

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources