Abaqus replay file not found ?
Abaqus replay file not found ?
(OP)
Hi everybody
I Create a Model, Then Save it in this directory C:\Users\MyPCName\Desktop\Sample.
After open the Sample folder and run the .CAE file my .odb and .rpy and ... files will be saved in that directory.
In Abaqus Environment->Abaqus PDE, I run a script.
This is Part of Script:
After i run the Script in "Kernel mode", It Stick and Highlight the row 163 (raise AbaqusException, 'abaqus replay file not found'), But my .rpy files is in the C:\Users\MyPCName\Desktop\Sample directory.
Is there anybody know what should i do ?
With Best regards.
yassou.
I Create a Model, Then Save it in this directory C:\Users\MyPCName\Desktop\Sample.
After open the Sample folder and run the .CAE file my .odb and .rpy and ... files will be saved in that directory.
In Abaqus Environment->Abaqus PDE, I run a script.
This is Part of Script:
CODE --> .py
- from abaqusConstants import *
- from caeModules import *
- import abaqus
- import material
- import sketch
- import part
- import assembly
- import section
- import mesh
- import regionToolset
- import gc
- import os
- import sys
- import shutil, osutils
- import zipfile
- def getPyScriptPath():
- abqVersion = abaqus.version
- abqMainVersion = abqVersion.split('.')[0]
- abqSubVersion = abqVersion.split('.')[1].split('-')[0]
- if(abqMainVersion>6 or (abqMainVersion==6 and abqSubVersion>=8)):
- pyName = abaqus.getCurrentScriptPath()
- print pyName
- return os.path.dirname(pyName)
- else:
- if(not os.path.isfile('abaqus.rpy')):
- getWarningReply('The abaqus replay file could not be found. This happens if you change the Abaqus working directory after Abaqus/CAE has started. Try to revert to the original Abaqus working directory and rerun the script.',(CANCEL,))
- return ''
- shutil.copy('abaqus.rpy', 'abaqus2.rpy')
- flag = False
- line2 = ''
- for line in open("abaqus2.rpy"):
- if line.startswith('execfile('):
- flag = True
- line2 = ''
- if flag:
- line2 = line2 + line.replace('\n','')
- if line.find(')') > -1:
- flag=False
- osutils.remove('abaqus2.rpy')
- pyName = line2.split("'")[1]
- return pyName[:pyName.rfind("/")]
- def getPyScriptName():
- v = abaqus.version
- vbis = v.split('.')
- major = int(vbis[0])
- vbis = vbis[1].split('-')
- minor = int(vbis[0])
- revision = int(vbis[1])
- if(major>6 or (major==6 and minor>=8)):
- pyName = abaqus.getCurrentScriptPath()
- pyName = pyName.replace('/','\\')
- toReturn = pyName[pyName.rfind('\\')+1:pyName.rfind('.py')]
- return toReturn
- else:
- if(not os.path.isfile('abaqus.rpy')):
- getWarningReply('The abaqus replay file could not be found. This happens if you change the Abaqus working directory after Abaqus/CAE has started. Try to revert to the original Abaqus working directory and rerun the script.',(CANCEL,))
- return ''
- shutil.copy('abaqus.rpy', 'abaqus2.rpy')
- flag = False
- line2 = ''
- for line in open("abaqus2.rpy"):
- if line.startswith('execfile('):
- flag = True
- line2 = ''
- if flag:
- line2 = line2 + line.replace('\n','')
- if line.find(')') > -1:
- flag=False
- osutils.remove('abaqus2.rpy')
- pyName = line2.split("'")[1]
- pyName = pyName.replace('/','\\')
- pyName = pyName[pyName.rfind('\\')+1:pyName.rfind('.py')]
- return pyName
- def merge(seq):
- merged = []
- for s in seq:
- for x in s:
- merged.append(x)
- return merged
- def equals(a,b):
- tol = 5e-5*(abs(a)+abs(b))/2
- if(abs(a-b)<=tol):
- return 1
- else:
- return 0
- def distance(x1,y1,z1,x2,y2,z2):
- dist = sqrt((x1-x2)**2+(y1-y2)**2+(z1-z2)**2)
- return dist
- def findVertex(vert,x,y,z):
- toReturn = vert[0]
- minDist = distance(toReturn.pointOn[0][0],toReturn.pointOn[0][1],toReturn.pointOn[0][2],x,y,z)
- for v in vert:
- newDist = distance(v.pointOn[0][0],v.pointOn[0][1],v.pointOn[0][2],x,y,z)
- if(newDist<minDist and (equals(v.pointOn[0][0],x) or equals(v.pointOn[0][1],y) or equals(v.pointOn[0][2],z))):
- minDist = newDist
- toReturn = v
- return toReturn
- def findVertex3(myAssembly,x,y,z):
- for inst in myAssembly.instances.values():
- vert = inst.vertices
- if(len(vert)>0):
- v = vert.findAt((x,y,z),)
- if(v!=None):
- return v
- return None
- def getValue(f,x):
- if(len(f[0])==0):
- return 0
- if(f[0][0]==x):
- return f[1][0]
- for i in range(len(f[0])):
- if(f[0][i]>=x):
- val = f[1][i-1] + ((x-f[0][i-1])/(f[0][i]-f[0][i-1])) * (f[1][i]-f[1][i-1])
- return val
- def functionAdd(f1,f2):
- toReturn=[[],[]]
- if(len(f1[0])==0):
- toReturn[0]=f2[0]
- elif(len(f2[0])==0):
- toReturn[0]=f1[0]
- else:
- j = 0
- i = 0
- tmp = 0.
- while (i < len(f1[0])):
- if(j>=len(f2[0]) or (f1[0][i]<=f2[0][j])):
- tmp=f1[0][i]
- i = i+1
- else:
- tmp=f2[0][j]
- j = j+1
- if(len(toReturn[0])==0):
- toReturn[0].append(tmp)
- else:
- if(toReturn[0][len(toReturn[0])-1]!=tmp):
- toReturn[0].append(tmp)
- for i in range(len(toReturn[0])):
- toReturn[1].append(getValue(f1,toReturn[0][i])+getValue(f2,toReturn[0][i]))
- return toReturn
- def functionMult(a,f1):
- toReturn=[[],[]]
- toReturn[0]=f1[0]
- for i in f1[1]:
- toReturn[1].append(a*i)
- return toReturn
- def getFuncData(f):
- toReturn=[]
- for i in range(len(f[0])):
- toReturn.append([f[0][i],f[1][i]])
- return toReturn
- def main():
- pyPath = getPyScriptPath()
- if(pyPath==''):
- raise AbaqusException, 'abaqus replay file not found'
- os.chdir(pyPath
Is there anybody know what should i do ?
With Best regards.
yassou.





RE: Abaqus replay file not found ?
If a new /CAE session is started and a .rpy already exists in that directory, then the old file is automatically renamed.