POST
|
Hello. I'm dissapointed because I can't find any example of a script wich is able to : 1. take the records of an existing feature class (in a GeoDB file) 2. put them in an existing feature classe (in a GeoDB file too) With the interface it is the same to right-clic > Load > Load Data command. Precision : I don't want to overwrite the target feature class ! Thanks for your help.
... View more
06-23-2011
02:31 AM
|
0
|
5
|
4954
|
POST
|
OK. Found this : http://edndoc.esri.com/arcobjects/8.3/Samples/Geodatabase/Database%20Tools/TextFile%20to%20Annotation/basText2Anno.htm We made an adaptation of this code. The scenario is : - load a geodb point feature class, as source - load an empty geodb annotation feature class, as target - create annotations with a fixed Symbol ID and the angle and TextString Value from the point layer - create and populate the bonus fields And it works ! 🙂
... View more
09-08-2010
01:49 AM
|
0
|
0
|
152
|
POST
|
Hello. I have a shape with points and attributes. I would like to obtain some annotations in an annotation feature class in a file GeoDatabase. I have difficulties with the IannotateLayerProperties
Public Function CreaAnnoFromPoint()
'les variables pour utiliser ArcMap
Dim pMxApp As IMxApplication
Dim pDoc As IMxDocument
Dim pMap As IMap
'les objets ArcMap
Set pMxApp = Application
Set pDoc = Application.Document
Set pMap = pDoc.FocusMap
Dim plPoint As IFeatureLayer
Dim pfPoint As IFeature
Dim plAnno As IFeatureLayer
Dim pfAnnoClass As IFeatureClass
Dim pfAnno As IFeature
Dim pCursor As ICursor
'set the layers
Set plPoint = pMap.Layer(1)
Set plAnno = pMap.Layer(0)
Set pfAnnoClass = plAnno.FeatureClass
'cursor
Set pCursor = plPoint.Search(Nothing, False)
'go to first line
Set pfPoint = pCursor.NextRow
connString = "...\data\my_file_geodb.gdb"
Dim pWorkspace As IWorkspace
Dim pWorkspaceFactory As IWorkspaceFactory
Set openFGDBWorkspace = Nothing
Set pWorkspaceFactory = New FileGDBWorkspaceFactory
Set pWorkspace = pWorkspaceFactory.OpenFromFile(connString, 0)
Set openFGDBWorkspace = pWorkspace
'open edit session
Dim pEditor As IEditor
Set pEditor = Application.FindExtensionByName("ESRI Object Editor")
pEditor.StartEditing pWorkspace
Debug.Print "session open"
Dim l As Long
'the loop on the points
While Not (pfPoint Is Nothing)
zSymbolID = 3
zTextString = pfPoint.Value(8)
zFontName = pfPoint.Value(9)
zFontSize = pfPoint.Value(10)
zAngle = pfPoint.Value(18)
voie_id = pfPoint.Value(25)
adresse_id = pfPoint.Value(26)
adresse_numero = pfPoint.Value(27)
adresse_extension = pfPoint.Value(28)
adresse_batiment = pfPoint.Value(29)
adresse_origine = pfPoint.Value(30)
'for test
Debug.Print adresse_id
'create a new record on the annotation feature class
Dim pElement As IElement
Dim pTextElement As ITextElement
Dim pPoint As esriGeometry.IPoint
Dim pAnnotationFeature As IAnnotateFeature
Dim pAnnotationProperties As IAnnotateLayerProperties
'definition of annotation's propreties
Set pTextElement = New TextElement
pTextElement.Text = zTextString
pTextElement.ScaleText = True
'what else ?
l = l + 1
If (l = 10) Then GoTo fin
'Ligne suivante
Set pfPoint = pCursor.NextRow
Wend
fin:
'on ferme la session
pEditor.StopEditing True
Debug.Print "session fermée"
Debug.Print "==== FIN ===="
End Function
Thank you for your help.
... View more
09-07-2010
06:27 AM
|
0
|
1
|
286
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|