Skip to content

Commit

Permalink
https://github.com/Esri/local-government-desktop-addins/issues/212
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMillerGIS committed Feb 17, 2017
1 parent 4e1e24c commit f1cb5a9
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 71 deletions.
8 changes: 8 additions & 0 deletions ArcGISTemplateSharedFunctions/ConfigDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,10 @@ public ConstructLineWithPointsDetails()
public string TwoPointLines { get; set; }
[XmlElement("PointAtVertices")]
public string PointAtVertices { get; set; }

[XmlElement("Store_Order")]
[System.ComponentModel.DefaultValue("Active")]
public string Store_Order { get; set; }

}

Expand Down Expand Up @@ -441,6 +445,10 @@ public ConnectClosestDetails()
[XmlElement("Reset_Flow")]
[System.ComponentModel.DefaultValue("NONE")]
public string Reset_Flow { get; set; }

[XmlElement("Store_Order")]
[System.ComponentModel.DefaultValue("Active")]
public string Store_Order { get; set; }

}

Expand Down
2 changes: 1 addition & 1 deletion ArcGISTemplateSharedFunctions/UserMessages.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ArcGISTemplateSharedFunctions/UserMessages.es-ES.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3491,7 +3491,7 @@
<comment>The field type does not match the value</comment>
</data>
<data name="dynamicValueTableMissing" xml:space="preserve">
<value>Dynamic Value Table is required to activate the Attribute Assistant</value>
<value>DynamicValue Table is required to activate the Attribute Assistant</value>
<comment>Needs Translation</comment>
</data>
</root>
2 changes: 1 addition & 1 deletion ArcGISTemplateSharedFunctions/UserMessages.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3490,7 +3490,7 @@
<value>The field type does not match the value</value>
</data>
<data name="dynamicValueTableMissing" xml:space="preserve">
<value>Dynamic Value Table is required to activate the Attribute Assistant</value>
<value>DynamicValue Table is required to activate the Attribute Assistant</value>
<comment>Needs Translation</comment>
</data>
</root>
2 changes: 1 addition & 1 deletion ArcGISTemplateSharedFunctions/UserMessages.fr-FR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2643,7 +2643,7 @@
<comment>Needs Localization</comment>
</data>
<data name="dynamicValueTableMissing" xml:space="preserve">
<value>Dynamic Value Table is required to activate the Attribute Assistant</value>
<value>DynamicValue Table is required to activate the Attribute Assistant</value>
<comment>Needs Translation</comment>
</data>
</root>
2 changes: 1 addition & 1 deletion ArcGISTemplateSharedFunctions/UserMessages.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2650,6 +2650,6 @@
<value>The field type does not match the value</value>
</data>
<data name="dynamicValueTableMissing" xml:space="preserve">
<value>Dynamic Value Table is required to activate the Attribute Assistant</value>
<value>DynamicValue Table is required to activate the Attribute Assistant</value>
</data>
</root>
7 changes: 4 additions & 3 deletions Configs/loaded.water.config
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,8 @@
<TwoPointLines>false</TwoPointLines>

<!--Option to create a point at each vertex, not just end points-->
<PointAtVertices>false </PointAtVertices>

<PointAtVertices>false</PointAtVertices>
</ConstructLineWithPointsDetails>
<ConstructLineWithPointsDetails>

Expand All @@ -459,7 +459,7 @@
<Point_End_LayerName>Sewer Manholes</Point_End_LayerName>

<!--The default template to use to attribute the points, can be blank, user will be prompted for template-->
<Point_End_EditTemplate>Manhole </Point_End_EditTemplate>
<Point_End_EditTemplate>Manhole</Point_End_EditTemplate>


<!--Option to split the line at each turn, creates multi lines features-->
Expand Down Expand Up @@ -523,6 +523,7 @@
<Line_EditTemplate>18" PVC Storm</Line_EditTemplate>
<Search_Threshold>450</Search_Threshold>
<Reset_Flow>Digitized</Reset_Flow>

</ConnectClosestDetails>
</ConnectClosest>
<!-- End Configuration for the Connect Closest Tools, this is an XML array of ConnectClosestDetails, you can specify any number of combinations -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,10 @@ private void OnSketchFinished()
twoPoint = CreateLineWithEndPoints.CreatePoints(ArcMap.Application, ConfigUtil.GetLinePointAtEndsConfig(), m_edSketch.Geometry as IPolyline, (IFeatureLayer)m_editor.CurrentTemplate.Layer, true, out pLstFeat);
}


