<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to wire custom Annotation Constructor to a Tool in ArcMap 10? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-wire-custom-annotation-constructor-to-a/m-p/574784#M15478</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its a little late, but here's the methodology.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your project will have two classes.&lt;/P&gt;&lt;P&gt;The first class is the annotation constructor which implements IAnnotationConstructor and is registered in the AnnotationConstructors component category. The implementation of this class hasn't changed from ArcGIS 9 to 10, it just doesn't show up anywhere on the UI at 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second class is the tool that provides the sketch and sets the annotation constructor. This is a regular feature construction tool that you can create with the new item wizard. This needs to be registered in the FeatureConstructionAnnotationTools component category. This appears as an annotation construction tool in the UI.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The following code snippet (back when VB was cool) shows a sketch tool using the point shape constructor feeding sketch points to a custom anno constructor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Overrides Sub OnClick()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_edSketch = TryCast(m_editor, IEditSketch3)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_csc = New PointConstructorClass()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_csc.Initialize(m_editor)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_edSketch.ShapeConstructor = m_csc
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_csc.Activate()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Set the custom anno constructor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pID As New UIDClass()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pID.Value = "esriEditor.AnnotationEditExtension"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim AnnonEditExt As IAnnotationEditExtension = m_editor.FindExtension(pID)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim AnnoConstructs As IEnumAnnotationConstructor = AnnonEditExt.AnnotationConstructors
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim rach As IAnnotationConstructor = AnnoConstructs.Next
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do Until rach Is Nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If rach.Name = "Curved (Custom)" Then AnnonEditExt.CurrentConstructor = rach
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rach = AnnoConstructs.Next
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Show annotation construction window
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pID.Value = "esriEditor.AnnotationConstructionWindow"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim annoConWindow As IAnnotationConstructionWindow = m_editor.FindExtension(pID)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; annoConWindow.Visible = True&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The rest of the tool is stock from the wizard.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 00:44:55 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-12T00:44:55Z</dc:date>
    <item>
      <title>How to wire custom Annotation Constructor to a Tool in ArcMap 10?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-wire-custom-annotation-constructor-to-a/m-p/574782#M15476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a custom annotation constructor that I need to implement in ArcMap's editing environment and I can't figure out how.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In previous versions, you simply registered the constructor in the proper category and then you could select it on the Annotation Toolbar. Now in ArcGIS 10, with the Annotation Toolbar gone, it appears that you have to create a custom tool to register&amp;nbsp; with the FeatureConstructionAnnotationTools CATIDs, and have the tool work with the anno constructor...right?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Well, I've created the tool and registered it, and sure enough it appears as a construction tool when editing an anno layer. I have my annotation constructor, which I've been using for years, but &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;how do you assign the annotation constructor to the editor using the tool? How do you 'turn it on'?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've read a bunch about custom shape constructors and how they're activated by assigning them to the editsketch (see the code below for the PointAlongLine ESRI sample)....but how do you accomplish that with an anno constructor (which is not a coclass of the shape constructor)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone point me towards any code, a sample, ANYTHING that indicates how you "activate/fire up/turn on" an annotation constructor to begin placing anno?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks everyone!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Bob J.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Indianapolis, IN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;______________&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Public Overrides Sub OnClick()
&amp;nbsp;&amp;nbsp;&amp;nbsp; Private m_csc As IShapeConstructor
&amp;nbsp;&amp;nbsp;&amp;nbsp; m_edSketch = TryCast(m_editor, IEditSketch3)

&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Restrict to line constructors (for this tool)
&amp;nbsp;&amp;nbsp;&amp;nbsp; m_edSketch.GeometryType = esriGeometryType.esriGeometryPolyline

&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Activate a shape constructor based on the current sketch geometry
&amp;nbsp;&amp;nbsp;&amp;nbsp; If m_edSketch.GeometryType = esriGeometryType.esriGeometryPoint Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_csc = New PointConstructorClass()
&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_csc = New StraightConstructorClass()
&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp; m_csc.Initialize(m_editor)
&amp;nbsp;&amp;nbsp;&amp;nbsp; m_edSketch.ShapeConstructor = m_csc
&amp;nbsp;&amp;nbsp;&amp;nbsp; m_csc.Activate()

&amp;nbsp;&amp;nbsp;&amp;nbsp; 'set the current task to null
&amp;nbsp;&amp;nbsp;&amp;nbsp; m_editor.CurrentTask = Nothing
End Sub&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Mar 2011 17:42:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-wire-custom-annotation-constructor-to-a/m-p/574782#M15476</guid>
      <dc:creator>BobJubb</dc:creator>
      <dc:date>2011-03-13T17:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to wire custom Annotation Constructor to a Tool in ArcMap 10?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-wire-custom-annotation-constructor-to-a/m-p/574783#M15477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any luck with this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Sep 2015 21:19:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-wire-custom-annotation-constructor-to-a/m-p/574783#M15477</guid>
      <dc:creator>TimSexton1</dc:creator>
      <dc:date>2015-09-02T21:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to wire custom Annotation Constructor to a Tool in ArcMap 10?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-wire-custom-annotation-constructor-to-a/m-p/574784#M15478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its a little late, but here's the methodology.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your project will have two classes.&lt;/P&gt;&lt;P&gt;The first class is the annotation constructor which implements IAnnotationConstructor and is registered in the AnnotationConstructors component category. The implementation of this class hasn't changed from ArcGIS 9 to 10, it just doesn't show up anywhere on the UI at 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second class is the tool that provides the sketch and sets the annotation constructor. This is a regular feature construction tool that you can create with the new item wizard. This needs to be registered in the FeatureConstructionAnnotationTools component category. This appears as an annotation construction tool in the UI.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The following code snippet (back when VB was cool) shows a sketch tool using the point shape constructor feeding sketch points to a custom anno constructor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Overrides Sub OnClick()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_edSketch = TryCast(m_editor, IEditSketch3)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_csc = New PointConstructorClass()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_csc.Initialize(m_editor)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_edSketch.ShapeConstructor = m_csc
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_csc.Activate()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Set the custom anno constructor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pID As New UIDClass()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pID.Value = "esriEditor.AnnotationEditExtension"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim AnnonEditExt As IAnnotationEditExtension = m_editor.FindExtension(pID)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim AnnoConstructs As IEnumAnnotationConstructor = AnnonEditExt.AnnotationConstructors
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim rach As IAnnotationConstructor = AnnoConstructs.Next
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do Until rach Is Nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If rach.Name = "Curved (Custom)" Then AnnonEditExt.CurrentConstructor = rach
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rach = AnnoConstructs.Next
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Show annotation construction window
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pID.Value = "esriEditor.AnnotationConstructionWindow"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim annoConWindow As IAnnotationConstructionWindow = m_editor.FindExtension(pID)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; annoConWindow.Visible = True&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The rest of the tool is stock from the wizard.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:44:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-wire-custom-annotation-constructor-to-a/m-p/574784#M15478</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T00:44:55Z</dc:date>
    </item>
  </channel>
</rss>

