×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Abaqus replay file not found ?

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:

CODE --> .py

  1. from abaqusConstants import *
  2. from caeModules import *
  3. import abaqus
  4. import material
  5. import sketch
  6. import part
  7. import assembly
  8. import section
  9. import mesh
  10. import regionToolset
  11. import gc
  12. import os
  13. import sys
  14. import shutil, osutils
  15. import zipfile
  16. def getPyScriptPath():
  17. abqVersion = abaqus.version
  18. abqMainVersion = abqVersion.split('.')[0]
  19. abqSubVersion = abqVersion.split('.')[1].split('-')[0]
  20. if(abqMainVersion>6 or (abqMainVersion==6 and abqSubVersion>=8)):
  21. pyName = abaqus.getCurrentScriptPath()
  22. print pyName
  23. return os.path.dirname(pyName)
  24. else:
  25. if(not os.path.isfile('abaqus.rpy')):
  26. 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,))
  27. return ''
  28. shutil.copy('abaqus.rpy', 'abaqus2.rpy')
  29. flag = False
  30. line2 = ''
  31. for line in open("abaqus2.rpy"):
  32. if line.startswith('execfile('):
  33. flag = True
  34. line2 = ''
  35. if flag:
  36. line2 = line2 + line.replace('\n','')
  37. if line.find(')') > -1:
  38. flag=False
  39. osutils.remove('abaqus2.rpy')
  40. pyName = line2.split("'")[1]
  41. return pyName[:pyName.rfind("/")]
  42. def getPyScriptName():
  43. v = abaqus.version
  44. vbis = v.split('.')
  45. major = int(vbis[0])
  46. vbis = vbis[1].split('-')
  47. minor = int(vbis[0])
  48. revision = int(vbis[1])
  49. if(major>6 or (major==6 and minor>=8)):
  50. pyName = abaqus.getCurrentScriptPath()
  51. pyName = pyName.replace('/','\\')
  52. toReturn = pyName[pyName.rfind('\\')+1:pyName.rfind('.py')]
  53. return toReturn
  54. else:
  55. if(not os.path.isfile('abaqus.rpy')):
  56. 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,))
  57. return ''
  58. shutil.copy('abaqus.rpy', 'abaqus2.rpy')
  59. flag = False
  60. line2 = ''
  61. for line in open("abaqus2.rpy"):
  62. if line.startswith('execfile('):
  63. flag = True
  64. line2 = ''
  65. if flag:
  66. line2 = line2 + line.replace('\n','')
  67. if line.find(')') > -1:
  68. flag=False
  69. osutils.remove('abaqus2.rpy')
  70. pyName = line2.split("'")[1]
  71. pyName = pyName.replace('/','\\')
  72. pyName = pyName[pyName.rfind('\\')+1:pyName.rfind('.py')]
  73. return pyName
  74. def merge(seq):
  75. merged = []
  76. for s in seq:
  77. for x in s:
  78. merged.append(x)
  79. return merged
  80. def equals(a,b):
  81. tol = 5e-5*(abs(a)+abs(b))/2
  82. if(abs(a-b)<=tol):
  83. return 1
  84. else:
  85. return 0
  86. def distance(x1,y1,z1,x2,y2,z2):
  87. dist = sqrt((x1-x2)**2+(y1-y2)**2+(z1-z2)**2)
  88. return dist
  89. def findVertex(vert,x,y,z):
  90. toReturn = vert[0]
  91. minDist = distance(toReturn.pointOn[0][0],toReturn.pointOn[0][1],toReturn.pointOn[0][2],x,y,z)
  92. for v in vert:
  93. newDist = distance(v.pointOn[0][0],v.pointOn[0][1],v.pointOn[0][2],x,y,z)
  94. if(newDist<minDist and (equals(v.pointOn[0][0],x) or equals(v.pointOn[0][1],y) or equals(v.pointOn[0][2],z))):
  95. minDist = newDist
  96. toReturn = v
  97. return toReturn
  98. def findVertex3(myAssembly,x,y,z):
  99. for inst in myAssembly.instances.values():
  100. vert = inst.vertices
  101. if(len(vert)>0):
  102. v = vert.findAt((x,y,z),)
  103. if(v!=None):
  104. return v
  105. return None
  106. def getValue(f,x):
  107. if(len(f[0])==0):
  108. return 0
  109. if(f[0][0]==x):
  110. return f[1][0]
  111. for i in range(len(f[0])):
  112. if(f[0][i]>=x):
  113. val = f[1][i-1] + ((x-f[0][i-1])/(f[0][i]-f[0][i-1])) * (f[1][i]-f[1][i-1])
  114. return val
  115. def functionAdd(f1,f2):
  116. toReturn=[[],[]]
  117. if(len(f1[0])==0):
  118. toReturn[0]=f2[0]
  119. elif(len(f2[0])==0):
  120. toReturn[0]=f1[0]
  121. else:
  122. j = 0
  123. i = 0
  124. tmp = 0.
  125. while (i < len(f1[0])):
  126. if(j>=len(f2[0]) or (f1[0][i]<=f2[0][j])):
  127. tmp=f1[0][i]
  128. i = i+1
  129. else:
  130. tmp=f2[0][j]
  131. j = j+1
  132. if(len(toReturn[0])==0):
  133. toReturn[0].append(tmp)
  134. else:
  135. if(toReturn[0][len(toReturn[0])-1]!=tmp):
  136. toReturn[0].append(tmp)
  137. for i in range(len(toReturn[0])):
  138. toReturn[1].append(getValue(f1,toReturn[0][i])+getValue(f2,toReturn[0][i]))
  139. return toReturn
  140. def functionMult(a,f1):
  141. toReturn=[[],[]]
  142. toReturn[0]=f1[0]
  143. for i in f1[1]:
  144. toReturn[1].append(a*i)
  145. return toReturn
  146. def getFuncData(f):
  147. toReturn=[]
  148. for i in range(len(f[0])):
  149. toReturn.append([f[0][i],f[1][i]])
  150. return toReturn
  151. def main():
  152. pyPath = getPyScriptPath()
  153. if(pyPath==''):
  154. raise AbaqusException, 'abaqus replay file not found'
  155. os.chdir(pyPath
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.

RE: Abaqus replay file not found ?

The .rpy file is create during /CAE startup in the work directory. It is independent of the location where the .cae file is saved.

If a new /CAE session is started and a .rpy already exists in that directory, then the old file is automatically renamed.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources