# EditMultiGraphics

The EditMultiGraphics function Functions are tools that are available in Spreadsheet for processing and analyzing acquisitions or other results. You can add functions to your Spreadsheet job to create tool chains and produce results for specific applications. allows you to edit multiple shape graphics at the same time. The function achieves this by referencing other Control functions that insert interactive graphics controls.

You can use the EditMultiGraphics function with the following Control functions:

- EditAnnulus

- EditCircle

- EditCompositeRegion

- EditLine

- EditMaskedRegion

- EditPoint

- EditPolygon

- EditPolylinePath

- EditRegion

When you click the control, the display switches to Interactive Graphics Mode, where you can adjust the position of all referenced Control functions. The following image shows the Interactive Graphics Mode and the cells for an EditMultiGraphics function that references EditCircle, EditLine, EditAnnulus, and EditRegion functions. The following table details the parameters of the EditMultiGraphics function used in the image:

A2 = EditMultiGraphics(A0,"MultiGraphics",0,C2,C4,C6,C8)
Parameter Value | Description
--- | ---
A0 | A reference to the acquired image
"MultiGraphics" | A label for the control button
0 | Defines whether the function shows the individual labels in Interactive Graphics Mode
C2 | A reference to an EditCircle function
C4 | A reference to an EditLine function
C6 | A reference to an EditAnnulus function
C8 | A reference to an EditRegion function

Note: You can edit EditMultiGraphics from the WebHMI The operator interface through which the operator interacts with the vision system..

The function has the following characteristics:

- The EditMultiGraphics function does not have a property sheet. The function has three parameters and a variable list of arguments that reference existing Control functions.

- The maximum allowed cell length is 255 characters. If you use more than 255 characters to specify the variable argument, an error message is displayed. If you use a string to specify the variable arguments, Cognex recommends using a cell range.

- The EditMultiGraphics ignores any functions in its variable list which are either #ERR or conditionally disabled, and only displays the Control functions that can be edited.

When you use the Interactive Graphics mode with the EditMultiGraphics function, consider the following interactions:

- To accept the changes after editing the shapes, click Accept Changes in the Toolbar or press ENTER.

- To discard the changes after editing the shapes, click Cancel Changes in the Toolbar or press ESC.

- To display the overlay graphics of the referenced Control functions, ensure that you set the Show parameter of the referenced functions to display the overlay graphics at all times. Otherwise, the function only displays overlay graphics when you highlight the EditMultiGraphics function or the individual cell containing the overlay graphics.

Inputs

The EditMultiGraphics function has the following syntax:

EditMultiGraphics(Image, Name, Show Labels, Edit Control 0, [Edit Control 1... Edit Control n])

See the table for a description of the available parameters:

Parameter | Description
--- | ---
Image | This parameter must reference a spreadsheet cell that contains an Image data structure; by default, this parameter references A0, the cell containing the AcquireImage Image data structure. This parameter can also reference other Image data structures, such as those returned by the Vision Tool Image functions or Coordinate Transforms Functions. For more information, see Image or Coordinate Transforms Functions. Note: The EditMultiGraphics function must share the same Image reference as the Control functions it references. If one or more of the Control functions that the EditMultiGraphics function references do not share the same Image reference, the function returns #ERR.
Name | Specifies a text label for the EditMultiGraphics control element in the spreadsheet.
Show Labels | Note: This parameter is currently not implemented and has no effect.
Edit Control 0 | Specifies a cell reference to a Control function. Each reference is a separate parameter. Note: You can reference up to 255 Control functions if the length of the cell expression does not exceed 255 characters.
Edit Control 1
Edit Control n

Outputs

Results | An EditMultiGraphics control. The function returns #ERR if the function references a cell that does not contain a supported Control function or the Image reference of the EditMultiGraphics function does not match the Image reference of the referenced Control functions.