Appears that I have hit a snag and it failed after I reached the Build Dense Cloud option, The code I used was:
import PhotoScan
doc = PhotoScan.app.document
#Set variables
project_path = "D:\\Processed\\20171204LFF1PH3PH32_section\\"
project_name = "20171204LFF1PH3PH32_section"
#save
doc.save(project_path + project_name + ".psx")
if len(doc.chunks):
chunk = PhotoScan.app.document.chunk
else:
chunk = doc.addChunk()
#Align photos
chunk.matchPhotos(accuracy = PhotoScan.HighAccuracy, generic_preselection=True, reference_preselection=True,filter_mask = False, keypoint_limit = 350000, tiepoint_limit = 0)
chunk.alignCameras()
#save
doc.save()
#Optimize Cameras
chunk.optimizeCameras(fit_f=True, fit_cx=True, fit_cy=True, fit_b1=True, fit_b2=True, fit_k1=True,fit_k2=True, fit_k3=True, fit_k4=False, fit_p1=True, fit_p2=True, fit_p3=False,fit_p4=False)
#save
doc.save()
#Set Coordinate System
chunk.crs = PhotoScan.CoordinateSystem("EPSG::4326")
chunk.updateTransform()
#save
doc.save()
#build dense cloud
chunk.buildDenseCloud(quality = PhotoScan.UltraQuality, filter = PhotoScan.AggressiveFiltering)
#save
doc.save()
chunk.exportPoints(project_path + project_name + ".las", binary=True, precision=6, colors=True, format=PhotoScan.PointsFormatLAS)
#build mesh
chunk.buildModel(surface = PhotoScan.HeightField, interpolation = PhotoScan.EnabledInterpolation, face_count=PhotoScan.MediumFaceCount )
#save
doc.save()
#Build DEM
chunk.buildDem(source=PhotoScan.DenseCloudData, interpolation=PhotoScan.EnabledInterpolation)
#save
doc.save()
chunk.exportDem(project_path + project_name + "_DEM.tif", image_format=PhotoScan.ImageFormatTIFF, format = PhotoScan.RasterFormatTiles, nodata=-32767, write_kml=False, write_world=True)
#Build Ortho
chunk.buildOrthomosaic(surface=PhotoScan.ElevationData, blending=PhotoScan.MosaicBlending, color_correction=False)
#save
doc.save()
chunk.exportOrthomosaic(project_path + project_name + ".tif", image_format=PhotoScan.ImageFormatTIFF, format = PhotoScan.RasterFormatTiles, raster_transform=PhotoScan.RasterTransformNone, write_kml=False, write_world=True)
print("Finished")
Thanks for helping so much, I really appreciate it