POST
|
No, I didn't get that to work. I have been playing around with this can you use the utf-8 representation of the character: "\xc3\xa9" When I use that in a field this label expression works: def FindLabel ([Unicode_Value]): S = u'Libert{}'.format(unicode([Unicode_Value],"utf8")) return S
... View more
02-01-2013
08:33 AM
|
0
|
0
|
617
|
POST
|
Hi Neil, I don't know if it is a difference in the cursors, there is a slight difference in your code other than the cursor. What if in your old code you first constructed the Polygon object and then passed that into the row? I think the issue is occuring at the time you polygon object is created.
FcPoly.setValue("PMLNo", k)
polygon = arcpy.Polygon(array)
FcPoly.shape = polygon
... View more
02-01-2013
07:21 AM
|
0
|
0
|
814
|
POST
|
I tested on my end and it is applied, it doesn't seem to be exposed through the describe object. However if you open the feature class properties you will see a Z Coordinate System tab.
... View more
01-31-2013
02:36 PM
|
1
|
0
|
334
|
POST
|
Right, sorry that was the field name i was playing with on my side. Yea because you are surronding a variable name with quotes it is returning the string representation of the variable name (esri__0) rather than the string value ('\u00e9') referenced by the variable. The reason you see esri__0 is because we actually modify the function to replace the [fieldname] with esri__0 before the function is run. So does this not work? def FindLabel ([Unicode_Value]):
import locale
deflang, defencoding = locale.getdefaultlocale()
S = u'Libert{}'.format([Unicode_Value].encode(defencoding))
return S
... View more
01-31-2013
02:33 PM
|
0
|
0
|
617
|
POST
|
CAD to Geodatabase is not the right tool for this scenario, it will always create new output. Try the Append tool instead.
... View more
01-31-2013
02:19 PM
|
0
|
0
|
199
|
POST
|
Hi Lars, You probably won't like this answer but this is all so much easier at 10.1. At 10.1 sp1 we made a change so the NADCON transformation will no longer be added to the map by default, so it won't show up unless the transformation was actually set by the user. In addition, at 10.1 we added a new function call ListTransformations: http://resources.arcgis.com/en/help/main/10.1/#/ListTransformations/018v0000001p000000/ It allows you to specify an input spatial ref, output spatial ref and optional extent object and it will return a list of all the valid transformations for the from and to spat ref. With this list you could compare what is in the map and select the match.
... View more
01-31-2013
02:15 PM
|
0
|
0
|
572
|
POST
|
This issue is you are placing the variable [STATE_NAME] inside single quotes, you will see the value esri__0 is returned if you did the following: def FindLabel ([Unicode_Value]):
return '[Unicode_Value]'
... View more
01-31-2013
02:05 PM
|
0
|
0
|
617
|
POST
|
I spoke with John on this through e-mail, but thought I would post the answer here as well in case anyone in the future needs to know. To change this you would need to modify the config.xml. Below is an example of the section of the config defining the toolbars. Inside the Toolbars tag are two toolbars. Defined with Toolbar2 are the items on that Toolbar. In this scenario I have a 2 buttons, followed by a tool and a combobox in that order. <Toolbars> <Toolbar caption="Toolbar2" category="Python Addin" id="TestAddin_addin.toolbar" showInitially="true"> <Items> <Button refID="TestAddin_addin.button" /> <Button refID="TestAddin_addin.button_1" /> <Tool refID="TestAddin_addin.tool" /> <ComboBox refID="TestAddin_addin.combobox" /> </Items> </Toolbar> <Toolbar caption="Toolbar1" category="Python Addin" id="TestAddin_addin.toolbar_1" showInitially="true"><Items /></Toolbar> </Toolbars> If I want to move the combox box to be the first item on the toolbar I would modify the xml to the following, with the ComboxBox defined first. <Toolbars> <Toolbar caption="Toolbar2" category="Python Addin" id="TestAddin_addin.toolbar" showInitially="true"> <Items> <ComboBox refID="TestAddin_addin.combobox" /> <Button refID="TestAddin_addin.button" /> <Button refID="TestAddin_addin.button_1" /> <Tool refID="TestAddin_addin.tool" /> </Items> </Toolbar> <Toolbar caption="Toolbar1" category="Python Addin" id="TestAddin_addin.toolbar_1" showInitially="true"><Items /></Toolbar> </Toolbars> I wouldn???t be too concerned with modifying the xml, just make a copy of the original first and keep it as a back-up in case anything goes wrong you can always roll back. At this time this is the only way to modify the order of elements on a toolbar after it has already been authored in the python add-in wizard.
... View more
01-31-2013
01:41 PM
|
1
|
0
|
325
|
POST
|
This might be an spatial resolution/XY tolerance issue where vertices are being snapped together because the are closer than the default XY tolerance of a geometry with an unknown spatial reference. Try passing in an appropriate spatial reference for the geometry when you create the Polygon: OutCur = arcpy.da.InsertCursor(os.path.join(OutPath, OutPoly + "2"), ["PMLNo", "SHAPE@"]) desc = arcpy.Describe(os.path.join(OutPath, OutPoly + "2")) sr = desc.spatialReference for k in PolyData: v = PolyData array = arcpy.Array() # print k, len(v) for xy in v: point = arcpy.Point() point.X = xy[0] point.Y = xy[1] array.add(point) polygon = arcpy.Polygon(array, sr) data = [k, polygon] OutCur.insertRow(data) del OutCur
... View more
01-31-2013
01:36 PM
|
0
|
0
|
814
|
POST
|
Check out the following help topic: http://resources.arcgis.com/en/help/main/10.1/#/Managing_the_state_of_Python_add_in_types/014p0000001s000000/ If you want modify the state of another add-in item you need to reference the ID of the item. In your code you are using the name of the class, Block. Based on the comments in your code the ID of the second combo box is combobox2, so you would need to use that. The ID is defined when you author the addin and is stored in the config.xml. comboxbox2.enabled = True
... View more
01-31-2013
01:27 PM
|
0
|
0
|
629
|
POST
|
I am assuming when you say ArcObjects you are working in .Net. You might want to check out this help topic: http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#/Leveraging_ArcPy_in_a_NET_application/000100000m0s000000/
... View more
01-04-2013
12:19 PM
|
0
|
0
|
115
|
POST
|
This is already logged as a bug, NIM075822. Unfortunately this is a known limitation in the software. The recommended workarounds have already been discussed in this thread, use Copy Features or FC2FC to create a new feature class from the xy event layer.
... View more
01-03-2013
02:19 PM
|
0
|
0
|
599
|
POST
|
Layer Describe properties has an FIDSet property which returns a semicolon-delimited string of selected feature IDs. If the string is empty no features are selected: desc = arcpy.Describe(lyr) if not desc.FIDSet == '': print 'Layer has a selection'
... View more
01-03-2013
09:45 AM
|
0
|
0
|
1511
|
POST
|
Andy, This is not specific to Python, you can see it in ArcMap with the Make Feature Layer tool. If you run Make Feature Layer on your feature class and then examine the Layer Properties/General tab you will see the Description is the same as the layer name. When you drag and drop a FC into the map from Catalog the Description in the layer properties is taken from the item description of the feature class. This seems like a good enhancement request to the make feature layer tool to support bringing over the item description information to the layer since the item description information is valuable in publishing and packaging of the layer as well.
... View more
01-02-2013
02:32 PM
|
0
|
0
|
610
|
POST
|
Which service pack of 10.0 do you have installed? I am on service pack 5 and like you I find creating a reference to the MXD is fine, but unlike you an exception is raised when i attempt to list the layers and the try/except succesfully handles it. You may want to try installing sp5 as we may have resolved a bug that resolves this crash. If you are already at sp5 I will have to think about this a little more to come up with an alternative approach.
... View more
01-02-2013
12:55 PM
|
0
|
0
|
433
|
Title | Kudos | Posted |
---|---|---|
1 | 06-02-2011 03:59 PM | |
1 | 06-10-2011 08:37 AM | |
1 | 06-08-2011 04:27 PM | |
1 | 06-07-2011 03:11 PM | |
1 | 01-31-2013 02:36 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:22 AM
|