HI

i am trying to make a plate model in abaqus with random hole.

the below code is a simple of this concept,but it was report a error.

any body knows what can I do?

دوستان محترم

مشکل این کد چیه؟

# Import the modules used by this script.

from abaqus import *

from abaqusConstants import *

import part

import assembly

import step

import load

import interaction

import random

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

a=100

b=50

t=8

# Create a Sketch and draw rectangle.

mySketch = myModel.ConstrainedSketch(name='Sketch A',

sheetSize=200.0)

mySketch.rectangle(point1=(0,0),

point2=(a,b))

# Create a 3D part and extrude the rectangles.

plt = myModel.Part(name='Plate',

dimensionality=THREE_D, type=DEFORMABLE_BODY)

plt.BaseSolidExtrude(sketch=mySketch, depth=t)

# Select two faces

topFace = plt.faces.findAt(((a/2,b/2,0),))

##topFace=plt.faces[0]

##print getArea(topFace)

# Select two edges from one instance.

#myEdge1 = plt.edges.findAt(((0,b/2,t),))

#myEdge2 = plt.edges.findAt(((a/2,0,t),))

myEdge1 = plt.edges[0]

myEdge2 = plt.edges[1]

x0=random.uniform(0,a)

y0=random.uniform(0,b)

r=random.uniform(0,5*t)

print x0,y0,r

plt.HoleThruAllFromEdges(diameter=r,

distance1=x0, distance2=y0, edge1=

myEdge1, edge2=myEdge2, plane=topFace,planeSide=SIDE1)

#

More Hamid Moaieri's questions See All
Similar questions and discussions