Home Image-Pro Automation (Macros, Apps, Reports)
Options

Is there an OPPOSITE COMMAND for MEASURE.MEASUREMENTSCOMMANDS.SELECTALL

All --

I am working on an application for a customer.

In that application, a set of samples is IDENTIFIED and then CLASSIFIED by PREMIER.

The user is given the opportunity to RECLASSIFY / CORRECT any samples misclassified by the application.

During the RECLASSIFY operation, the user "selects" the sample or samples that need to be reclassified and then presses a button on the dialog box that switches the selected samples into the desired class.

After the user is finished, the application uses the FEATURE MANAGER to remember the SAMPLES and their CLASSIFICATIONS.  This does not work properly if a subset of a CLASS is selected because the FEATURE MANAGER only remembers the selected samples.  For this reason the application needs to deselect any selected samples before doing the ADD + ADD ALL operation within FEATURE MANAGER.

When I perform a RECORD in PREMIER when I turn off the SELECT + SELECT TOOL nothing is recorded. 

I cannot find a

    MEASURE.MEASUREMENTSCOMMANDS.SELECTNONE

or a way to turn off the selection turned on by

    MEASURE.MEASUREMENTSCOMMANDS.SELECTION

but I have worked around this with the following type of code.

----------------------------------

Imports MediaCy.Addins.Measurements
Public Module Junk



    Public Function demo01() As SimpleScript
        demo01 = New SimpleScript
        Dim doc1

        With Application.DocumentCommands.Active(demo01)
            .Run(doc1)
        End With

        With Measure.MeasurementsCommands.SelectAll(demo01)
            .Run(doc1)
        End With

        With Measure.MeasurementsCommands.Selection(demo01)
            .Run(doc1)
        End With

    End Function

End Module
----------------------------------

This routine basically does the following:

-- Perform a SELECT + SELECT ALL
-- Perform a SELECT + SELECT TOOL

and the result is that no objects are selected and the ADD + ADD all within FEATURE MANAGER works properly.

Is there a more elegant way to do this that does not take the time required to perform the SELECT ALL operation on the 150+ samples in my customer's images?

Thanks.

-- Matt

Best Answers

  • Options
    Answer ✓
    Matt,

    Just pass Nothing to the Selection command to reset the selection:

        Public Function NewMacro6() As SimpleScript
            NewMacro6 = New SimpleScript
            Dim doc1
    
            With Application.DocumentCommands.Active(NewMacro6)
                .Run(doc1)
            End With
    
            With Measure.MeasurementsCommands.Selection(NewMacro6)
                .SelectionFlag = McMeasurements.enumMMSelTypes.mcmmsfAddWithReset
                .Run(doc1, Nothing)
            End With
    
        End Function
    

    Regards,

    Yuri
  • Options
    Answer ✓
    Matt,

    The macro I posted was recorded when I reset the selection (clicked on empty space), so the idea is that using mcmmsfAddWithReset will reset the selection and then add whatever is passed as second parameter and if it's Nothing then no new items are selected.

    We will discuss adding "Select None" menu item .

    Regards,

    Yuri

Answers

  • Options
    Yuri --

    Thank you for your prompt response and your example code (especially on a SUN).

    Your solution works nicely.

    Perhaps it would be good to revise the SELECT + SELECT MENU from:

    -- SELECT TOOL
    -- SELECT ALL

    to

    -- SELECT TOOL
    -- SELECT ALL
    -- SELECT NONE

    and make PREMIER record the appropriate commands.

    Thanks again.

    -- Matt
Sign In or Register to comment.