POST
|
So tried your code and I'm getting a null on line 3. I also tried just the plain jane GetCustomAttributes() and that also returns zero elements.
... View more
07-12-2022
11:14 AM
|
0
|
0
|
1068
|
POST
|
At Pro 2.9 there was this great helper class that got info for your own addin. https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Content/AddInInfoManager It bombs at 3.0 and I have not been able to locate an alternative API or other form of getting the info programmatically. I tweaked the function and it turns out the the code is returning zero guid attributes: public static string GetAddInGuid()
{
// get the GUID that identifies the current add-in
Assembly exAssembly = Assembly.GetExecutingAssembly();
//GuidAttribute gAttribute = (GuidAttribute)exAssembly.GetCustomAttributes(typeof(GuidAttribute), true)[0];
object[] custAtts = exAssembly.GetCustomAttributes(typeof(GuidAttribute), true);
if (custAtts.Length == 0)
{
throw new Exception("No custom attributes.");
}
GuidAttribute gAttribute = (GuidAttribute)custAtts[0];
// guid={903288ab-2c9c-4e49-8a3d-0321f68425c1}
return string.Format("{{{0}}}", gAttribute.Value);
} Anyone know an alternative to programmatically get info for your own addin or just the GUID?
... View more
07-12-2022
10:47 AM
|
0
|
17
|
1898
|
POST
|
So after experimenting with a few controls I settled on a ProWindow. It is only displayed by the user action and it is non-modal. Ignore the lame graphic I have:
... View more
07-12-2022
07:50 AM
|
0
|
1
|
785
|
POST
|
Interesting. Almost everything I have read up to now says to use Content.
... View more
07-12-2022
06:55 AM
|
0
|
0
|
407
|
POST
|
So working on our company Addin off and on. I've added some Button and DockPane controls and have used custom images with BuildAction=Content. It all works great. I've extended the functionality with a Pane and ProWindow control but could not get any images to display. It dawned on me that maybe I was doing something wrong. From the forum I found a post that said use BuildAction=Resource. So I did that and it worked!!! So my question is...what is the difference? Why do we need two options? Why wouldn't the control auto detect that a BuildAction on the graphic is not compatible? What if I need the same graphic in various controls that use Content and Resource? Do I have to add it twice?
... View more
07-11-2022
06:04 PM
|
0
|
2
|
467
|
POST
|
@MichelleMathias how do I move this topic to Pro SDK?
... View more
07-11-2022
03:23 PM
|
0
|
1
|
811
|
POST
|
Yes I have a tab just for my add-in and about 10 tools under it. I currently have an About button that displays a MessageBox but the text I want to display is getting too long. The users are in my company so really its my call on what gets displayed. In ArcMap I would just display a Form but wanted something that was not as "intrusive" as you say. A typical About is what I am displaying but I have notes for each major release. Plus I put other notes in there as well. Something like the snapshot below. But I am asking for what other options exist within Pro. The toast Notification seems like a possibility.
... View more
07-11-2022
11:55 AM
|
0
|
0
|
818
|
POST
|
I have created an Addin for my company and all is working well. Now I want to display an About box with version release notes and other info. Currently I am just displaying a MessageBox but the notes are getting too lengthy. I also tested the toast Notification but am not sure my info belongs there. What would be recommended as a a standard to display About info? a Form? in the Backstage? another control?
... View more
07-11-2022
09:28 AM
|
0
|
7
|
829
|
POST
|
As a final edit I took @GKmieliauskas code and made it an extension. Note I use full namespaces so as not to clash with the MS XML functions. <Extension()>
Function SerializeEsri(Of T As Class)(ByVal value As T) As XDocument
Dim sr As New ESRI.ArcGIS.esriSystem.XMLStream
Dim ir As ESRI.ArcGIS.esriSystem.IStream = CType(sr, ESRI.ArcGIS.esriSystem.IStream)
Dim wr As New ESRI.ArcGIS.esriSystem.XMLWriter
Dim ser As New ESRI.ArcGIS.esriSystem.XMLSerializer
wr.WriteTo(ir)
ser.WriteObject(wr, Nothing, Nothing, String.Empty, String.Empty, value)
Dim xdoc As XDocument = XDocument.Parse(sr.SaveToString)
Return xdoc
End Function Usage: Private Function GetSpatialReferenceAsWkt(pSpatRef As ISpatialReference) As String
If pSpatRef Is Nothing Then Return Nothing
Dim xdoc As XDocument = pSpatRef.SerializeEsri
Dim xelem As XElement = xdoc.Root.Element("WKT")
Return xelem.Value
End Function
... View more
12-17-2021
11:20 AM
|
0
|
0
|
1159
|
POST
|
I like that one too except you have to write it to disk first.
... View more
12-17-2021
08:53 AM
|
0
|
0
|
1164
|
POST
|
ArcMap 10.8.1 using .NET ArcObjects I have a geometry with a spatial reference. How do I get its projection WKT? I've been looking for hours and can't seem to find a simple way to do this. Dim pGeom As IGeometry = CreateGeometry() Dim wkt as String = pGeom.SpatialReference.ToWKT '<=== What API do I use for this conversion? The output should be something like: PROJCS["World_Azimuthal_Equidistant",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Azimuthal_Equidistant"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-86.02400831252139],PARAMETER["Latitude_Of_Origin",41.70912056625856],UNIT["Meter",1.0]]
... View more
12-16-2021
12:11 PM
|
0
|
5
|
1206
|
POST
|
Found an answer here https://community.esri.com/t5/arcgis-pro-sdk-questions/dialog-launcher-buttons/td-p/851153
... View more
12-15-2021
02:04 PM
|
0
|
0
|
473
|
BLOG
|
Found an answer here https://community.esri.com/t5/arcgis-pro-sdk-questions/dialog-launcher-buttons/td-p/851153
... View more
12-15-2021
02:03 PM
|
0
|
0
|
724
|
Title | Kudos | Posted |
---|---|---|
1 | 08-17-2022 11:17 AM | |
1 | 07-24-2022 01:36 PM | |
1 | 07-14-2022 11:22 AM | |
1 | 07-14-2022 10:29 AM | |
1 | 06-01-2020 05:31 PM |
Online Status |
Offline
|
Date Last Visited |
10-03-2022
04:04 PM
|