Home Image-Pro General Discussions

How do I determine the right IMPORTS / REFERENCES to add?

All --

The following code works well in PROJECT A
        'Turn on the RECTANGULAR ROI TOOL
        With Select.Roi.ToolsCommands.Rectangle(Nothing)
            .Image = .GetImage("Select.Roi.Tools.Rectangle")
            .Overlay = Overlays.OverlayType.ROIOverlay
            .Tool = Overlays.OverlayToolType.McGraphObjRect
            .Run(ThisApplication.ActiveImage)
        End With
When pasted into basically a NEW PROJECT B, the LOAD fails on the

            .Overlay = Overlays.OverlayType.ROIOverlay

line.

I've copied all of the IMPORTS statements from PROJECT A into PROJECT B but I still get an error that says

    EXPECTING A VALID DATA TYPE (INTEGER) . . . CHAR 54

How do I determine what is needed in PROJECT B to make this code perform like it does in PROJECT A?

Thanks.

-- Matt

Best Answers

  • Answer ✓
    Matt,

    You can export the references from project A and import them in project B using the Import/Export Dependencies feature on the Edit tab of the Workbench.

    Pierre
  • Answer ✓
    Matt,

    If you look at the type of the Select.Roi.ToolsCommands.Rectangle property (Tool class), it is defined in Assembly: MediaCy.Commands.Overlays (Module: MediaCy.Commands.Overlays.dll)

    Pierre

Answers

  • Pierre --

    Thank you for your response and introducing me to a new tool.

    Also . . .

    By TRIAL AND ERROR, I determined that

        MEDIACY.COMMANDS.OVERLAYS.DLL

    is the REFERENCE that PROJECT B needs to use the

                .Overlay = Overlays.OverlayType.ROIOverlay
    statement within

            'Turn on the RECTANGULAR ROI TOOL
            With Select.Roi.ToolsCommands.Rectangle(Nothing)
                .Image = .GetImage("Select.Roi.Tools.Rectangle")
                .Overlay = Overlays.OverlayType.ROIOverlay
                .Tool = Overlays.OverlayToolType.McGraphObjRect
                .Run(ThisApplication.ActiveImage)
            End With

    Is there an OFFICIAL way to trace which DLL is needed?

    The AUTOMATION HELP FILE does not seem to say within

    Image-Pro Premier Automation Help
    ToolsCommands Class
    Automation ReferenceMediaCy.Automation.Select.Roi ► ToolsCommands Visual Basic

    Thanks.

    -- Matt



Sign In or Register to comment.