POST
|
Hi Jillian, The Custom Parser Name should be registered with the " ESRI.ArcGIS.ADF.CATIDs.AnnotationExpressionParsers " category. The component category registration code is missing in the "OneToMayLabels" class You need to add the below code snippet which register the Custom parser in the 'ESRI Mx Annotation Expression Parsers' category #Region "COM Registration Function(s)" <ComRegisterFunction(), ComVisibleAttribute(False)> _ Public Shared Sub RegisterFunction(ByVal registerType As Type) ' Required for ArcGIS Component Category Registrar support ArcGISCategoryRegistration(registerType) 'Add any COM registration code after the ArcGISCategoryRegistration() call End Sub <ComUnregisterFunction(), ComVisibleAttribute(False)> _ Public Shared Sub UnregisterFunction(ByVal registerType As Type) ' Required for ArcGIS Component Category Registrar support ArcGISCategoryUnregistration(registerType) 'Add any COM unregistration code after the ArcGISCategoryUnregistration() call End Sub #Region "ArcGIS Component Category Registrar generated code" ''' <summary> ''' Required method for ArcGIS Component Category registration - ''' Do not modify the contents of this method with the code editor. ''' </summary> Private Shared Sub ArcGISCategoryRegistration(ByVal registerType As Type) Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID) ESRI.ArcGIS.ADF.CATIDs.AnnotationExpressionParsers.Register(regKey) End Sub ''' <summary> ''' Required method for ArcGIS Component Category unregistration - ''' Do not modify the contents of this method with the code editor. ''' </summary> Private Shared Sub ArcGISCategoryUnregistration(ByVal registerType As Type) Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID) ESRI.ArcGIS.ADF.CATIDs.AnnotationExpressionParsers.Unregister(regKey) End Sub #End Region You may need to Import ESRI.ArcGIS.ADF.CATIDs and System.Runtime.InteropServices in the respective class. After making the changes you can build and run the sample application and you will be able to see the Custom parser name listed in the dropdown. Hope this helps. Nilesh Shinolikar. GIS SDK Analyst
... View more
07-06-2012
03:38 AM
|
0
|
0
|
177
|
POST
|
Hi Alex, Create the ArcMap Class Library Project in Visual Studio Before the declaration of the Class and the methods write [ComVisible(true)] Create the Method having two parameters as Object First parameter will use as IFeature and Second will be IFeatureLayer Create the Object of IFature and IFeatureLayer Cast the respective object For testing purpose display a message box and display Object id of the feature Build the Project. Open the ArcMap add FeatureCLass in it Go to Layer Properties->Display Tab->Hyperlink Check the Support Hyperlinks Using Field and select the script and click Edit Copy and paste the following code in the text area Function OpenLink ( {IFEATURE}, {IFEATURELAYER} ) Dim hlauncher Set hlauncher = CreateObject("Hyperlink_Lib.Launcher") hlauncher.Launch {IFEATURE}, {IFEATURELAYER} End Function Hyperlink_lib.Launcher would the ProgID of your class(Namespace.ClassName) Launch will be your method which we have created in the ClassLibrary Now click on the Verify Button and it will call the Method from the Library and will display the message Box having featureID which we written inside the Method. Here is the sample ArcMap Class Library Class namespace Map { [Guid("2526af52-e7ae-400d-a080-000ee8998910")] [ClassInterface(ClassInterfaceType.None)] [ProgId("Map.Class1")] [ComVisible(true ) ] public class Class1 { [ComVisible(true ) ] public void Test(object pFeature, object pFLayer) { IFeature Pf = (IFeature)pFeature; MessageBox.Show(Pf.Class.AliasName.ToString()+"Feature"); MessageBox.Show(((IFeatureLayer )pFLayer).Name.ToString()+"Layer Name"); } } I Hope this Helps. Nilesh GIS SDK Analyst
... View more
01-30-2012
08:43 AM
|
0
|
0
|
168
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|