|
POST
|
Hi Brian, I tested my tool with a bunch of Mxd files from the ArcObjects community samples (10.8 sample data) and i was not able to duplicate the issue. If you find a duplicatable case i will take another look.
... View more
08-14-2020
08:44 AM
|
2
|
0
|
1717
|
|
POST
|
Hi Brian, Sorry about that but i am using a Pro install path of c:\arcgis ... you can just right click on the solution (or project) and use the Pro SDK's fix references utility to fix the references for your environment.
... View more
08-14-2020
07:51 AM
|
0
|
2
|
1717
|
|
POST
|
Hi Brian, I was not able to duplicate this problem using Pro 2.6. It's possible that this only happens with certain MXDs or maybe the Pro version is relevant. I attached a small test program which contains a map tool that allows to select line features and displays the selected lines' vertices as graphic overlay points. Maybe you can try the app with your MXD. Running the add-in should yield output like this (this is an imported mxd):
... View more
08-13-2020
04:09 PM
|
0
|
4
|
1717
|
|
POST
|
You can get the IPluginWrapper interface by using the button's ID from the config.daml. Below is the snippet that i added to my test add-in's Module class: protected override bool Initialize ()
{
ActiveMapViewChangedEvent.Subscribe(OnActiveMapViewChanged);
return base.Initialize();
}
/// <summary>
/// Event delegate for the ActiveMapViewChangedEvent
/// </summary>
private void OnActiveMapViewChanged(ActiveMapViewChangedEventArgs args)
{
// get the button and change the caption
// button's id from config.daml: DynamicButtonChange_ButtonMapLoaded
var plugin = FrameworkApplication.GetPlugInWrapper("DynamicButtonChange_ButtonMapLoaded");
if (args.IncomingView == null)
{
plugin.Caption = "No Mapview";
// plugin.LargeImage = ...
return;
}
plugin.Caption = "Active Mapview";
// plugin.LargeImage = ...
}
... View more
08-13-2020
11:02 AM
|
0
|
1
|
2552
|
|
POST
|
Hi Than, You can look here for an explanation: https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#jit-loading In essence Pro is using JIT (Just in time) loading to make Pro be more responsive at startup. However, if you need your add-in to start with Pro then you can change the autoLoad attribute of the module tag to "true" in your config.daml: <insertModule id="yourmoduleId" className="..." autoLoad="true" caption="...">
... View more
08-12-2020
10:46 AM
|
0
|
3
|
2552
|
|
POST
|
i just tried the following code using Pro 2.6 without any problems: //Call Host.Initialize before constructing any objects from ArcGIS.Core
Host.Initialize();
try
{
var targetGeodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri(@"C:\Data\FeatureTest\sdk5.esri.com.sde", UriKind.Absolute)));
Console.WriteLine("Done");
}
catch (Exception ex)
{
Console.Error.WriteLine($@"Error: {ex}");
} In order to debug which Dll is missing, you can try to add the following code (you can also copy this from this sample: CoreHost Resolve Assembly Just replace the path to the .sde file. //[STAThread] must be present on the Application entry point
[STAThread]
static void Main(string[] args)
{
//Resolve ArcGIS Pro assemblies.
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveProAssemblyPath);
RunLogic();
}
static void RunLogic()
{
//Call Host.Initialize before constructing any objects from ArcGIS.Core
Host.Initialize();
try
{
var targetGeodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri(@"C:\Data\FeatureTest\sdk5.esri.com.sde", UriKind.Absolute)));
Console.WriteLine("Done");
}
catch (Exception ex)
{
Console.Error.WriteLine($@"Error: {ex}");
}
}
static Assembly ResolveProAssemblyPath(object sender, ResolveEventArgs args)
{
//Get path of Pro installation from registry
var arcgisProPath = GetInstallDirAndVersionFromReg().Item1;
string ProNotFound = @"ArcGIS Pro is not installed.";
if (string.IsNullOrEmpty(arcgisProPath)) throw new InvalidOperationException(ProNotFound);
string assemblyPath = Path.Combine(arcgisProPath, "bin", new AssemblyName(args.Name).Name + ".dll");
if (!File.Exists(assemblyPath)) return null;
Assembly assembly = Assembly.LoadFrom(assemblyPath);
return assembly;
}
/// <summary>
/// Get the ArcGIS Pro install location from the registry.
/// </summary>
/// <returns></returns>
private static Tuple<string, string> GetInstallDirAndVersionFromReg()
{
string regPath = @"SOFTWARE\ESRI\ArcGISPro";
string installMissing = @"Install location of ArcGIS Pro cannot be found. Please check your registry for {0}";
string versionMissing = @"Version of ArcGIS Pro cannot be determined. Please check your registry for {0}.";
string err1 = string.Format(installMissing, $@"HKLM\{regPath}\InstallDir");
string err2 = string.Format(versionMissing, $@"HKLM\{regPath}\Version");
string path = "";
string version = "";
try
{
RegistryKey localKey = RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, RegistryView.Registry64);
RegistryKey esriKey = localKey.OpenSubKey(regPath);
if (esriKey == null)
{
localKey = RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.CurrentUser, RegistryView.Registry64);
esriKey = localKey.OpenSubKey(regPath);
}
if (esriKey == null)
{
//this is an error
throw new System.InvalidOperationException(err1);
}
path = esriKey.GetValue("InstallDir") as string;
if (path == null || path == string.Empty)
//this is an error
throw new InvalidOperationException(err1);
version = esriKey.GetValue("Version") as string;
if (version == null || version == string.Empty)
//this is an error
throw new InvalidOperationException(err2);
}
catch (InvalidOperationException ie)
{
//this is ours
throw ie;
}
catch (Exception ex)
{
throw new System.Exception(err1, ex);
}
return new Tuple<string, string>(path, version);
}
... View more
08-07-2020
03:30 PM
|
0
|
1
|
2009
|
|
POST
|
i would define two tab groups with different colors, one for condition A another for Condition B.
... View more
08-07-2020
07:32 AM
|
0
|
1
|
1255
|
|
POST
|
Hi Sai, It turns out that the problem is caused by the aspect ratio of the MapControl's display area. Because you are using the 'extent' of the line (and its envelope) as the new extent for the MapControl it is important to ensure that the MapControl's aspect ratio supports both the new 'height' and 'width' without having to make adjustments to the width. in your case the MapControl was wider than tall and hence the 'edge cases' you listed above, where the line's extent area nearly becomes as wide as it is tall, the MapControl had to 'widen' the extent in order to honor both x and y requirements of the newly specified extent. You can see the arrows of the selected line are far from the map display border. Here is an example - note that the boxes display the line's extent on the active map: You can see that the OverviewWindow's MapControl is wider than tall and the extent of the 'highlighted' line is nearly square ... consequently the MapControl has to extent the width in order to honor the full height extent. A simple solution would be to make the MapControl square or taller than wide and now the same sample works:
... View more
08-06-2020
04:46 PM
|
0
|
2
|
2439
|
|
POST
|
Try this - eventually you should change the PaneWidth datatype to double. Note that the snippet below tracks any changes to the width by using the SizeChanged event, covering the case when the operator resizes the dockpane after its initial display. private bool _initSizeChange = true;
private double GetWidth()
{
if (_initSizeChange) {
_initSizeChange = false;
base.Content.SizeChanged += Content_SizeChanged;
}
return base.Content.ActualWidth;
}
private void Content_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
{
if (e.WidthChanged)
{
PaneWidth = GetWidth().ToString();
}
}
public string _paneWidth = string.Empty;
public string PaneWidth
{
get
{
if (string.IsNullOrEmpty (_paneWidth))
{
_paneWidth = GetWidth().ToString();
}
return _paneWidth;
}
set
{
SetProperty(ref _paneWidth, value, () => PaneWidth);
}
}
... View more
08-05-2020
04:08 PM
|
0
|
1
|
3457
|
|
POST
|
Hi Marvis, There is no easy way to do this right now, however, there is a workaround since the 'Content' property is 'protected internal' and hence accessible from any derived class (which includes your dockpane). To test this i added a button to my test dockpane class (CmdWidthTest) that calls the added 'GetFrameworkElement' function. Needless to say you can make this a property as well. To access the width use the 'ActualWidthProperty'. public System.Windows.FrameworkElement GetFrameworkElement()
{
return base.Content;
}
public ICommand CmdWidthTest
{
get
{
return new RelayCommand(() =>
{
var ui = GetFrameworkElement();
MessageBox.Show($@"Width: {ui.ActualWidth}");
});
}
}
... View more
08-03-2020
12:37 PM
|
0
|
3
|
3457
|
|
POST
|
Hi Abel, We updated the documentation for the 2.6 release which is coming out this week.
... View more
07-26-2020
09:32 AM
|
0
|
0
|
2256
|
|
POST
|
The only way to implement this currently is to create a new ProgressDialog for each one of your steps, since you only discover the maximum value which each previous step. I will bring this to the development teams attention.
... View more
07-22-2020
10:44 AM
|
0
|
0
|
2357
|
|
POST
|
You can also take a look at this sample code: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/WorkingWithDAML
... View more
07-22-2020
10:35 AM
|
0
|
0
|
2120
|
|
POST
|
It seem to work for me. Just to summarize: When you set the camera's heading the following (from API help) applies for the heading property: Gets or sets the Heading of the Camera, in degrees from North. 0 is North, 90 is West, 180 is South, -90 is East, etc. This property applies to both 2D and 3D views. When you compute the angle for you line the following applies: Note that start and end point (i.e. the direction of the line) are important in the computation, but you get values of 0 through 180 if your angle is 'above' the 0 degree horizon (see image above) and 0 through -180 if your angle is below the horizon. i made a sample and it appears to work fine for me. Below i sketched a 90 degree line - which points my heading 'West' ... so i think that's correct: So can you describe what doesn't work as expected and also what coordinate system you're using?
... View more
07-17-2020
03:20 PM
|
0
|
0
|
2439
|
|
POST
|
Hi Ben, Sorry about this, but plug in datasources are not supported in CoreHost apps at this time.
... View more
07-08-2020
02:43 PM
|
0
|
0
|
1305
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-29-2025 10:48 AM | |
| 1 | 05-24-2021 09:04 AM | |
| 1 | 12-03-2020 08:44 AM | |
| 1 | 10-07-2025 07:27 AM | |
| 2 | 12-29-2025 10:03 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-21-2026
01:59 PM
|