foreach (IFeature pFt in pLstFeat)
{
pFt.Store();
}
if (twoPoint)
{

Expand Down Expand Up @@ -531,10 +534,7 @@ private void OnSketchFinished()

}

foreach (IFeature pFt in pLstFeat)
{
pFt.Store();
}

pLstFeat = null;

m_editor.StopOperation(A4LGSharedFunctions.Localizer.GetString("CrtLnWithPts"));
Expand Down Expand Up @@ -780,73 +780,97 @@ private void OnShapeConstructorChanged()

private void OnSketchFinished()
{
ConfigUtil.type = "water";
Keys ModKey = Control.ModifierKeys;
try
{

// Send a shift-tab to hide the construction toolbar

m_editor.StartOperation();
IFeature pFeat = null;
returnFeatArray pRetVal = null;
if (ModKey == Keys.Shift)
{
pFeat = Globals.CreateFeature(m_edSketch.Geometry, m_editor.CurrentTemplate, m_editor, ArcMap.Application, false, false, true);
pRetVal = ConnectClosest.ConnectClosestFeatureAtPoint(ArcMap.Application, ConfigUtil.GetConnectClosestConfig(), m_edSketch.Geometry as IPoint, m_editor.CurrentTemplate.Layer.Name, true, ModKey);
// pFeat.Store();
}
else if (ModKey == (Keys.Control | Keys.Shift))
{
pFeat = Globals.CreateFeature(m_edSketch.Geometry, m_editor.CurrentTemplate, m_editor, ArcMap.Application, false, false, true);
pRetVal = ConnectClosest.ConnectClosestFeatureAtPoint(ArcMap.Application, ConfigUtil.GetConnectClosestConfig(), m_edSketch.Geometry as IPoint, m_editor.CurrentTemplate.Layer.Name, true, ModKey);
// pFeat.Store();
}
else if (ModKey == Keys.Control)
{
pFeat = Globals.CreateFeature(m_edSketch.Geometry, m_editor.CurrentTemplate, m_editor, ArcMap.Application, false, true, true);
pRetVal = ConnectClosest.ConnectClosestFeatureAtPoint(ArcMap.Application, ConfigUtil.GetConnectClosestConfig(), m_edSketch.Geometry as IPoint, m_editor.CurrentTemplate.Layer.Name, true, ModKey);
// pFeat.Store();
}
else
{
ConfigUtil.type = "water";
Keys ModKey = Control.ModifierKeys;

pFeat = Globals.CreateFeature(m_edSketch.Geometry, m_editor.CurrentTemplate, m_editor, ArcMap.Application, false, true, true);
pRetVal = ConnectClosest.ConnectClosestFeatureAtPoint(ArcMap.Application, ConfigUtil.GetConnectClosestConfig(), m_edSketch.Geometry as IPoint, m_editor.CurrentTemplate.Layer.Name, true, ModKey);
// Send a shift-tab to hide the construction toolbar

}
pFeat.Store();
foreach (IFeature featus in pRetVal.Features)
{
featus.Store();
m_editor.StartOperation();
IFeature pFeat = null;
returnFeatArray pRetVal = null;
if (ModKey == Keys.Shift)
{
pFeat = Globals.CreateFeature(m_edSketch.Geometry, m_editor.CurrentTemplate, m_editor, ArcMap.Application, false, false, true);
pRetVal = ConnectClosest.ConnectClosestFeatureAtPoint(ArcMap.Application, ConfigUtil.GetConnectClosestConfig(), m_edSketch.Geometry as IPoint, m_editor.CurrentTemplate.Layer.Name, true, ModKey);
// pFeat.Store();
}
else if (ModKey == (Keys.Control | Keys.Shift))
{
pFeat = Globals.CreateFeature(m_edSketch.Geometry, m_editor.CurrentTemplate, m_editor, ArcMap.Application, false, false, true);
pRetVal = ConnectClosest.ConnectClosestFeatureAtPoint(ArcMap.Application, ConfigUtil.GetConnectClosestConfig(), m_edSketch.Geometry as IPoint, m_editor.CurrentTemplate.Layer.Name, true, ModKey);
// pFeat.Store();
}
else if (ModKey == Keys.Control)
{
pFeat = Globals.CreateFeature(m_edSketch.Geometry, m_editor.CurrentTemplate, m_editor, ArcMap.Application, false, true, true);
pRetVal = ConnectClosest.ConnectClosestFeatureAtPoint(ArcMap.Application, ConfigUtil.GetConnectClosestConfig(), m_edSketch.Geometry as IPoint, m_editor.CurrentTemplate.Layer.Name, true, ModKey);
// pFeat.Store();
}
else
{

}
pFeat = Globals.CreateFeature(m_edSketch.Geometry, m_editor.CurrentTemplate, m_editor, ArcMap.Application, false, true, true);
pRetVal = ConnectClosest.ConnectClosestFeatureAtPoint(ArcMap.Application, ConfigUtil.GetConnectClosestConfig(), m_edSketch.Geometry as IPoint, m_editor.CurrentTemplate.Layer.Name, true, ModKey);

if (pRetVal.Options == "DIGITIZED")
{
Globals.GetCommand("A4WaterUtilities_EstablishFlowDigitized", ArcMap.Application).Execute();
}
//INetworkFeature netFeature = null;
//netFeature = pFeat as INetworkFeature;
//if (netFeature != null)
//{
// netFeature.Connect();
//}
pFeat.Store();
foreach (IFeature featus in pRetVal.Features)
{

}
else if (pRetVal.Options == "ROLE")
{
Globals.GetCommand("A4WaterUtilities_EstablishFlowAncillary", ArcMap.Application).Execute();
}
else if (pRetVal.Options == "Ancillary".ToUpper())
{
Globals.GetCommand("A4WaterUtilities_EstablishFlowAncillary", ArcMap.Application).Execute();
}
else
{
}
// addLat.AddLateralAtPoint(m_edSketch.Geometry as IPoint, m_editor.CurrentTemplate.Layer.Name);
//netFeature = featus as INetworkFeature;
//if (netFeature != null)
//{
// netFeature.Connect();
//}
featus.Store();

}

if (pRetVal.Options == "DIGITIZED")
{
Globals.GetCommand("A4WaterUtilities_EstablishFlowDigitized", ArcMap.Application).Execute();

}
else if (pRetVal.Options == "ROLE")
{
Globals.GetCommand("A4WaterUtilities_EstablishFlowAncillary", ArcMap.Application).Execute();
}
else if (pRetVal.Options == "Ancillary".ToUpper())
{
Globals.GetCommand("A4WaterUtilities_EstablishFlowAncillary", ArcMap.Application).Execute();
}
else
{
}
// addLat.AddLateralAtPoint(m_edSketch.Geometry as IPoint, m_editor.CurrentTemplate.Layer.Name);

m_editor.StopOperation(A4LGSharedFunctions.Localizer.GetString("CrtAssetAndLat"));
m_editor.StopOperation(A4LGSharedFunctions.Localizer.GetString("CrtAssetAndLat"));

//IEnvelope pEnv = pFeat.Shape.Envelope;
//pEnv.Expand(8, 8, true);
//IEnvelope pEnv = pFeat.Shape.Envelope;
//pEnv.Expand(8, 8, true);

(ArcMap.Application.Document as IMxDocument).ActiveView.PartialRefresh(esriViewDrawPhase.esriViewAll, pFeat, null);
//pEnv = null;
pFeat = null;
pRetVal = null;
(ArcMap.Application.Document as IMxDocument).ActiveView.PartialRefresh(esriViewDrawPhase.esriViewAll, pFeat, null);
//pEnv = null;
pFeat = null;
pRetVal = null;
}
catch (Exception ex)
{

MessageBox.Show(A4LGSharedFunctions.Localizer.GetString("ErrorInThe") + A4LGSharedFunctions.Localizer.GetString("ALT_1") + ex.ToString());
m_editor.AbortOperation();
}
finally { }
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,6 @@ public static returnFeatArray ConnectClosestFeatureAtPoint(IApplication app, Lis
{
pLine = Globals.CreateFeature(pNewPoly, pEditTemp, editor, app, false, false, true);
}
pLine.Store();
pRetFeature.Add(pLine);

if ((connectClosestLayers[k] as ConnectClosestDetails).Reset_Flow != null)
Expand Down

0 comments on commit f1cb5a9

Please sign in to comment.