This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > NetworkAnalysis > ESRI.ArcGIS.NetworkAnalysis > Interfaces > IN > INetFlag Interface (ArcObjects .NET 10.5 SDK) |
Provides access to members that specify the network element on which a flag is located.
Description | ||
---|---|---|
ClientClassID | User-specified client class ID of this flag. | |
ClientID | User-specified client ID of this flag. | |
Label | Label of this flag. | |
UserClassID | User class ID of the network element on which this flag is placed. | |
UserID | User ID of the network element on which this flag is placed. | |
UserSubID | User sub ID of the network element on which this flag is placed. |
CoClasses and Classes | Description |
---|---|
EdgeFlag | A container for defining a network flag on an edge element for a trace flow solver. |
JunctionFlag | A container for defining a network flag on a junction element for a trace flow solver. |
Flags are the starting points of tracing operations on networks. Flags can either be placed on edges or junctions.
The following code can be used to create a flag on a junction element:
IJunctionFlag junctionFlag=new JunctionFlagClass() as IJunctionFlag;
The following code can be used to create a flag on an edge element:
IEdgeFlag edgeFlag=new EdgeFlagClass() as IEdgeFlag;
Once either flag object is created, you need to get a reference to the INetFlag interface to specify to which network element the flag belongs. This requires knowing three items about a network element:
1. UserClassID - This is the ID of the feature class which the feature belongs to.
2. UserID - This is the ID of the feature within the feature class.
3. UserSubID - This is the ID of an individual element within a feature.
These three properties can be queried from an element ID (EID) by calling INetElements::QueryIDs.
Using the junction flag as an example we can populate the parameters of the object:
INetFlag netFlag=junctionFlag as INetFlag;
netFlag.set_UserClassID=userClassID;
netFlag.set_UserID=userID;
netFlag.set_UserSubID=userSubID;
The TraceFlowSolver object needs to know about this flag before it can use it in any tracing functions. Once you have created all your flags for your trace, you can add them to the TraceFlowSolver object by calling PutEdgeOrigins or PutJunctionOrigins on the ITraceFlowSolver interface.
The following code can be used to create a flag on a junction element:
Dim junctionFlag As IJunctionFlag=New JunctionFlag
The following code can be used to create a flag on an edge element:
Dim edgeFlag As IEdgeFlag=New EdgeFlag
Once either flag object is created, you need to get a reference to the INetFlag interface to specify to which network element the flag belongs. This requires knowing three items about a network element:
1. UserClassID - This is the ID of the feature class which the feature belongs to.
2. UserID - This is the ID of the feature within the feature class.
3. UserSubID - This is the ID of an individual element within a feature.
These three properties can be queried from an element ID (EID) by calling INetElements::QueryIDs.
Using the junction flag as an example we can populate the parameters of the object:
Dim netFlag As INetFlag=CType(junctionFlag, INetFlag)
netFlag.UserClassID=userClassID
netFlag.UserID=userID
netFlag.UserSubID=userSubID
The TraceFlowSolver object needs to know about this flag before it can use it in any tracing functions. Once you have created all your flags for your trace, you can add them to the TraceFlowSolver object by calling PutEdgeOrigins or PutJunctionOrigins on the ITraceFlowSolver interface.
INetFlag Interface | IJunctionFlag Interface | IEdgeFlag Interface