|
POST
|
I have determined that VBA does not have a 250 character limit as I originally thought. I was mislead into thinking that by using a watch variable, which does have a 250 character limit, but the string variable itself did not have this limit. I was able to demonstrate the string was not truncated by using a Msgbox output. I have determined that my problem was due to a change by the DBA to the way values were stored in a field. The change (removal of leading spaces from the values of a text field) caused my query string to be invalid and fail. I was not notified of the change, but eventually discovered the alteration. By changing my code to trim out leading spaces in my query string values and conform to the current field values I have resolved my problem. Sorry for the faulty interpretation of what I thought was my problem. To repeat, VBA strings at ArcGIS 10 do not have any change to the number of characters that can be stored relative to any previous version.
... View more
06-11-2012
08:15 AM
|
0
|
0
|
656
|
|
POST
|
For some reason, VBA scripts I have used for years can now only store 250 characters in a string variable. I know that String variables used to be ablle to hold at least 2048 characters. I have used a watch variable and verified that string variables stop appending charaters after 250 characters have been added to the string. 250 characters is too short to create many of my WhereClause Strings and causes many of my VBA feature selection queries to fail. My VBA scripts continue to work as long as all of the strings created in the script are 250 characters long or less. I think this limitation may have been introduced with ArcGIS 10, SP 3. Can anyone else test whaterver ArcGIS 10 Service Pack they have and report the maximum number of characters they can store in a VBA String variable? I need to know the last Service Pack where strings held about 2,048 characters so I can roll my installation back (at least until my scripts are converted to VB.Net). I originally thought I had installed SP 4, but in fact I am using SP 3, so that is where the limit seems to have occurred for me.
... View more
05-23-2012
12:58 PM
|
0
|
1
|
1185
|
|
POST
|
In the dataset I have census tracts for various counties in Texas. I am using symbology quantities with a graduated color to show median house value per census tract. Some of the census tract have no data on median house value. I need to change it so tracts with no data (currently white) are a different color. The problem is, unlike using symbology based on categories, with quantities you cannot simply add a unique value "no data", change the color and be done. [ATTACH=CONFIG]13412[/ATTACH] Symbology quantities won't let me add values to classify no data areas. A hack around it would be to duplicate the layer and create a definition query on the original layer to include only non-Null values and in the second layer include only Null value. Then you can symolize the second layer with a Single Symbol. Make the two layers part of a group to turn them on and off together.
... View more
04-11-2012
11:47 AM
|
0
|
0
|
1917
|
|
POST
|
Hi Richard ??? thanks for your response. I think your solution would work if the text came from a single field. Unfortunately out text string is not retrieved from a single field (like [My_Field]), but built from many fields. We do it like this so we can control the colour of each character/symbol independently with tags around the field, e.g. FindLabel = "<CLR cyan='100'>" & [PoliceStation] & "</CLR>" & "<CLR magenta='100'>" & [CaravanPark] & "</CLR>" I missed that. It is still a basic set of if tests to build the string and determine if a vbnewline needs to be inserted with a counter. I assume that if a field is white space it does not create a character in your string. Something like the following should work (it may not be elegant, but it would be reliable for any myBreak value from 1 up with just more copy/paste and modifying each field name and color). The code assumes that there are no Null field values. Function FindLabel ( [PoliceStation], [CaravanPark], [Field3], [Field4], [Field5], [Field6], [Field7, [Field8]) ' etc. for all fields in your list myStr = "" myBreak = 6 i = 0 if [PoliceStation] > " " Then i = 1 myStr = "<CLR cyan='100'>" & [PoliceStation] & "</CLR>" End If if [CaravanPark] > " " Then ' This begins the basic block to copy if i = mybreak Then myStr = myStr & vbnewline i = 0 End If i = i + 1 myStr = myStr & <CLR magenta='100'>" & [CaravanPark] & "</CLR> End If ' This ends the basic block to copy if [Field3] > " " Then if i = mybreak Then myStr = myStr & vbnewline i = 0 End If i = i + 1 myStr = myStr & <CLR magenta='100'>" & [Field3] & "</CLR> End If if [Field4] > " " Then if i = mybreak Then myStr = myStr & vbnewline i = 0 End If i = i + 1 myStr = myStr & <CLR magenta='100'>" & [Field4] & "</CLR> End If if [Field5] > " " Then if i = mybreak Then myStr = myStr & vbnewline i = 0 End If i = i + 1 myStr = myStr & <CLR magenta='100'>" & [Field5] & "</CLR> End If if [Field6] > " " Then if i = mybreak Then myStr = myStr & vbnewline i = 0 End If i = i + 1 myStr = myStr & <CLR magenta='100'>" & [Field6] & "</CLR> End If if [Field7] > " " Then if i = mybreak Then myStr = myStr & vbnewline i = 0 End If i = i + 1 myStr = myStr & <CLR magenta='100'>" & [Field7] & "</CLR> End If if [Field8] > " " Then if i = mybreak Then myStr = myStr & vbnewline i = 0 End If i = i + 1 myStr = myStr & <CLR magenta='100'>" & [Field8] & "</CLR> End If 'etc. FindLabel = myStr End Function
... View more
04-10-2012
08:05 PM
|
0
|
0
|
2642
|
|
POST
|
We use a FindLabel expression to retrieve characters from a number of attribute fields (up to 32). The characters correspond to a font which display as symbols on the map, e.g. �??C�?� displays a Caravan Park symbol. The characters are concatenated into a single character string. There are no characters separating the symbols (e.g. a space). Where a feature has a lot of facilities (e.g. a major town), the resulting line of symbols can be rather long and look clumsy on the map. We would like to use an expression to force a line break after a given number of characters (e.g. 6), so that the symbols are stacked in a neat pile near the feature they describe. We have tried using the �??Stack Label�?� function in Maplex but have so far got inconsistent results. We�??d be grateful for any suggestions of a way to consistently force a line break after a specified number of characters. [ATTACH=CONFIG]13404[/ATTACH] This expression seems to work in VB Script to create a break for every 6 characters. Just change the myBreak value to adjust for different character lengths: Function FindLabel ( [My_Field] )
myStr = ""
myBreak = 6
For i = 1 to Int(Len( [My_Field] )/myBreak)
if i = 1 Then
myStr = Left( [My_Field], myBreak)
End If
myStr = mystr & vbNewLine & Mid([My_Field], i * myBreak + 1, myBreak)
Next
FindLabel = myStr
End Function
... View more
04-10-2012
03:49 PM
|
0
|
0
|
2642
|
|
POST
|
in ArcEditor 10.0 how do I replace the existing geometry in an existing feature in a polygon feature class, with the geometry from another feature class? The scenario is that we have a complex property boundary in SDE (with shoreline) which needs to be updated. I want to copy the geometry from a feature in a shapefile and paste it into the existing feature in SDE - and only update the shape not the attributes nor create a new row. Its too complicated to use the trace tool - would take all day. thanks Use the Attribute Transfer tool on the Spatial Adjustment toolbar. You can set the Attribute Transfer Mapping to just transfer the geometry of the object by leaving all field attributes unmatched and just checking the transfer geometry checkbox. Then use the Transfer Attribute tool button at the end of the toolbar during an edit session and click on the source and then the target feature. The geometry will update (you may have to refresh to see it). Then you can save the changes.
... View more
03-16-2012
01:28 PM
|
0
|
0
|
3814
|
|
POST
|
Hi everyone. I have a layer of polygon features showing the footprints of all of the buildings in a given city. I want to know if there's a way to find all of the buildings that are located within 100 feet of any other buildings. It doesn't seem this can be done using Search By Location, since all the features are on the same layer. Does anyone know if there's another way to do this? Thanks! You could do a Spatial Join with a 100 foot tolerance and ignore identical FID values. Two layers pointing to the same dataset may work, but the worst case would involve creating a temporary copy.
... View more
03-04-2012
06:14 PM
|
0
|
0
|
585
|
|
POST
|
Thales007 - Thank you for your input, unfortunately your solution would not work in this case. The information in each polygon (and therefore point) is amended on a weekly, sometimes daily basis. Converting it to raster would just mean more work. jborgion - I have used a spatial join in the past but it creates a new feature which is not ideal (see above). However, I have given it some thought, and while I am no expert, I feel using modelbuilder to create a workflow would help speed things up. Tell me what you think: Manually enter delivery information then - Dissolve feature based on delivery number > spatial join (SJ) polygons to points > Select points by location within dissolve feature (to speed things up) > join SJ feature to points based on postcode > field calculator data into relevant fields > Remove join > delete SJ feature. I'm not even sure model builder can do that but I would like to think it can. Creating a temporary output in a model is a standard process, so the fact that you are using tools that create a new feature class that you ultimately want preserved in a permanent feature class is no reason to avoid using a tool. My question is will every point you have only be located within a single Dissolved Polygon? If so ModelBuilder definitely can definitely do the job. If that is the case, you just need to use the JOIN ONE TO ONE option with the Spatial Join and make the Point the Target features and the Dissolved Polygons the Join Features. That output will have a single record for each point with the attributes from the one matchin Dissolved Polyton. You can perform a standard attribute join of the Spatial Join output to your points on the Point ObjectID to the Sparial Join Target_FID and do the data transfer. The main trick in ModelBuilder is that you have to use the Create Feature Layer tool on the Point Feature Class first before you can do an attribute join of your points to the Spatial Join output. Anyway, based on myu experience with doing most of my models based on this kind of workflow, here are the tools I would normally use: Dissove - Dissolve the Polygons and make sure any attributes you need to transfer to the points are in the summary. Spatial Join - Points are the Target feature and Dissolved polygons are the Join feature using the JOIN ONE TO ONE option. Add Attribute Index - Index the TARGET_FID field in the Spatial Join Output to improve attribute join performance. Create Featuer Layer - Create a feature Layer of the Points. Join - perform an attribute Join of the Point Feature Layer (ObjectID) to the Spatial Join output (Target_FID). (Optionally) Select By Attribute - Select where JOIN_FID > -1 if you only want to modify points that actually fell within a polygon or skip this step if you don;t care. Field Calculator - Use this tool to transfer the information. Use it as many times as you need to fill in all of the data derived from the Dissolved Polygons to the points. Remove Join - Remove the Attribute Join Delete - Delete the Spatial Join output.
... View more
03-03-2012
06:59 AM
|
1
|
2
|
7994
|
|
POST
|
This code in VBA may do what you are wanting to do.
... View more
02-21-2012
06:58 PM
|
0
|
0
|
1349
|
|
POST
|
Hi, Can anyone help me write a quick c# tool to query and display a segment of a route based on a TO and FROM measure? Please point me in the right direction or paste a quick code if you can. Thanks. There is nothing quick about programming LR interfaces. I don't write c# code, but have done LR programming in VBA. To check out some of the interfaces you need to familiarize yourself with check out this thread. You also have to test the To/From measure to find out if they are actually on your line and decide what to do if they are not.
... View more
02-21-2012
09:41 AM
|
0
|
0
|
1349
|
|
POST
|
Hi, I am trying to perform something similar...in a way. I want to use the road center line address ranges and according to these values creating a point layer with the address information in them spread throughout the line. Any ideas? See my response to your question here. You are just wanting to do basic geocoding and may need help creating a table of addresses to use.
... View more
02-18-2012
04:39 AM
|
0
|
0
|
2682
|
|
POST
|
Does a tool exist to place a point at a road intersection? Interestingly the tool you can use is Intersect (figures, huh.) There is an option to specify that you want a Point output form the intersection of lines and/or polygons. When this option is checked for these geometry types the points returned are in fact the intersection points you want. You can input a single polyline feature class to the tool and it will create the intersections with this option. (Thanks to Darren Wiens for pointing this out in post #8 of this thread).
... View more
02-18-2012
04:28 AM
|
0
|
0
|
948
|
|
POST
|
I know this is the Python forum, but I wanted to mention that in ArcObjects that the QueryPointAndDistance method of the ICurve interface reports not only the Near Point, but also reports the distance along the line where the near point fell (as either a percentage of the line or a linear distance), the distance of offset from the line, and the side of the line the point falls on (left/right) in one operation. It is very efficient and cool, and potentially worth the trouble of learning how to use ArcObjects within Python if you need to do a lot of linear analysis. It works with the evil true curves also and polylines of any shape. I have used it with Address Range validation and assignment and other Linear Referencing operations.
... View more
02-17-2012
06:27 PM
|
0
|
0
|
6114
|
|
POST
|
Hi, I am trying to use python in order to convert a road center line into address points. Basically, I need to use the address ranges and create a point layer dispersed throughout the center line. Any ideas? That is exactly what geocoding does. Geocoding creates address points based on your centerline address ranges. Python could be involved in generating a table of all possible addresses by reading the possible Street Names and house numbers that fit in the ranges. Then simply run the geocoding tools ESRI provides on that table. Look on the Geocoding forum for more information on how to configure your geocoding options.
... View more
02-17-2012
04:55 PM
|
0
|
0
|
631
|
|
POST
|
Hello, I have a table in MS Access ([Loc], [Date], [Label]), which I want to use to populate labels in ArcMap 10. i.e., each location on the map gets a label box with the field header [Date] and [Label] followed by however many records for that location on subsequent lines (note: the number of records may vary between locations). Do you know of any VBScript code I could use for the label field Expression? Thanks! There is no code that you could put into the Label Expression that would do this using VBScript assuming by many records you mean actual table records and not comma delimited values. To accomplish what you want you would have to use a cursor to read multiple records, but VBScript does not include cursor support. If you have an ArcInfo licence, there is a way to convert a 1:M relationship into a 1:1 relationship with the Pivot table tool, but use of that tool would not support any live response to edits in your original Access table. There was an extension or tool to do this for 9.3, but I do not know if the code was ported for use with 10 or if it would work with an Access table or just a dbf or geodatabase table. Search the forums. There have been dozens of discussions on this subject. This is the most recent post on the subject and it indicates that the code has not been ported and what would be involved to port it for use with 10.
... View more
02-16-2012
09:22 AM
|
0
|
0
|
803
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-24-2026 11:37 PM | |
| 1 | 03-24-2026 08:01 PM | |
| 6 | 02-23-2026 08:34 AM | |
| 1 | 03-31-2025 03:25 PM | |
| 1 | 03-28-2025 06:54 PM |
| Online Status |
Offline
|
| Date Last Visited |
Thursday
|