avl excite python二次开发1--python解释器需用内置解释器aws_cmd
1、python解释器问题
1.1、用外置python解释器,import WSInterface会失败(WSInterface.pyd)
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import sys
>>> path=r'C:\Program Files (x86)\AVL\R2020.1\AWS\python\lib.x86_64-unknown-winnt_i16v15'
>>> import WSInterface
>>> sys.path.append(path)
>>> import WSInterface
1.2、用内置解释器aws_cmd运行py脚本
1.3 、用内置解释器aws_python执行脚本
2、 gidas文件读写
2.1、gidas结果文件(.GID)地址解析
# _*_ coding:UTF-8 _*_
#File:read.py
import os.path
# AVL modules
import gidas_read
import gidas
def getCaseSetDotCase(case_set, case):
return "%s.%s" % (case_set.replace(" ", "_"), case.replace(" ", "_"))
def getCaseDir(model_file, case_set, case):
case_dir_part_1 = os.path.splitext(model_file)[0]
case_dir_part_2 = getCaseSetDotCase(case_set, case)
case_dir = case_dir_part_1 + "." + case_dir_part_2
return case_dir
def getCaseSetDir(model_file, case_set):
case_dir_part_1 = os.path.splitext(model_file)[0]
case_dir_part_2 = case_set.replace(" ", "_")
case_dir = case_dir_part_1 + "." + case_dir_part_2
return case_dir
def getGidasPath(sep='-',case_dir=None, body=None,node=None, dof='',coordinate_system='',gidas_dir="results"):
#Engine-31-1rel.GID
#gidas_path = "%s-%s-%s%s.GID" % (body, node, dof, coordinate_system) ##.GID
gidas_path = "%s%s%s%s%s%s" % (body,sep, node,sep, dof, coordinate_system) ##-_
while gidas_path[-1]==sep:
gidas_path=gidas_path[:-1]
gidas_path = gidas_path+'.GID'
gidas_path = os.path.join(case_dir, gidas_dir, gidas_path)
if not os.path.exists