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/Schematics/GenericDigitizing.gdb and <Your ArcGIS Developer Kit Install directory>/Samples/data/Schematics/DigitizeProperties.xml.
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.
Building the project
- Start Visual Studio, open the solution file, and build the project.
Adding the new tool to the ArcMap toolbar and opening the sample schematic diagram
- Navigate to <ArcGIS DeveloperKit install location>\Samples\data\Schematics, and copy both the GenericDigitizing.gdb geodatabase and DigitizeProperties.xml file in a folder for which you have full rights.
- Start ArcMap and open a new empty map.
- Click Customize, and click Customize Mode. The Customize dialog box opens.
- Click the Commands tab, select the Schematic Samples category, and drag the DigitTool tool onto the Schematic Editor toolbar.
- Click Close on the Customize dialog box.
- Click Open Schematic Diagrams on the Schematic toolbar and browse to and select the Crime1 schematic diagram contained in the DigitizingSample schematic dataset in the GenericDigitizing sample geodatabase you copied at step#1.
- Click Start Editing Diagram on the Schematic Editor drop-down menu.
- Click the schematic digitizing tool (DigitTool). The Schematic Digitize dockable window opens. This window is organized in two sections: the first section concerns the digitizing of schematic nodes, the second section concerns the digitizing of schematic links.
Digitizing schematic nodes
- On the Schematic Digitize dialog box's first section, click the Node Type drop-down list
- Choose the type of node you want to digitize in the active diagram; for this example, choose Person.
- Fill in the Name text box; for example, type PersonA. The name is a mandatory parameter that needs to be specified before digitizing the related node in the active schematic diagram.
- Click anywhere in the background of the schematic diagram. The new PersonA schematic node appears at the clicked location.
Digitizing schematic links
- On the Schematic Digitize dialog box's second section, click the Link Type drop-down list.
- Choose the type of link you want to digitize in the active diagram; for this example, choose Relation.
- Using the Relation Type drop-down list, specify the type of relation you want to create. This is a mandatory parameter that needs to be specified before going further. For this example, choose person-person-friend.
- Click two persons nodes in the active diagram. A link connecting the two clicked nodes is created.
Stopping the digitizing operations
- Click Stop Editing Diagram on the Schematic Editor drop-down menu.
- Click Yes to save the edits. The newly digitized schematic features are saved in the schematic dataset.
Additional information
If you want to use this add-in tool to digitize schematic features in your own schematic database, you only need to configure the DigitizeProperties.xml file.
-
Navigate to <ArcGIS DeveloperKit install location>\Samples\data\Schematics, and copy the DigitizeProperties.xml file in the same folder your schematic database is.
-
Edit this copied DigitizeProperties.xml file with a text editor.
-
REQUIRED—Set up the node and link schematic feature classes you want to digitize:
-
Create a NodeFeature item for each node schematic feature class you want to digitize and type the exact name of the node schematic feature class in your schematic dataset for the FeatureClassName parameter.
For example, if you want to digitize Valves schematic nodes, you must configure a NodeFeature item as follows:
<NodeFeature FeatureClassName="Valves">
</NodeFeature> -
Create a LinkFeature item for each link schematic feature class you want to digitize and type the exact name of the link schematic feature class in your schematic dataset for the FeatureClassName parameter.
For example, if you want to digitize PrimaryLines schematic links, you must configure a LinkFeature item as follows:
<LinkFeature FeatureClassName="PrimaryLines">
</LinkFeature> -
OPTIONAL—Set up the attributes you want to edit for each digitized schematic feature:
-
Create a Field item for each attribute you want to be editable through the digitizing form.
-
Specify the DisplayName parameter. This is the label that will display for this attribute on the digitizing form.
-
Specify the DBColumnName parameter. This is name of the related field in the schematic feature class.
-
Specify the Type parameter—Text, Date, Combo or MaskText. This is the type of attribute values the user will edit.
-
With a Text type, a regular text box will be automatically added to the digitizing form.
In this case, when configuring the Length parameter, you can also limit the number of characters the user can type in the text box. -
With a Date type, a drop down date pick list will be automatically added to the digitizing form.
-
With a Combo type, a combo box will be automatically added to the digitizing form.
In this case, you must also configure a list of Value parameters, for each possible value you want to display in the combo box. -
With a MaskText type, a text box will be automatically added to the digitizing form to allow users typing a specific type of text value that will have to verify a specific format. For example, a field that will be used to have the user enter their social security number.
In this case, you must provide the expected format—Mask parameter. For example, "###-##-###". See the Appendix section above for more details on Mask. -
Specify when the attribute is mandatory or not—Mandatory parameter, True or False. With Mandatory="True", it forces the user to specify the field value.
Here are sample parameters to allow the digitizing of nodes based on the Persons schematic feature class and fill some attribute fields for the digitized person:
<NodeFeature FeatureClassName="Persons" />
<Field DisplayName="Your Name" DBColumnName="NAME" Type="Text" Length="30" Mandatory="True">
<Field DisplayName="Date of Birth" DBColumnName="BIRTH_DATE" Type="Date" Mandatory="True">
<Field DisplayName="Sexe" DBColumnName="SEXE" Type="Combo"
<Value Default="True">"M"</Value>
<Value>"F"</Value>
</Field>
<Field DisplayName="Social Security Number" DBColumnName="SS_NUM" Type="MaskText" Mask= "###-##-###"/>
</NodeFeature>
- OPTIONAL—Set up the link relationships if you want to enforce that a certain type of link can only connect to and from certain type of nodes.
Such link relationships must be configured inside a <Relations>…</Relations> tag, surrounding all the individual <Relation…></Relation>. - Specify the LinkType parameter. This is the exact name of the link schematic feature class in your schematic dataset you want to use when digitizing this kind of relation.
- Specify the FromType parameter. This is the exact name of the node schematic feature class in your schematic dataset which contains nodes that can be at the start for this kind of relations.
- Specify the ToType parameter. This is the exact name of the node schematic feature class in your schematic dataset which contains nodes that can be at the end for this kind of relations.
- Specify subtypes for the possible relations if needed.
For example, if you want to allow a connection from a Persons node to another Persons node, but want to specify if the relationship is as a Friend or Enemy, you can specify two parameters Value.
<Relations>
<Relation LinkType="Link1" FromType="Persons" ToType="Persons">
<Value>Friend</Value>
<Value>Enemy</Value>
</Relation>
</Relations>
- REQUIRED—Customize the digitizing form:
- Specify the MandatoryColor parameter. This is the background color that will be used for each edited attribute you set up as mandatory during step#4.e.
- Specify the FormName parameter. This is the caption of the digitizing form the user will see.
- Specify the AutoClearAfterCreate parameter, True or False. This determines whether all edited attributes are cleared after the user digitizes a schematic feature or not.
Those three parameters must be configured at the end of the XML file:
<?xml version="1.0" encoding="utf-8" ?>
<Properties>
…
…
<MandatoryColor>Yellow</MandatoryColor>
<FormName>Digitize Inside Plants</FormName>
<AutoClearAfterCreate>True</AutoClearAfterCreate>
</Properties>
- Save your DigitizeProperties.xml file.
- Set up your schematic dataset so that it knows where the DigitizeProperties.xml file is.
- Edit your schematic dataset within Schematic Dataset Editor.
- Right-click the schematic diagram template entry related to the diagrams in which you want to allow the digitizing of schematic features, and click New Attribute.
- Type DigitizePropertiesLocation for the attribute Name.
- Select Constant for the attribute Type.
- Type .\DigitizeProperties.xml for the attribute Value.
- Click OK.
- Save your schematic dataset.
Appendix—Mask Characters Description
- # Digit placeholder.
- . Decimal placeholder.
The actual character used is the one specified as the decimal placeholder in your international settings. This character is treated as a literal for masking purposes. - , Thousands separator.
The actual character used is the one specified as the thousands separator in your international settings. This character is treated as a literal for masking purposes. - : Time separator.
The actual character used is the one specified as the time separator in your international settings. This character is treated as a literal for masking purposes. - / Date separator.
The actual character used is the one specified as the date separator in your international settings. This character is treated as a literal for masking purposes. - \ Treat the next character in the mask string as a literal. This allows you to include the '#', '&', 'A', and '?' characters in the mask. This character is treated as a literal for masking purposes.
- & Character placeholder.
Valid values for this placeholder are ANSI characters in the following ranges: 32-126 and 128-255. - > Convert all the characters that follow to uppercase.
- < Convert all the characters that follow to lowercase.
- A Alphanumeric character placeholder (entry required).
For example: a – z, A – Z, or 0 – 9. - a Alphanumeric character placeholder (entry optional).
- 9 Digit placeholder (entry optional).
For example: 0 – 9. - C Character or space placeholder (entry optional).
This operates exactly like the & placeholder, and ensures compatibility with Microsoft Access. - ? Letter placeholder.
For example: a – z or A – Z.
Literal All other symbols are displayed as literals; that is, as themselves.
DigitTool.vb | Class file that implements the digitizing tool. |
DockableDigit.vb | Class that implements the dockable window with digit properties. |
Config.esriaddinx | Add-in declarations in XML. |
DigitTool.cs | Class file that implements the digitizing tool. |
DockableDigit.cs | Class that implements the dockable window with digit properties. |
Config.esriaddinx | Add-in declarations in XML. |
Download the files for all languages
See Also:
ISchematicInMemoryFeatureClassDevelopment licensing | Deployment licensing |
---|---|
ArcGIS for Desktop Basic: Schematics | ArcGIS for Desktop Basic: Schematics |
ArcGIS for Desktop Standard: Schematics | ArcGIS for Desktop Standard: Schematics |
ArcGIS for Desktop Advanced: Schematics | ArcGIS for Desktop Advanced: Schematics |