POST
|
Hello, Thanks for your post. I am able to duplicate your issues at 3.1. I have logged an issue with the Layout team for this bug to be fixed. Here is a work around for this bug. If you are able to name your elements when creating them, you can call Layout.FindElement (https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic29299.html) using that name before you need to reference the element. Doing this, you will find that the object is populated correctly and no null reference exceptions should be thrown. For example, here is your code with the first mapFrame element correctly showing the parent after the second map frame has been created. var group1 = ElementFactory.Instance.CreateGroupElement(layout, new List<Element>(), "group1");
var test1 = ElementFactory.Instance.CreateMapFrameElement(group1, frameBounds, templateMap, "MF1");
var parent = test1.GetParent(); // > group1
test1.SetHeight(100.0); // > works
var test2 = ElementFactory.Instance.CreateMapFrameElement(group1, frameBounds, templateMap, "MF2");
parent = test1.GetParent(); // > null
parent = test2.GetParent(); // > group1
// re-get the element
test1 = layout.FindElement("MF1") as MapFrame;
parent = test1.GetParent(); // group1
test1.SetHeight(100.0); // > works Thanks Narelle
... View more
06-22-2023
08:28 PM
|
1
|
0
|
615
|
POST
|
Hi Brian, Try updating the editing module ("esri_editing_EditingModule") and the "esri_editing_data" menu (or "esri_editing_standalonetable_data_menu" for standalone tables) This sub menu is inserted into the "esri_mapping_layerContextMenu" Narelle
... View more
06-14-2023
02:24 PM
|
1
|
0
|
574
|
POST
|
Sorry. You also need to override an additional method in your implementation of the InspectorProvider. Add the override for the AttributesOrder. See the code snippet below. Also note that your add-in does not need to iterate through the attributes calling the IsVisible method after having loaded it. The internal Pro code of the inspector control code calls the InspectorProvider methods. All the add-in needs to do is create the inspector from your provider, create the embeddable control and then load the row. Narelle internal class CustomProvider : InspectorProvider
{
public override bool? IsVisible(Attribute attr)
{
if (attr.FieldName == "POP1990")
return false;
return true;
}
public override IEnumerable<Attribute> AttributesOrder(IEnumerable<Attribute> attrs)
{
return attrs;
}
}
... View more
05-21-2023
05:25 PM
|
1
|
0
|
1311
|
POST
|
If you are using ArcGIS Pro 3.1 or higher there is also the InspectorProvider class that allows customization of field visibility, editability, display name, etc in the inspector when it is displayed as an embeddable control. These customizations are different from using the IDisplayTable to make the changes. https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic10294.html Here's an example that shows how to hide a field from the inspector grid. internal class CustomProvider : InspectorProvider
{
public override bool? IsVisible(Attribute attr)
{
if (attr.FieldName == "POP1990")
return false;
return true;
}
}
And now when creating the inspector grid use the following var provider = new CustomProvider();
_featureInspector = provider.Create();
// create a new instance for the inspector
// create an embeddable control from the inspector class to display on the pane
var icontrol = _featureInspector.CreateEmbeddableControl();
... We don't currently have any support for the second part of your question - being able to highlight the columns that have been modified. Narelle
... View more
05-19-2023
04:50 PM
|
2
|
2
|
1350
|
POST
|
Hi, Can you change the definition of your OnSelectionChange function to the following and see if that helps with the method firing when a choice is made in the combobox. Protected Overrides Sub OnSelectionChange(layerName As ComboBoxItem) (so it is Overrides not Overridable Overloads) Narelle
... View more
02-22-2023
07:30 PM
|
0
|
0
|
930
|
POST
|
Hi, I'm sorry; I'm not able to duplicate your problem with FeatureLayerCreationParams. I have a group layer containing 3 layers (pointing to a file geodatabase). Then I run the following code which inserts a hosted feature layer at index 2 in the group layer. The new layer is inserted at the correct location. Can you run this code and see if it works as you expect? Narelle protected override void OnClick()
{
var groupLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<GroupLayer>().FirstOrDefault();
if (groupLayer == null)
return;
// Airports_OPSNET45
string agolId = "8c1854a8580543b0a4848a0b5fbb0791";
int index = 2;
DoIt(agolId, "My layer", index, groupLayer);
}
internal Task DoIt(string AgolId, string name, int index, GroupLayer groupLayer)
{
return QueuedTask.Run(() =>
{
Item stagingLayer = ItemFactory.Instance.Create(AgolId, ItemFactory.ItemType.PortalItem);
if (LayerFactory.Instance.CanCreateLayerFrom(stagingLayer))
{
var featureCreateParams = new FeatureLayerCreationParams(stagingLayer)
{
IsVisible = true,
MapMemberIndex = index,
MapMemberPosition = MapMemberPosition.Index,
Name = name
};
Lactory.Instance.CreateLayer<FeatureLayer>(featureCreateParams, groupLayer);
}
});
}
... View more
02-17-2023
03:38 PM
|
0
|
0
|
744
|
POST
|
Hi, You seem to be missing setting the MapMemberPosition to MapMemberPosition.Index in the first code snippet (when you are using the FeatureLayerCreationParams). The default value for this property when it is not set is AutoArrange which means that the MapMemberIndex value is ignored. Thanks Narelle
... View more
02-16-2023
05:00 PM
|
0
|
2
|
758
|
POST
|
Hi, Seeing you're reading just a .txt file - I would recommend using standard .NET read/write classes/methods to open your file rather than the FileSystemConnectionPath object. https://learn.microsoft.com/en-us/dotnet/visual-basic/developing-apps/programming/drives-directories-files/how-to-read-text-from-files-with-a-streamreader This link has a code snippet which seems to suit your situation - opening a text file and reading lines. Thanks Narelle
... View more
02-09-2023
02:25 PM
|
1
|
2
|
983
|
POST
|
Hello, Currently there is no method in the API to access the set of favorite templates. Access to templates is currently only from a map member (layer or standalone table) using the GetTemplates method. I will add an issue to our backlog to address this in a future release. Narelle
... View more
01-30-2023
05:22 PM
|
1
|
1
|
766
|
POST
|
Hi Mody, This is by design. We do not receive a modified event for point geometry from the underlying architecture. Unfortunately there is no other event available for points. Narelle
... View more
12-13-2022
04:57 PM
|
0
|
0
|
258
|
POST
|
Hi Andy, Here's a short example of how to create a polygon. // current exent of mapView
var extent = MapView.Active.Extent;
var height = extent.Height;
var width = extent.Width;
var centerPt = extent.Center;
// new xmin, xmax, ymin, ymax values - a subset of the extent
var xmin = centerPt.X - width / 4;
var xmax = centerPt.X + width / 4;
var ymin = centerPt.Y - height / 4;
var ymax = centerPt.Y + height / 4;
// create 4 corners of the new polgyon
var pt1 = MapPointBuilderEx.CreateMapPoint(xmin, ymin, MapView.Active.Map.SpatialReference);
var pt2 = MapPointBuilderEx.CreateMapPoint(xmin, ymax, MapView.Active.Map.SpatialReference);
var pt3 = MapPointBuilderEx.CreateMapPoint(xmax, ymax, MapView.Active.Map.SpatialReference);
var pt4 = MapPointBuilderEx.CreateMapPoint(xmax, ymin, MapView.Active.Map.SpatialReference);
// then create a polygon from the set of points
var listPoints = new List<MapPoint>() { pt1, pt2, pt3, pt4 };
var polygon2 = PolygonBuilderEx.CreatePolygon(listPoints, MapView.Active.Map.SpatialReference); There's also the following documentation that can help you discover more about building geometries. - https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geometry There are a lot of different code snippets here too. - https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geometry Thanks Narelle
... View more
11-15-2022
12:39 AM
|
1
|
0
|
1251
|
POST
|
Hi Tom, Please see the information I posted here. https://community.esri.com/t5/arcgis-pro-sdk-questions/integration-and-configuration-of-custom-commands/m-p/1206677#M8659 let me know if there are additional questions. Narelle
... View more
09-04-2022
05:40 PM
|
1
|
0
|
339
|
POST
|
Dirk, Each type of customization that is part of the DAML file must be assigned a unique ID. We call this the damlID. So when you define a button in your add-in it has a damlID. In the example below the damlID is "acme_AddFromFileButton" <button id="acme_AddFromFileButton"
className=" AddFromFile"
caption="Add from file"
keytip="AF"
largeImage="Images\AddFromFile32.png"
smallImage="Images\AddFromFile16.pngg">
<tooltip heading="Add from file" image="Images\AddFromFile16.png">
Add spatial data files to the project
<disabledText>Requires an open project with a map</disabledText>
</tooltip>
</button> Similarly defining and registering a component in a category requires that the item have a unique damlID. In this definition the damlID is "esri_mapping_bookmarks". Internally we prefix our damlIds with "esri_(moduleName)" so this example belongs to the mapping module. So your daml entry for the emebeddable control category might look like the following <categories>
<updateCatgeory refID="esri_tasks_embeddableControls">
<insertComponent id="unity_editor_embeddedControlID" className="embeddedControlViewModel">
<content className="embeddedControlView" relatedCommand="unity_editor_CreateAssetsButton" autoRunOnly="true"/>
</insertComponent>
</updateCategory>
</categories> where embeeddedcontrolviewModel and embeddedControlView are the classes from step 2 that I explained above. And "unity_editor_CreateAssetsButton" is the damlID of the button that launches your dockPane defined in step 3. Regards Narelle
... View more
08-31-2022
06:38 PM
|
1
|
0
|
727
|
POST
|
Dirk, You will likely have to restructure some of your code to fully implement the ability of embedding your dockpane into the Tasks pane. The daml category that you found ("esri_tasks_embeddableControls") is the correct category to register your code in order for Tasks to recognize it as a component that can be embedded. But the view/viewModel that the daml entry references via the className attribute should be a class that inherits from ArcGIS.Desktop.Framework.Controls.EmbedableControl. You can create one of these using the Visual Studio template. Internally we typically follow the below steps for this pattern. 1. create an internal control and viewModel pair to hold the UI and code behind. 2. create an EmbeddableControl (a view and viewmodel pair) that hosts and instantiates the control and the control's view model from step1 3. create a DockPane (a view and viewmodel pair) that hosts and instantiate the control and the control's view model from step1. 4. The esri_tasks_embeddableControls daml entry reference the view/viewmodel from step 2. The "relatedCommand" attribute in that same daml entry references the buttonID that launches the dockpane from step 3. As you can see, this is an advanced extension pattern that has a certain amount of complexity involved. I hope this information helps to get you started. Let me know if you have additional questions. Narelle
... View more
08-29-2022
06:54 PM
|
0
|
2
|
742
|
POST
|
Hi David, Sorry for the late reply. I have been looking at your post and code and have a few comments. 1. I'm sure you've read the documentation we have about editing annotation and it's special considerations but am including a link here for reference. (https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Editing-Annotation) 2. The API currently doesn't expose the ability to show the yellow "grabhandle" that you see with the built in Move tool (that identifies the feature being moved). We have identified this as future functionality we would like to add but currently do not have a timeline identified. 3. The MapTool.AddOverlay function that you are using will create a graphic from the geometry and symbol parameters that are passed. This is why you see the line being displayed on the screen. The line is the baseline geometry of the annotation feature - the geometry that the annotation text lies on. To see the annotation text on the overlay, you should use the AddOverlay function that takes a CIMGraphic https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic27604.html. The CIMGraphic passed would the CIMTextGraphic of the annotation feature (found from AnnotationProperties.TextGraphic). 4. Because you're dealing with annotation and text, it is also important to use the second parameter of that AddOverlay method - the referenceScale. This can be retrieved from the AnnotationFeatureClassDefinition. await QueuedTask.Run(() =>
{
var annoFC = _layerAnno.GetFeatureClass() as AnnotationFeatureClass;
var annoFCDef = annoFC.GetDefinition() as AnnotationFeatureClassDefinition;
_annoRefScale = annoFCDef.GetReferenceScale();
var refScaleUnits = annoFCDef.GetReferenceScaleUnits();
}); So the AddOverlay routine would become _graphic = AddOverlay(_trackedTextGraphic, _annoRefScale); 5. Unfortunately there is no MapTool.UpdateOverlay method that supports the moving of text graphics in the manner used in your code. This is a gap in our API that was found as a result of looking at your post and it will be fixed in the next Pro release. Thanks for helping to identify this. 6. In the meantime a work around would be to dispose of the previous graphic and create a new one with the CIMTextGraphic at the moved geometry position. Unfortunately because this is in MouseMove, the performance may not be as smooth as the standard tool. Here's a sample of code that could replace your UpdateOverlay call Geometry movedGeometry = null;
if (_trackedSide == "up" || _trackedSide == "down")
{
movedGeometry = GeometryEngine.Instance.Move(_trackedGeometry, x, 0);
}
else
{
movedGeometry = GeometryEngine.Instance.Move(_trackedGeometry, 0, y);
}
lock (_lock)
{
if (_graphic != null)
_graphic.Dispose();
var newGraphic = _trackedTextGraphic.Clone();
newGraphic.Shape = movedGeometry;
_graphic = AddOverlay(newGraphic, _annoRefScale);
} I hope this provides some clarification and helps you make progress with your tool. Please let me know if you have any questions or comments about the above. Regards Narelle
... View more
08-17-2022
08:31 PM
|
1
|
0
|
625
|
Title | Kudos | Posted |
---|---|---|
1 | 08-08-2024 09:44 PM | |
1 | 07-18-2024 04:46 PM | |
1 | 06-04-2024 07:18 PM | |
4 | 05-27-2024 09:22 PM | |
1 | 02-12-2019 08:59 AM |
Online Status |
Online
|
Date Last Visited |
6 hours ago
|