def makeProjectedFiles(idList, layerList, fileSuffix): fmask = 'C:\\amigos\\dump\\%s-%s.3dm' outMask = 'C:\\amigos\\dump\\%s-' + fileSuffix + '.3dm' types = ['site', 'terrain'] outLayers = [s + '-projected' for s in layerList] for siteId in idList: FileUtils.deleteAll() fpaths = [(fmask % (siteId, t)) for t in types] FileUtils.importFiles(fpaths) for i, layer in enumerate(layerList): lyrAtt = LayerUtils.layerAttributes(outLayers[i]) # make the layer # determine geometry type sampleGeom = LayerUtils.getLayerGeometry(layer) if len(sampleGeom) > 0: if type(sampleGeom[0]) == Point: resultPairs = IntersectionTools.smartPointLayerProject( layer, 'groundsurface', lyrAtt) # bake results for pair in resultPairs: scriptcontext.doc.Objects.AddPoint(pair[0], pair[1]) else: resultPairs = IntersectionTools.smartCurveLayerProject( layer, 'groundsurface', lyrAtt) # bake results for pair in resultPairs: scriptcontext.doc.Objects.AddCurve(pair[0], pair[1]) outPath = outMask % siteId FileUtils.exportLayers(outLayers, outPath)
def makeProjectedFiles(idList, layerList, fileSuffix): fmask = 'C:\\amigos\\dump\\%s-%s.3dm' outMask = 'C:\\amigos\\dump\\%s-'+fileSuffix+'.3dm' types = ['site', 'terrain'] outLayers = [s+'-projected' for s in layerList] for siteId in idList: FileUtils.deleteAll() fpaths = [(fmask % (siteId, t)) for t in types] FileUtils.importFiles(fpaths) for i, layer in enumerate(layerList): lyrAtt = LayerUtils.layerAttributes(outLayers[i]) # make the layer # determine geometry type sampleGeom = LayerUtils.getLayerGeometry(layer) if len(sampleGeom) > 0: if type(sampleGeom[0]) == Point: resultPairs = IntersectionTools.smartPointLayerProject(layer, 'groundsurface', lyrAtt) # bake results for pair in resultPairs: scriptcontext.doc.Objects.AddPoint(pair[0], pair[1]) else: resultPairs = IntersectionTools.smartCurveLayerProject(layer, 'groundsurface', lyrAtt) # bake results for pair in resultPairs: scriptcontext.doc.Objects.AddCurve(pair[0], pair[1]) outPath = outMask % siteId FileUtils.exportLayers(outLayers, outPath)
def makeTerrainFile(site_id): filePath = 'C:\\amigos\\dump\\%s-terrain.3dm' % site_id outLayers = [ 'groundsurface', 'bigcontours', 'smallcontours', ] FileUtils.exportLayers(outLayers, filePath)
def makeBillboardFiles(idList): fmask = 'C:\\amigos\\dump\\%s-%s.3dm' outMask = 'C:\\amigos\\dump\\%s-billboards.3dm' types = ['billboardpoints', 'terrain', 'roads', ] outLayers = ['billboards'] for siteId in idList: FileUtils.deleteAll() fpaths = [(fmask % (siteId, t)) for t in types] FileUtils.importFiles(fpaths) addBillboards() outPath = outMask % siteId FileUtils.exportLayers(outLayers, outPath)
def makeBillboardFiles(idList): fmask = 'C:\\amigos\\dump\\%s-%s.3dm' outMask = 'C:\\amigos\\dump\\%s-billboards.3dm' types = [ 'billboardpoints', 'terrain', 'roads', ] outLayers = ['billboards'] for siteId in idList: FileUtils.deleteAll() fpaths = [(fmask % (siteId, t)) for t in types] FileUtils.importFiles(fpaths) addBillboards() outPath = outMask % siteId FileUtils.exportLayers(outLayers, outPath)
def makeDrainFiles(idList): fmask = 'C:\\amigos\\dump\\%s-%s.3dm' outMask = 'C:\\amigos\\dump\\%s-drains.3dm' types = ['site', 'terrain'] outLayers = ['openchannels-projected', 'gravitymains-projected', 'lateraldrains-projected', 'catchbasins-projected', ] for id in idList: FileUtils.deleteAll() fpaths = [(fmask % (id, t)) for t in types] FileUtils.importFiles(fpaths) makeDrains() outPath = outMask % id FileUtils.exportLayers(outLayers, outPath)
def makeDrainFiles(idList): fmask = 'C:\\amigos\\dump\\%s-%s.3dm' outMask = 'C:\\amigos\\dump\\%s-drains.3dm' types = ['site', 'terrain'] outLayers = [ 'openchannels-projected', 'gravitymains-projected', 'lateraldrains-projected', 'catchbasins-projected', ] for id in idList: FileUtils.deleteAll() fpaths = [(fmask % (id, t)) for t in types] FileUtils.importFiles(fpaths) makeDrains() outPath = outMask % id FileUtils.exportLayers(outLayers, outPath)