首页/文章/ 详情

Inspire二次开发-创建模型并执行运动分析

2天前浏览15





from hwx import inspirefrom hwx.inspire import motion
M44 = inspire.math.Matrix44model = inspire.newModel()for i in range(2):   model.createSolidBlock(z=.2, position=M44(origin=(0,0,i))),   model.createSolidBlock(z=.2, position=M44(origin=(0,0,i+.2)), ground=True),
# Cut hole through boxescyl = model.createSolidCylinder(height=100, radius=.25)for box in model.parts:   box.booleanSubtract(cyl, keepTools=True)cyl.destroy()
# Create joints through holesfor hole in model.holes.aligned:   inspire.Joint(hole, type='Pin', behavior='Rigid')joint1, joint2 = model.joints
# Motor to make parts spinsmotor = motion.Motor(joint2, duration=10, type='ANGLE', value=360)
# Create couplercoupler = motion.Coupler(entities=[joint1, motor], scales=[1,2])print('Ratio:', coupler.getRatioString())print('Do a Motion Analysis to see Block 1 spin')
# To help visualize spinningfor box in model.parts[::2]:   corner = box.features[6]   motion.Tracer(pen=corner, location=corner.location)
inspire.fitView()

来源:TodayCAEer
ACTInspire二次开发UGGIDOrigin
著作权归作者所有,欢迎分享,未经许可,不得转载
首次发布时间:2025-05-30
最近编辑:2天前
TodayCAEer
本科 签名征集中
获赞 36粉丝 110文章 361课程 2
点赞
收藏
作者推荐
未登录
还没有评论
课程
培训
服务
行家
VIP会员 学习计划 福利任务
下载APP
联系我们
帮助与反馈