|
@@ -105,17 +105,18 @@ def myprocess(m, n):
|
|
|
number = getarray.getitemIndexArrayNumber(positons[positon], m, n)
|
|
|
if (number == 1):
|
|
|
newFileName = _rootPath + "newfile" + str(positons[positon]) + ".dwg"
|
|
|
- # if(not os.path.exists(newFileName)):
|
|
|
- # copyfile(_rootPath + _originFile, newFileName)
|
|
|
- # moveSingleTemplate(newFileName,positons[positon])
|
|
|
+ if(not os.path.exists(newFileName)):
|
|
|
+ copyfile(_rootPath + _originFile, newFileName)
|
|
|
+ moveSingleTemplate(newFileName,positons[positon])
|
|
|
# break
|
|
|
else:
|
|
|
moduleIndexs = getarray.getModuleIndex(positons[positon],m,n)
|
|
|
for moduleIndex in moduleIndexs:
|
|
|
newFileName = _rootPath + "newfile" + str(positons[positon]) + str(moduleIndex) + ".dwg"
|
|
|
- copyfile(_rootPath + _originFile, newFileName)
|
|
|
- moveMultipleTemplate(newFileName,positons[positon],moduleIndex)
|
|
|
- break
|
|
|
+ if(not os.path.exists(newFileName)):
|
|
|
+ copyfile(_rootPath + _originFile, newFileName)
|
|
|
+ moveMultipleTemplate(newFileName,positons[positon],moduleIndex)
|
|
|
+ # break
|
|
|
def moveSingleTemplate(fileName,position):
|
|
|
# openFile(fileName)
|
|
|
GetAllModule.resetConfUsed()
|
|
@@ -129,7 +130,7 @@ def moveSingleTemplate(fileName,position):
|
|
|
def moveMultipleTemplate(fileName,position,moduleIndex):
|
|
|
GetAllModule.resetConfUsed()
|
|
|
GetAllModule.moveBlockReferenceWithNewIndex(position,moduleIndex)
|
|
|
- time.sleep(3)
|
|
|
+ time.sleep(1)
|
|
|
acad = Autocad(create_if_not_exists = False)
|
|
|
acad.prompt("Hello, Autocad from Python\n")
|
|
|
acad.doc.SaveAs(fileName)
|