Create custom move, rotate, and scale GeometricEffects within a single project


Purpose
This sample tool demonstrates how to create multiple sets of geometric effects in a single project and adds it to the existing list of geometric effects. Three geometric effects for move, rotate, and scale are included in the sample.
IGeometricEffect and IGraphicAttributes are the two basic interfaces that are required to be implemented by every geometric effect class. IPersistVariant interface is implemented, in addition to persist the class.
The sample also implements IEditInteraction so that all graphic attributes that are used to control the custom class will be exposed using the graphical user interface (GUI) through the representation tools.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample.

Data has been provided for your use with this sample. It can be found at <Your ArcGIS Developer Kit Install directory>/Samples/data/Representations/representations.gdb.
If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Open the Visual Studio solution file and build the project. This adds the custom object into the ESRI Representation Geometric Effect component category as GETransformCSharp.GETransform_Move, GETransformCSharp.GETransform_Rotate, and GETransformCSharp.GETransform_Scale. The component name will differ if the VB.NET project solution is built.
  2. Open a new or existing ArcMap document.
  3. Click the Add Data button to add a point, line, or polygon feature class with representations to the map document.
  4. In the Layer Properties dialog box, change the Feature Renderer to Representation Renderer on the Symbology tab.
  5. Select any Representation Rule (for example, RuleA) in the Representation Renderer for which you want to add this custom geometric effect to.
  6. Select a symbol layer (for example, LayerA) in this representation rule or add a new symbol layer.
  7. Click + next to the selected symbol layer to open the Geometric Effects dialog box, which lists all geometric effects. The custom classes will be listed under the point, line, and polygon input options. Select one of the effects from Transform Move, Transform Rotate, or Transform Scale to produce either a move, rotate, or scaling effect on the display geometries.
  8. Change the values for the graphic attributes for these custom effects or accept the default values.
  9. Close the Layer Properties dialog box.
  10. Start an edit session to interactively modify these attributes.
  11. Select a feature representation that uses the rule applied with the Move custom effect using the Select tool in the Representation toolbar.
  12. Click the Representation Properties tool in the toolbar to open a dialog box. Make sure that the Tool tab is also selected.
  13. Select the Move tool in the Representation toolbar. All attributes that can be modified interactively using the Resize tool appear in a list under the layer (LayerA). You will see both attributes of the Move effect (X and Y offset distances) listed.
  14. Check the check boxes for the attributes and use the Move tool to interactively modify the attributes.
  15. Clear the check boxes if you do not want to modify these attributes interactively.
  16. Similarly, rotate and resize the representation tools present in the Representation toolbar can be used interactively in an edit session to work with the rotate and resize custom geometric effects.


  17. The Layer Properties dialog box with highlighted tabs and buttons used in this sample.

Additional information

Description of the tools

Move Geometric Effect—This sample tool allows a point, line, and polygon geometry to be processed to result in a Move effect, moving display geometry by a given x and y offset distances. The Move representation tool in the Representations toolbar can be interactively used to modify the x and y offset distances in an edit session.

Rotate Geometric Effect—This sample tool allows a line and polygon geometry to be processed to result in a Rotate effect, rotating display geometry by a given rotation angle. The Rotate representation tool in the Representations toolbar can be interactively used to modify the angle of rotation in an edit session.

Scale Geometric Effect—This sample tool allows a line and polygon geometry to be processed to result in a Scale effect, scaling the display geometry by a given x and y scaling factors. The Resize representation tool in the Representations toolbar can be interactively used to modify the x and y scaling factors in an edit session.


GETransform_Move.cs ArcObjects code for Move.
GETransform_Rotate.cs ArcObjects code for Rotate.
GETransform_Scale.cs ArcObjects code for Scale.
Download the C# files
clsGE_Transform_Move.vb ArcObjects code for Move.
clsGE_Transform_Rotate.vb ArcObjects code for Rotate.
clsGE_Transform_Scale.vb ArcObjects code for Scale.
My Project/AssemblyInfo.vb Assembly information.
Download the VB.NET files

Download the files for all languages




Additional Requirements
  • A point, line, or polygon feature class with representations. One has been provided for you if you want to use it. It is in the provided geodatabase and the line feature class with representations is usa_major_highways.

Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced