abaqus——Python二次开发之绘图命令

脚本常用绘图命令,s代表草图对象。

#点
s.Spot(point) #常用于检查脚本中计算的坐标点是否正确
#线段 两个端点
s.Line(point1,point2)
#圆弧,圆心,起点、终点、顺时针(CLOCKWISE),逆时针(COUNTERCLOCKWISE)
s.ArcByCenterEnds(center,point1,point2,direction)
#圆弧,起点、终点、中间点
s.Arc3Points(point1,point2,point3)
#圆 圆心、圆周上一点
s.CircleByCenterPerimeter(center,point1)
#矩形 两个对角点
s.rectangle(point1,point2)
#椭圆 圆心、长袖或短袖顶点
s.E1lipseByCenterPerimeter(center,axisPoint1,axisPoint2)
#样条曲线 点序列,至少包含三个点
s.Spline(points=(pointl,point2,point3))
s.Sp1ine(points=(point1,point2,point3,...))
#构造线
s.ConstructionLine(point1,point2)#两点
s.ConstructionLine(point1,angle(角度,度))#点角度
s.Constructionline(angle,point1)#角度、点
#构造圆圈心、圆周上一点
s.ConstructionCircleByCenterPerimeter(center,point1)

除 Spot返回 ConstrainedSketchVertex对象、rectangle 无返回值外,以上各命令的返回值均为 ConstrainedSketchGeometry对象。ConstrainedSketchVertex对象只有一个coords属性,为顶点坐标元组。ConstrainedSketchGeometry对象有curveType、id、type、pointOn4个属性,引用几何对象时,建议通过其id索引,例如,

S= mdb.models[' model-1J.sketches [ 'demosketch']
l= s.Line (point1=(-37.518.75),point2=(-20.0,18.75))
s.setAsConstruction(objectList=(s.geometry[l.id])#将线段设为构造线

ConstrainedSketchGeometry对象的三种方法示例如下:

ConstrainedSketchGeometry.getSize()#回该对象的长度或面积
ConstrainedSketchGeometry.getVertices() #返回该对象的顶点
ConstrainedSketchGeometry.getPointAtDistance(
#返回几何对象路径上的一个点的坐标,(x,y)
point, #对象的起点或终点坐标,形如(x, y)
distance,#返回点沿该几何对象路径到point参数指定点的孤长或百分比
percentage=False)#distance参数是否为百分比、False为绝对长度

ConstrainedSketchGeometry对象的方法示例如下:

>>>S = mdb.models ['Model-1'].sketches ['demoSketch']
>>>> a=s.Spline(points=((00)(5,0),(10,0)))
>>a.getPointAtDistance([O,0]8)
>8.00.0)
>>>> a.getPointAtDistance([o,0],8,True)
>(0.8,0.0)
>a.getSize()
>10.0
>>>a.getVertices()
>(mdb.models['Model-1'].sketches['__profile__'].vertices[47]. mdb.models[ 'Model-1'].sketches ['__profile__' ].vertices[55], mdb.model['Model-1'].sketches [ '__profile__'].vertices[67])
  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

离开冥界的孤独格斗者

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值