Forum

Author Topic: problem with importPoints()  (Read 3770 times)

ro-teodoro

  • Newbie
  • *
  • Posts: 4
    • View Profile
problem with importPoints()
« on: November 24, 2022, 10:12:05 PM »
When using the importPoints method in a script to import multiple .LAZ files it imports the files one by one but always replacing the previous one leaving only the last one.

How can I avoid this and then combine all the files?
 this is my code...

Code: [Select]

import Metashape

from os import listdir
print('starting...')

path = 'the path'

files = listdir(path)

for i in files:
    print(i,end="\r")

    if i[-4:len(i)] == '.laz':

        print('importando... {}'.format(i), end="\r")
        path2 = path+'/'+i
        Metashape.app.document.chunk.importPoints(path2)

« Last Edit: November 24, 2022, 10:13:58 PM by ro-teodoro »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15406
    • View Profile
Re: problem with importPoints()
« Reply #1 on: November 25, 2022, 12:31:42 PM »
Hello ro-teodoro,

If you are using Metashape 1.8 you need to add the following line before importPoints line in your code:
Code: [Select]
Metashape.app.document.chunk.dense_cloud = NoneIt will switch the current dense cloud to inactive state, thus it wouldn't be replaced.
Best regards,
Alexey Pasumansky,
Agisoft LLC

ro-teodoro

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: problem with importPoints()
« Reply #2 on: November 25, 2022, 08:06:55 PM »
thank you very much it has been very helpful