当前位置:网站首页>The ODB model calculates the data and outputs it to excel

The ODB model calculates the data and outputs it to excel

2022-04-23 20:21:00 Install a sound 77

obd yes abaqus After the calculation of the model is completed , Including the stress in our calculation 、 Displacement and other data .

although abaqus Data output is provided in excel The function of , Can only output a large amount of data , It's not intuitive .

therefore , It is more convenient to use scripted output .

1. install xlwt,xlrt.

abaqus The post-processing in is used py, The default installation is numpy Third party library , But for the operation excel The library of , There is no default installation , Therefore, you need to put the required Library in the software .

The path is Abaqus\6.14-4\tools\SMApy\python2.7\Lib\site-packages\ That is to say py2.7 The location of the library of

2. Introduction to basic script commands

# First, import the required Library 
from odbAccess import *
import xlwt 
import numpy 
import xlrd 
import numpy as np 
import os 
# Determine what to read STEP and odb Path to file , Note that the path here must use absolute path and cannot use relative path .
s_odb = 'C:/xxxx/obd1/Job-4-QZ+LNR-X-220.odb'
stepname = 'Step-3' 
# Open inside the script odb file 
o1 = session.openOdb(name=s_odb)

Normal operation in software, we use this kind of

 The above operations are carried out through pyreader After reading, it is the following code 
xy0 = session.XYDataFromHistory(name='XYData-1', odb=o1, outputVariableName=XXXXXXX,
                     steps=(stepname, ), useStepTime=True, suppressQuery=True)

among outputVariableName Represents the point you have chosen in the list 175 As an example , It means point 175 The displacement of   Is to choose   ‘Spatial displacement: U1 P1:P2-1 Node 175‘

If you want to read xy0 The data needs to pass through several layers Such as xy0[0][0][0] Query sequentially .

#excel Input operation of

books = xlwt.Workbook(encoding = 'ascii')
worksheet = sheets.add_sheet('sheet1')
books.save(+'-MAX.xls')

 

 

 

版权声明
本文为[Install a sound 77]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210551491284.html