POST
|
Hello sir I downloaded the API 4.21from this link https://developers.arcgis.com/downloads/#javascript and I can not find the [HOSTNAME_AND_PATH_TO_JSAPI] in the init.js to replace it with my host location.
... View more
12-17-2021
04:13 AM
|
1
|
0
|
3557
|
POST
|
Hello all I have a task I need to create a tool to draw a dimension feature using ArcObjects C#, I did many search but I can not find any think about this. I tried to draw the dimension by cerate 3 point and then store the feature , the dimension created successfully but the dimension created with a wrong angle so the length the line becomes wrong. this image shows the difference between the dimension draw by my tool (the selected one in blue) and the right one. and that is my code private IPoint pPoint1;
private IPoint pPoint2;
private IPoint pPoint3;
private int i = 0;
protected override void OnMouseDown(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs arg)
{
try
{
i++;
string layerName = GlobalVariables.DimensionLayer;
IMxDocument mxDoc = ArcMap.Application.Document as IMxDocument;
IMap m_pMap;
m_pMap = ArcMap.Document.FocusMap;
if (i == 1)
{
pPoint1 = mxDoc.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y);
}
else if (i == 2)
{
pPoint2 = mxDoc.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y);
}
else if (i == 3)
{
i = 0;
pPoint3 = mxDoc.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y);
#region Dimension
IFeatureLayer pePipeFeatureLayer = null;
ILayer pePipeLayer = null;
for (int j = 0; j < m_pMap.LayerCount; j++)
{
pePipeLayer = m_pMap.Layer[j];
if (pePipeLayer.Name.Contains(layerName))
{
pePipeFeatureLayer = (IFeatureLayer)pePipeLayer;
}
}
IFeatureClass pFClass;
pFClass = pePipeFeatureLayer.FeatureClass;
IDataset pePipeDataset = (IDataset)pePipeFeatureLayer;
#endregion
IWorkspaceEdit workspaceEdit = (IWorkspaceEdit)((IDataset)(pePipeFeatureLayer.FeatureClass)).Workspace;
workspaceEdit.StartEditing(false);
workspaceEdit.StartEditOperation();
IFeature pFeature = pePipeFeatureLayer.FeatureClass.CreateFeature();
int dimLength = pFeature.Fields.FindField("DIMLENGTH");
int BEGINX = pFeature.Fields.FindField("BEGINX");
int BEGINY = pFeature.Fields.FindField("BEGINY");
int ENDX = pFeature.Fields.FindField("ENDX");
int ENDY = pFeature.Fields.FindField("ENDY");
int DIMX = pFeature.Fields.FindField("DIMX");
int DIMY = pFeature.Fields.FindField("DIMY");
int TEXTX = pFeature.Fields.FindField("TEXTX");
int TEXTY = pFeature.Fields.FindField("TEXTY");
int DIMTYPE = pFeature.Fields.FindField("DIMTYPE");
int EXTANGLE = pFeature.Fields.FindField("EXTANGLE");
int STYLEID = pFeature.Fields.FindField("STYLEID");
int USECUSTOMLENGTH = pFeature.Fields.FindField("USECUSTOMLENGTH");
int CUSTOMLENGTH = pFeature.Fields.FindField("CUSTOMLENGTH");
int DIMDISPLAY = pFeature.Fields.FindField("DIMDISPLAY");
int EXTDISPLAY = pFeature.Fields.FindField("EXTDISPLAY");
int MARKERDISPLAY = pFeature.Fields.FindField("MARKERDISPLAY");
int TEXTANGLE = pFeature.Fields.FindField("TEXTANGLE");
int SHAPE = pFeature.Fields.FindField("SHAPE");
int SHAPESTArea = pFeature.Fields.FindField("SHAPE.STArea()");
int SHAPESTLength = pFeature.Fields.FindField("SHAPE.STLength()");
// pFeature.Value[dimLength] = 36.169741;
pFeature.Value[BEGINX] = pPoint1.X;
pFeature.Value[BEGINY] = pPoint1.Y;
pFeature.Value[ENDX] = pPoint2.X;
pFeature.Value[ENDY] = pPoint2.Y;
pFeature.Value[DIMX] = pPoint3.X;
pFeature.Value[DIMY] = pPoint3.Y;
//pFeature.Value[TEXTX] = null;
//pFeature.Value[TEXTY] = null;
pFeature.Value[DIMTYPE] = 0;
pFeature.Value[EXTANGLE] = 1.570796;
pFeature.Value[STYLEID] = 0;
pFeature.Value[USECUSTOMLENGTH] = 0;
pFeature.Value[CUSTOMLENGTH] = 0;
//pFeature.Value[DIMDISPLAY] = null;
//pFeature.Value[EXTDISPLAY] = null;
//pFeature.Value[MARKERDISPLAY] = null;
pFeature.Value[TEXTANGLE] = 0;
pFeature.Store();
workspaceEdit.StopEditOperation();
workspaceEdit.StopEditing(true);
mxDoc.ActiveView.Refresh();
pPoint1 = null;
pPoint2 = null;
pPoint3 = null;
ArcMap.Application.CurrentTool.Refresh();
}
}
... View more
12-07-2021
01:24 AM
|
0
|
0
|
397
|
POST
|
Dear All How are you? If you please i'm writing c# code to make a tool addin and i don't know to change the mouse cursor when click the tool. (Ex. like zoom tool when i click on it mouse cursor change to magnifier). Best regards Mohammed ALsadaany
... View more
01-24-2016
04:38 AM
|
0
|
1
|
4785
|
POST
|
Dear all i need to know there is any way to let me make a layout in my Arcmap from google earth or arcgis earth Regards.
... View more
11-18-2015
12:16 AM
|
0
|
1
|
3093
|
POST
|
Dear i'm new with Arcmap i have task i need a help in it i need to make a button to split a selected line into two lines using C# please i need a help Best regards
... View more
09-15-2015
04:15 PM
|
0
|
1
|
3830
|
Title | Kudos | Posted |
---|---|---|
1 | 12-17-2021 04:13 AM |
Online Status |
Offline
|
Date Last Visited |
12-17-2021
11:15 AM
|