0 Replies Latest reply on Mar 16, 2010 9:04 AM by eneyer57

    Problem adding a Polygon Annotation with VB.Net (JSObject)

    eneyer57

      I have been able to create a variety of annotations (Text, FreeText, Line, Arrow, Square, Circle, a few more) using VB.Net.

      I haven't had too many issues.

       

      However, I ran into a big one. Here is my sample code:

       

      'Create the Annotation

       

       

      Dim objAnnotation As Object = objJSObject.addAnnot()

       

       

       

      Dim objAnnotationProperties As Object = objAnnotation.getProps()

      objAnnotationProperties.type =

      "Polygon"

      objAnnotation.setProps(objAnnotationProperties)

       

       

       

      Dim objVertices As Object

      objVertices =

      New Object() {}

       

      ReDim objVertices(3)

      objVertices(0) =

      New Double() {10, 10}

      objVertices(1) =

      New Double() {20, 10}

      objVertices(2) =

      New Double() {20, 20}

      objVertices(3) =

      New Double() {40, 5}

       

      'Set the Properties now that the type is defined

      objAnnotationProperties = objAnnotation.getProps()

       

       

      With objAnnotationProperties

           .author = "Eric"

           .vertices = objVertices

       

       

       

      End With

      objAnnotation.setProps(objAnnotationProperties)

       

      I know I initialized the Object Array in a wierd way. I have my reasons.

      Don't get too hung up on the array itself because the problem that I am having is that the "vertices" member does not exist.

      I get the same error with ANY annotation that includes a "vertices" member.

       

      Error: Public member 'vertices' on type '_ComObject' not found.