|
POST
|
Hi Hao, The 3.2 release of the Pro SDK (coming very very soon) has support for TIN. Some of the new objects that have been added to the API are TinLayer and TinDataset. You can access the nodes (TinNode), edges (TinEdge) or triangles (TinTriangle) of a TinDataset by searching or accessing the element by it's index. The TinDataset object also has many of the other methods that can be found on the ITinAdvanced2 interface. Please take a look at these APIs when 3.2 is released and let us know if there is additional functionality you require. Thanks Narelle
... View more
10-31-2023
08:54 PM
|
1
|
2
|
1195
|
|
POST
|
Barbara, If the data source has been cleared, then you probably need to also set other properties on the CIMMapStereoProperties instance. Try something similar to the following protected override async void OnClick()
{
Map stereoMap = MapView.Active.Map;
await QueuedTask.Run(async () =>
{
CIMMap cimMap = stereoMap.GetDefinition();
var stereoProps = cimMap.StereoProperties;
string path = @"D:\Data\StartProject.gdb";
var fileGdbConnPath = new FileGeodatabaseConnectionPath(new Uri(path, UriKind.Absolute));
using (var gdb = new Geodatabase(fileGdbConnPath))
{
ArcGIS.Core.Data.Raster.MosaicDataset mDataset = gdb.OpenDataset<ArcGIS.Core.Data.Raster.MosaicDataset>("MyMoaid");
var mosaicDataConnection = mDataset.GetDataConnection();
var (leftImageID, rightImageID) = GetStereoImages(mDataset);
stereoProps.SourceType = StereoSourceType.StereoModelCollection;
stereoProps.StereoModelCollection = mosaicDataConnection;
stereoProps.LeftImageID = leftImageID;
stereoProps.RightImageID = rightImageID;
cimMap.StereoProperties = stereoProps;
stereoMap.SetDefinition(cimMap);
}
// MapView.Active.Redraw(true);
});
}
// Find the left and right image IDs from the mosaicDataset
// This is achieved by querying the stereo table and retrieving
// the ImageID1 and ImageID2 fields.
(long image1ID, long image2ID) GetStereoImages(ArcGIS.Core.Data.Raster.MosaicDataset mDataset)
{
var stereoTable = mDataset?.GetStereoTable();
var stereoTableDef = stereoTable?.GetDefinition();
if (stereoTableDef == null)
return (-1, -1);
var image1Fld = stereoTableDef.FindField("ImageID1");
var image2Fld = stereoTableDef.FindField("ImageID2");
if ((image1Fld == -1) || (image2Fld == -1))
return (-1, -1);
long image1 = -1;
long image2 = -1;
using (var cursor = stereoTable.Search(null))
{
if (cursor.MoveNext())
{
using (var row = cursor.Current)
{
var image = row[image1Fld];
if (image != null)
System.Int64.TryParse(image.ToString(), out image1);
image = row[image2Fld].ToString();
if (image != null)
System.Int64.TryParse(image.ToString(), out image2);
}
}
}
return (image1, image2);
} You may also need to set the LeftImageColorizer and RightImageColorizer properties, but I am not sure. Let me know if this still doesn't work for you. It worked for my test scenario, but I am not a raster expert. Narelle
... View more
09-14-2023
10:29 PM
|
0
|
1
|
1590
|
|
POST
|
Hi Barbara, It looks like you have forgotten to save the updated CIM definition back to the map. Remember that a GetDefinition call also needs a SetDefinition call after any updates. Try adding a steroMap.SetDefinition call with your updated cimMap before you redraw. Narelle
... View more
09-13-2023
08:56 PM
|
1
|
0
|
1607
|
|
POST
|
Go back to your first approach and try calling base.StartSketchAsync() after you've changed the SketchType. Internally the sketch is started on tool activation with the current SketchType. If you change the SketchType after this moment, you need to tell the tool to re-initialize the sketch. This is accomplished by the StartSketchAsync method. Narelle
... View more
08-06-2023
11:57 PM
|
1
|
0
|
1602
|
|
POST
|
Hi, You can override the CanCommit function on EmbeddableControl to return false when your fields have not been filled in. And true when your control is correct. When a step cannot proceed, Tasks will show an error message at the bottom of the dockpane indicating that the step is not enabled or that there is an error. You cannot modify or configure this built in message, so you may consider adding a more specific message to your embeddable control that indicates what the error is. Narelle
... View more
07-18-2023
05:57 PM
|
0
|
0
|
769
|
|
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
|
935
|
|
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
|
815
|
|
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
|
2008
|
|
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
|
2047
|
|
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
|
1397
|
|
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
|
1103
|
|
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
|
1117
|
|
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
|
1450
|
|
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
|
1208
|
|
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
|
399
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 07-27-2025 06:04 PM | |
| 1 | 03-24-2025 06:53 PM | |
| 1 | 08-08-2024 09:44 PM | |
| 1 | 07-18-2024 04:46 PM | |
| 1 | 06-04-2024 07:18 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-02-2025
02:15 PM
|