Implementing a schematic layout algorithm and its layout property page


Purpose
This sample shows a customized schematic layout algorithm implementation. Schematics handles the customized algorithm in the same way as a standard algorithm. The customized implementation of ISchematicAlgorithm can be added to the Layout Task drop-down list and applied from the Apply Layout button in the same way as any standard algorithm. Implementing a new IPropertyPage provides access to your custom layout algorithm's parameters.
 
Caution: If you plan to implement a customized schematic layout algorithm to be executed via a client-server application, the solution must implement two projects; one for the custom algorithm property page and the other for the custom algorithm execution itself. The component dedicated to the custom algorithm execution will have to be registered with the ArcGIS server to be used on any client-server application.
This sample creates a schematic layout algorithm (named TranslateTree) that translates a set of connected schematic features starting from a selected node according to given X and Y translation factors. The Apply Layout Task button is available for the algorithm only when a single node is currently selected in the active diagram.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. 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 solution file in Visual Studio and build the project.
  2. Start ArcMap.
  3. Open a schematic diagram and start an edit session on the diagram.
  4. Click the Edit/Move Schematic Features tool on the Schematic Editor toolbar and select an only schematic node in the active diagram.
  5. Select Translate Tree in the language you're using (C# or VB .NET) from the Layout Task drop-down list.
  6. Click Layout Algorithm Properties to edit and modify the Translate Tree properties (X and Y translation factors) if needed.
  7. Click OK.
  8. Click Apply Layout Task.

TranslateTree.cs Implementation for the custom algorithm.
ITranslateTree.cs Custom algorithm.
ApplicativeAlgorithmsCS2010.csproj Project file for the Translate Tree custom algorithm code.
TranslateTreePropPage.cs Implementation for the custom algorithm's property page.
TranslateTreePropPage.Designer.cs Custom algorithm's property page.
ApplicativeAlgorithmsPageCS2010.csproj Project file for the Translate Tree custom algorithm property page.
ApplicativeAlgorithmsCS2010.sln C# solution.
Download the C# files
TranslateTree.vb Implementation for the custom algorithm.
ITranslateTree.vb Custom algorithm.
ApplicativeAlgorithmsVBNet2010.vbproj Project file for the Translate Tree custom algorithm code.
TranslateTreePropPage.vb Implementation for the custom algorithm's property page.
TranslateTreePropPage.Designer.vb Custom algorithm's property page.
ApplicativeAlgorithmsPageVBNet2010.vbproj Project file for the Translate Tree custom algorithm property page.
ApplicativeAlgorithmsVBNet2010.sln VB .NET solution.
Download the VB.NET files

Download the files for all languages

See Also:

ISchematicAlgorithm interface
ISchematicAlgorithmEventsTrigger interface
ISchematicAnalystFindConnected interface
ISchematicInMemoryDiagram interface
ISchematicInMemoryFeature interface




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