Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - DataBill

#1
We've made more changes. This will un-ignore and un-select the images in the tree view.

version "4.0"
# Macro to remove n layers of the outside of scans

DECLARE nb_layers 1
DECLARE nb_images 0
DECLARE i 1
DECLARE ans 1


TREEVIEW IMAGE GET_NB(nb_images)

INPUT DOUBLE(nb_layers,"Please input the number of layers to remove",\
    "Please input the number of layers to remove",\
    $nb_layers)

INPUT QUESTION(ans, "Do you want to continue?")
SELECT NONE 
while $i <=$nb_images
    if $ans == 0
        break
    endif
    TREEVIEW SELECT NONE
    TREEVIEW IMAGE SELECT ( $i, "On" )
    EDIT OBJECT USE ()
    SELECT OBJECT INVERT
    EDIT OBJECT IGNORE ( )
    TREEVIEW SELECT NONE
    TREEVIEW IMAGE SELECT ( $i, "On" )
    SELECT ALL
    CONFIG MODIFY NB_LAYERS ( $nb_layers )
    SELECT SHRINK_ALL
    SELECT INVERT
    EDIT DELETE
    ++ i
endwhile

TREEVIEW SELECT IGNORED
EDIT OBJECT USE ()
TREEVIEW SELECT NONE
#2
Thank you for the macro. This is cool. One problem I seem to have is if I click on the macro and then decide I don't want to go through with it, it does go through using the default of 1.00. I spoke with someone here who know programming and he seems to have fixed my problem. Here is the update:

version "4.0"
# Macro to remove n layers of the outside of scans

DECLARE nb_layers 1
DECLARE nb_images 0
DECLARE i 1
DECLARE ans 1


TREEVIEW IMAGE GET_NB(nb_images)

INPUT DOUBLE(nb_layers,"Please input the number of layers to remove",\
    "Please input the number of layers to remove",\
    $nb_layers)

INPUT QUESTION(ans, "Do you want to continue?")
SELECT NONE 
while $i <=$nb_images
    if $ans == 0
        break
    endif
    TREEVIEW SELECT NONE
    TREEVIEW IMAGE SELECT ( $i, "On" )
    EDIT OBJECT USE ()
    SELECT OBJECT INVERT
    EDIT OBJECT IGNORE ( )
    TREEVIEW SELECT NONE
    TREEVIEW IMAGE SELECT ( $i, "On" )
    SELECT ALL
    CONFIG MODIFY NB_LAYERS ( $nb_layers )
    SELECT SHRINK_ALL
    SELECT INVERT
    EDIT DELETE
    ++ i
endwhile


You now click "OK", then it will ask if you want to continue, if you don't want to go through with the macro you just hit no.