- 积分
- 0
- 注册时间
- 2011-5-9
- 仿真币
-
- 最后登录
- 1970-1-1
|
本帖最后由 wanxlxg 于 2011-5-20 20:38 编辑
在学习用abaqus参数化建模,以前没接触过这个 都是用proe画模型,对于编程更是只学过一点入门的c语言。。。归正题,要画一个齿轮,最近研究了下 编了个画渐开线的方程,可是出现了个错误,不知道怎么解决,希望各位高人至指点下
from abaqus import*
from abaqusConstants import*
session.Viewport(name='Viewport: 1', origin=(0.0, 0.0), width=324.555541992188,
height=204.226654052734)
session.viewports['Viewport: 1'].makeCurrent()
session.viewports['Viewport: 1'].maximize()
from caeModules import *
from driverUtils import executeOnCaeStartup
executeOnCaeStartup()
import math
Mdb()
fields=(('durchmesser:','10'))
rb=getInputs(fields=fields,label='Enter Dimensions:')
Alpha=0
i=1
T=0
s=8
imt=0.05
n=10
while i<=n:
T=T+imt
Alpha=T*math.sqrt(s)
x=rb*(math.cos(Alpha)+Alpha*math.sin(Alpha))
y=-rb*(math.sin(Alpha)-Alpha*math.cos(Alpha))
i=i+1
session.viewports['Viewport: 1'].setValues(displayedObject=None)
s = mdb.models['Model-1'].ConstrainedSketch(name='__profile__', sheetSize=200)
g, v, d, c = s.geometry, s.vertices, s.dimensions, s.constraints
s.sketchOptions.setValues(decimalPlaces=3)
s.setPrimaryObject(option=STANDALONE)
s.Spline(points=(x,y))
s.VerticalConstraint(entity=g[2])
错误提示是:
line 23 ,in <module> x=rb*(math.cos(Alpha)+Alpha*math.sin(Alpha))
typeError: can't multiply sequence by non-in of type 'float' |
|