Select to view content in your preferred language

How to create a new (non-feature-linked) annotation feature and set its annotation?

1093
0
01-19-2011 10:57 AM
TiCrossman
Emerging Contributor
I am using ArcGIS-ArcView 10.0 and Python 2.6.5 in an external script.  All objects created in the script are in process, built using IObjectFactory.  I want to create a new annotation feature in an existing, non-feature-linked annotation feature class.  I am starting with IFeatureClass on a valid annotation feature class (pAnnoFC).  I am creating only one feature at a time, so I thought I could use IFeatureClass.CreateFeature instead of an InsertCursor and InsertFeature.  The following code,

    pNewFeature = pAnnoFC.CreateFeature


instead of returning IFeature, returns a bound method pointer with Python type:

<bound method POINTER(IFeatureClass).CreateFeature of <POINTER(IFeatureClass) ptr=0x3fb09a4 at 12d9a9e0>>


In need to QI to IAnnotationFeature2 to set the Annotation and other properties, but I need a valid IFeature to do that.  I also want then to update the value of a long integer field that I added to the existing anno class.  How do I go about creating a valid new anno feature (IFeature)?

Thank you all for the help.  --Ti
0 Kudos
0 Replies