POST
|
Thanks Jeff, that's the way: start an edit session.
'*** edit session running ***
If TypeOf pElement.Geometry Is IPolyline Then
Dim pPointCol As IPointCollection
Set pPointCol = New Polyline
Set pPointCol = pElement.Geometry
'Replace textPath here ......
' Just keep start- and endpoint
Dim pNewPolyline As IPolyline
Set pNewPolyline = New Polyline
pNewPolyline.fromPoint = pPointCol.Point(0)
pNewPolyline.toPoint = pPointCol.Point(pPointCol.PointCount - 1)
pElement.Geometry = pNewPolyline
pAnnoFeat.Annotation = pElement
pFeatureCursor.UpdateFeature pFeature
End If
One more question: is it possible to start an edit session programatically without having the involved featureclass loaded in the table of contents?
... View more
01-28-2013
11:52 AM
|
0
|
0
|
710
|
POST
|
pElement does't accept any changes. The following code gives me automation errors:
'Replace textPath here ......
' Just keep start- and endpoint
Dim pNewPolyline As IPolyline
Set pNewPolyline = New Polyline
pNewPolyline.fromPoint = pPointCol.Point(0)
pNewPolyline.toPoint = pPointCol.Point(pPointCol.PointCount - 1)
pElement.Geometry = pNewPolyline '*** automation error ***
Dim pNewPointCol As IPointCollection
Set pNewPointCol = New Polyline
Set pNewPointCol = pNewPolyline
pElement.Geometry = pNewPointCol '*** automation error ***
pPointCol.RemovePoints 1, pPointCol.PointCount - 2
pElement.Geometry = pPointCol '*** automation error ***
... View more
01-28-2013
10:21 AM
|
0
|
0
|
710
|
POST
|
There must be missing something. The geometry doesn't change.
'Replace textPath here ......
' Just keep start- and endpoint
Dim pNewPolyline As IPolyline
Set pNewPolyline = New Polyline
pNewPolyline.fromPoint = pPointCol.Point(0)
pNewPolyline.toPoint = pPointCol.Point(pPointCol.PointCount - 1)
Dim pNewTextPath As ITextPath
Set pNewTextPath = New SimpleTextPath
Set pNewTextPath.Geometry = pNewPolyline
Set pTextSym.TextPath = pNewTextPath
pFeatureCursor.UpdateFeature pFeature
... View more
01-27-2013
06:14 AM
|
0
|
0
|
710
|
POST
|
Yes Neal, but did not succeed. Maybe you can show me how to do it?
... View more
01-21-2013
09:00 PM
|
0
|
0
|
710
|
POST
|
Hello, I want to change the geometry (textpath) of existing annotation features so that the curvature gets horizontal. I tried several things but did not succeed. Can somebody help me with the code i already have? Set pFeatureCursor = pFeatureclass.Update(pFilter, False) Set pFeature = pFeatureCursor.NextFeature While Not pFeature Is Nothing Dim pAnnoFeat As IAnnotationFeature Set pAnnoFeat = pFeature Dim pElement As IElement Set pElement = pAnnoFeat.Annotation Dim pTextElement As ITextElement Set pTextElement = pElement Dim pTextSym As ISimpleTextSymbol Set pTextSym = pTextElement.Symbol If Not pTextSym Is Nothing Then Dim pTextPath As ITextPath Set pTextPath = pTextSym.TextPath If TypeOf pTextPath Is IOverposterTextPath Then If TypeOf pElement.Geometry Is IPolyline Then Dim pPointCol As IPointCollection Set pPointCol = New Polyline Set pPointCol = pElement.Geometry ' Just keep start- and endpoint pPointCol.RemovePoints 1, pPointCol.PointCount - 2 '....... Replace textPath here ...... pFeatureCursor.UpdateFeature pFeature End If End If End If Set pFeature = pFeatureCursor.NextFeature Wend End If Greetings, Henk
... View more
01-17-2013
01:14 AM
|
0
|
11
|
1127
|
POST
|
I thought it would be possible by code in Tool Validation:
class ToolValidator:
"""Class for validating a tool's parameter values and controlling
the behavior of the tool's dialog."""
def __init__(self):
"""Setup arcpy and the list of tool parameters."""
import arcpy
self.params = arcpy.GetParameterInfo()
def initializeParameters(self):
"""Refine the properties of a tool's parameters. This method is
called when the tool is opened."""
for param in self.params:
if param.name == 'Extent':
param.ExtentRule = "Same as Display"
break
But that doesn't seem to work. Anyone an idea? Greeting, Henk
... View more
11-27-2011
10:28 PM
|
0
|
0
|
149
|
POST
|
Hello, I made a model with 'extent' as modelparameter. When a user runs this model he has to choose "Same as Display" most of the time. Is there a way to invoke this choice by code so user just has to push the OK-button? Greeting, Henk
... View more
11-24-2011
06:17 AM
|
0
|
1
|
719
|
POST
|
I'm having the same issue when running my python script. It connects the layers fine, then immediately removes them. Is this a known bug? I have the same problem: after setting the source, the layer is removed from the TOC. What's happening? Greetings, Henk
... View more
11-14-2011
05:15 AM
|
0
|
0
|
77
|
POST
|
Yes, there is a whereclause involved. But this can't be the problem, because it's working in a different sde-version where the datastructure is the same. I can't reproduce the error anymore. Someone must have fixed the data. Thanks
... View more
06-29-2011
04:23 AM
|
0
|
0
|
404
|
POST
|
Hi Henk, I tried the code with some testing data and I don't see any errors. I wonder have you tried the code with any other dataset? Can you see consistent behavior? Thanks, Chelsea I think you are right. Processing data in another sde version gives no problem. Any idea what causes the error? Thanks
... View more
06-24-2011
03:46 AM
|
0
|
0
|
404
|
POST
|
Hello all, The VBA code below gives me this error: A subscription cannot be stored unless its event class already exists This happens only when using esriSpatialRelOverlaps.
Set pFeatureLayer = pLayer
pSpatialFilter.SpatialRel = esriSpatialRelOverlaps
Set pSpatialFilter.geometry = pInFeature.ShapeCopy
Set pFeatureCursor = pFeatureLayer.FeatureClass.Search(pSpatialFilter, False)
Set pFeature = pFeatureCursor.NextFeature
Can somebody tell me what's going on? I think it has something to do with the migration to ArcGis10. Greetings, Henk
... View more
06-23-2011
07:26 AM
|
0
|
4
|
3939
|
POST
|
Thanks Tope, thats the trick (when using arcpy.GetJobAOI_WMX)
# Import arcpy module
import arcpy
arcpy.ImportToolbox(r"C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Workflow Manager Tools.tbx")
# Check out any necessary licenses
arcpy.CheckOutExtension("JTX")
# Process: Get Job AOI
arcpy.GetJobAOI_WMX(234567, "AOI")
Greetings, Henk
... View more
06-17-2011
11:32 AM
|
0
|
0
|
435
|
POST
|
Ah! MB exported with _WMX and it should be _wmx. In the 9.3 and older geoprocessor capitalization didnt matter. At 10 it started mattering. It still gives me <type 'exceptions.AttributeError'>: 'module' object has no attribute 'GetJobAOI_wmx' 😞
... View more
06-17-2011
02:19 AM
|
0
|
0
|
435
|
Title | Kudos | Posted |
---|---|---|
179 | 04-26-2010 04:36 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|