- 积分
- 0
- 注册时间
- 2013-12-20
- 仿真币
-
- 最后登录
- 1970-1-1
|
大家好,我在marc中运行python时,一直报TypeError的错,求助,谢谢。
报错信息如下:TypeError:main()takes exactly 3 arguments(0 given)。我实际上给了三个值了啊。
程序如下:
- #!/user/bin/python
- # -*- coding:utf-8 -*-
- from py_mentat import *
- from py_post import *
- import os,os.path,glob
- def main(inpPath,facePath,pointPath):
- py_send("*new_model yes")
- py_send("*import abaqus %s "%(inpPath))
- py_send("*select_elements_class quad4")
- py_send("*invisible_selected")
- py_send("*remove_elements all_visible")
- py_send("*remove_nodes all_visible")
- py_send("*sweep_all")
- py_send("*remove_unused_points")
- py_send("*remove_unused_nodes")
- py_send("*invisible_selected")
- py_send("*face_surfaces all_existing")
- py_send("*sweep_all")
- py_send("*remove_unused_points")
- py_send("*remove_unused_nodes")
- py_send("*renumber_all")
- py_send("*clear_mesh")
- # 导出模型面igs
- py_send("*set_length_unit millimeter")
- py_send("*export iges %s yes" %(facePath ))
- # 导出模型点igs
- py_send("*remove_surfaces all_visible")
- py_send("*fill_view")
- py_send("*set_length_unit millimeter")
- py_send("*export iges %s yes" %(pointPath ))
- if __name__ == '__main__':
- inpfiles = [eachinp.split('.')[0] for eachinp in glob.glob('*.inp') if 'result' in eachinp]
- print(inpfiles)
- path = r'F:\VV\sy midline\result\igs'
- for each in inpfiles:
- # extra = each.split('.')[0]
- file = os.path.join(path,each)
- inpPath =file+'.inp'
- facePath = file + '.igs'
- pointPath = file + '-point.igs'
- main(inpPath, facePath, pointPath)
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
×
|