Forum

Poll

how to remove a chunk

how to remove a chunk
0 (0%)
how to remove a chunk
1 (100%)

Total Members Voted: 1

Author Topic: how to remove a chunk  (Read 8426 times)

fk122

  • Newbie
  • *
  • Posts: 4
    • View Profile
how to remove a chunk
« on: July 17, 2015, 08:19:49 AM »
hi folks  :o
i am newbie , i just want to know how to write a script that removes a chunk .

fk122

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: how to remove a chunk
« Reply #1 on: July 17, 2015, 08:26:56 AM »
or how to active a chunk
 
At the same time , i would like to ask how to call a script in another script,
eg, i would like to use script 2 in my script 1.

Many thanks


Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15471
    • View Profile
Re: how to remove a chunk
« Reply #2 on: July 17, 2015, 10:41:00 AM »
Hello fk122,

To get the active chunk you can use the following code:

Code: [Select]
doc = PhotoScan.app.document
chunk = doc.chunk

then to remove the chunk from the active document you can use:
Code: [Select]
doc.remove(chunk)
Best regards,
Alexey Pasumansky,
Agisoft LLC

fk122

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: how to remove a chunk
« Reply #3 on: July 17, 2015, 10:53:23 AM »
hi Alexey ,
i am very pleased to see your reply :-*
but sill , anyway i can call script 2 in my script 1?  Those are python file .


Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15471
    • View Profile
Re: how to remove a chunk
« Reply #4 on: July 17, 2015, 01:59:44 PM »
Hello fk122,

Have you tried using the following line in the second.py script:
Code: [Select]
import first.pyThen you should be able to use first.function() in the script body.
Best regards,
Alexey Pasumansky,
Agisoft LLC

fk122

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: how to remove a chunk
« Reply #5 on: July 20, 2015, 05:35:18 AM »
Hi Alexey,

It works, thank you so much

I still have one more problem , as now i don't want the whole script, i just want the   first sentence of  first.py in my scipt 2 , what should i do?