|
POST
|
What sort of side effects are you getting? Is Building Number a number or a string that represents a number? There appears to be nothing wrong with your expression.... I am running 10.4 and had a label script similar to yours and it runs with no problems except that the number is a string number so I had to convert the string to a number...... Function FindLabel ( [MDXID] )
if Int([MDXID]) < 140 then
FindLabel = [MDXID]
end if
End Function
... View more
04-12-2016
07:49 AM
|
0
|
2
|
5068
|
|
POST
|
When you created the route was any of these checked? coordinate_priority (Optional) The position from which measures will be accumulated for each output route. This parameter is ignored when the measure source is TWO_FIELDS. UPPER_LEFT —Measures will be accumulated from the point closest to the minimum bounding rectangle's upper left corner. This is the default. LOWER_LEFT —Measures will be accumulated from the point closest to the minimum bounding rectangle's lower left corner. UPPER_RIGHT —Measures will be accumulated from the point closest to the minimum bounding rectangle's upper right corner. LOWER_RIGHT —Measures will be accumulated from the point closest to the minimum bounding rectangle's lower right corner. These in cases will over rule digitized direction. One way to get around it is to edit your line segment and chose the appropriate method of accumulating the measures: About setting route measures—Help | ArcGIS for Desktop
... View more
04-07-2016
07:18 AM
|
0
|
0
|
1735
|
|
POST
|
04-06-2016
08:09 AM
|
0
|
0
|
911
|
|
POST
|
New to me, I am looking at various vbscripts I use with Dim statements.... Option Explicit Dim MyArray() ReDim AnotherArray()..... I do not disagree with VB Script using only Variant... properly Dim statements work and is good programming practice and helpful in debuging even VB Script Simple example of why DIM is good programming practice StudentFinalGrade = 100 StudentHomeworkGrade = 100 StudentCourseGrade = ((StudentFialnGrade + StudentHomeworkGrade)/200)*100 (Will not produce an error but is incorrect and the answer is wrong) Difficult to debug --------------------------------------------------------------- Option Explicit Dim StudentFinalGrade, StudentHomeworkGrade StudentFinalGrade = 100 StudentHomeworkGrade = 100 StudentCourseGrade = ((StudentFialnGrade + StudentHomeworkGrade)/200)*100 Will produce an error and the error is obvious [StudentFialnGrade should be StudentFinalGrade
... View more
04-06-2016
07:18 AM
|
0
|
0
|
911
|
|
POST
|
Looks like the question is well handled..... Just wanted to make a small observing comment. I still find it a good idea to explicitly define/dimension all variables. A lot of nasty type conversion errors can be avoided by explicitly knowing what type of variable you wish filled. Another observation: Dim n "is not a string, integer, double or object" In vb it is a "Variant" which could be any of all types. I generally avoid variants except when I do not know what type of data that is being received into the variable.
... View more
04-05-2016
07:57 AM
|
0
|
0
|
911
|
|
POST
|
Sounds like you are wanting to do cascading events where one event triggers the next and so on... When I do this in (Note: I am mainly a VB.Net programmer, a lot of differences between VB and VBA) the template/guideline/strategy I uses is this: 'Say I have 1 combo and 2 other sequentially dependent combo's or other types of controls
Private Sub MyForm_Initialize()
ComboBox1.Clear
ComboBox1.List = funtionToPopulateComboBox1()
ComboBox2.Clear
ComboBox3.Clear
End Sub
Private Sub ComboBox1_Change() 'Combobox Change event or Updated event
If ComboBox1.Value = "" Then Exit Sub 'In case value was deleted/not necessary with a listbox
ComboBox2.Clear
ComboBox3.Clear
Dim selectedComboVal1 As String
selectedComboVal1 = ComboBox1.Value
Select Case selectedComboVal1
Case "Condition1"
conditionFilter = "ConditionArg1"
Case "Condition2"
conditionFilter = "ConditionArg2"
...
Case else
SubToPopulateComboBox ConditionFilter,comboBox2
end select
End Sub
Private Sub ComboBox2_Change() 'Combobox Change event or Updated event
If ComboBox2.Value = "" Then Exit Sub
ComboBox3.Clear
Dim selectedComboVal1 As String
selectedComboVal2 = ComboBox2.Value
Select Case selectedComboVal2
Case "Condition1"
conditionFilter = "ConditionArg1"
Case "Condition2"
conditionFilter = "ConditionArg2"
...
Case else
end select
SubToPopulateComboBox ConditionFilter, comboBox3
End Sub
Sub SubToPopulateComboBox(filter,cbo as ComboBox)
Select Case cbo.Name
Case "ComboBox2"
functionToPopulateCBO2(filter) 'filter is based on the previous ComboBox selection
Case "ComboBox3"
functionToPopulateCBO3(filter)
End Select
End sub
... View more
04-01-2016
08:05 AM
|
1
|
0
|
445
|
|
POST
|
Mary, given what you gave, I assume that these fields were basically used for label formatting on a published map or report. You now wish to use these field as data inputs elsewhere, but have html coding as part of the field. This was an old fashion way of formatting labels. My suggestion is to either write a script to strip the html tags or use the field calculator advanced section and write a mini script to trip the tags away from the string. Python has a module called HTMLParser which does the very thing you are look for and a more through way of doing the stripping the code would look something like this... More advanced type of Python from HTMLParser import HTMLParser
class MLStripper(HTMLParser):
def __init__(self):
self.reset()
self.fed = []
def handle_data(self, d):
self.fed.append(d)
def handle_entityref(self, name):
self.fed.append('&%s;' % name)
def get_data(self):
return ''.join(self.fed)
def html_to_text(html):
s = MLStripper()
s.feed(html)
return s.get_data() Your examples appear to be fairly simple in nature so using the field calculator you may be able to successfully strip the tags using the following mini script : Expression: remove_html_tags(!YourFieldName!) Code Block: import re
def remove_html_tags(data):
p = re.compile(r'<.*?>')
return p.sub('', data)
... View more
03-31-2016
10:13 AM
|
0
|
0
|
1548
|
|
POST
|
I do not know of any built in way to do this. The scripting languages does not support Measures in that manner. That only leaves arcobjects as your only possibility for accomplishing that task. However I strongly recommend not going in that direction. ("Just because you can does not mean you should!") You would have to write code that would constantly have to read your current display cursor, determine whether it intersects a route, if it does, determine the intersection of the point the cursor is at with your line and then retrieve the "M" value and then display it as a tooltip. This would be running in the background all the time even when your are doing other stuff (May greatly slow down everything.) -- my 2 cents
... View more
03-30-2016
08:33 AM
|
0
|
1
|
779
|
|
POST
|
You got vb there, I cannot think of any "direct" way of equating nothingness without producing an error.
... View more
03-24-2016
07:50 AM
|
0
|
0
|
841
|
|
POST
|
uggg give headache reading the logic.... guess it is better than xstr = lambda s: s or "" print xstr(myString) a() = ("not null","Null") if not isNull(a) then a="Cannot be Null" (Yes I know only in vb.net not vbscript this true)
... View more
03-23-2016
09:18 AM
|
0
|
2
|
7978
|
|
POST
|
I am not a hydro or a hec user but the error code you are getting is a null value where it was not expected. If you are reading from a dataset/database/FC One or more of the fields being used contains a null value. If you are coding: You need and test to account for a null values.
... View more
03-23-2016
09:08 AM
|
0
|
0
|
954
|
|
POST
|
03-23-2016
08:45 AM
|
0
|
0
|
7978
|
|
POST
|
Since you are using VBScript: RTRIM( [PRE_DIR]) & " " & LTRIM([STR_NAME]) & " " & [SUF_FIX] <--- If the Pre_Dir is blank then you will still have two blanks befor the Str_Name... You may want to do something like this using the Advance code section for your label if trim([pre_dir] & "") = "" 'Handles Null cases as well as blanks
myLabel = ltrim(rtrim([str_name] & "" [suf_fix]))
else
myLabel = RTRIM( [PRE_DIR]) & " " & LTRIM([STR_NAME]) & " " & [SUF_FIX]
end if ** Had to add in the old fashion VB Null test trick to put a little mud in the eyes of the Python Lovers! Python handles null values horribly! I have had issues with python strings stripping when true null values when reporting from databases... even when I use python I find myself concatenating a blank purposely when a field could be null then stripping the blank away.
... View more
03-23-2016
07:32 AM
|
1
|
5
|
7978
|
|
POST
|
As Joshua Bixby alluded to, your "@value " is your default value for the size. Either you can have a field storing the value in your table or you would have to calculate the value within the expression. Example: for a 1:24000 scale map: myValue = 1/24000 * 12 * 72 This link gives a few details on how to go about it: Symbolizing point features using ground units: Multiple symbols | ArcGIS Blog
... View more
03-21-2016
07:44 AM
|
0
|
0
|
702
|
|
POST
|
First of all are you aware that the range for a signed short integer is between -32767 and 32767. If this is adequate for job then the next series of question would be is how is this being used/inputed/stored. Not knowing specifics Two ways come to mind: 1. Using the database/triggers/procedures create your own auto increment. or 2. Programmatic means issue a query to yous data source max(yourfield) + 1 If you are mobile and disconnected from your data store that create other additional difficulties. As an example I have Bridge Inspectors that go out and Identify Bridge Maintenance needs. Each "Need" must be a unique number but I cannot tell or give the number out in the field. So to get around this -- each mobile app (my case an excel spreadsheet) generates a "local" unique Identifier. When the local data is submitted to me and after Q/A I upload this data to the central repository - Part of my upload process generates the "Next" available unique number to the Need by programmatic means. The Q/A'd application then assigns the local data the "official" Unique Value. Hopefully this will trigger some ideas to get you unstuck.....
... View more
03-18-2016
09:53 AM
|
0
|
0
|
532
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-18-2018 09:46 AM | |
| 1 | 05-23-2018 08:30 AM | |
| 9 | 04-18-2019 07:15 AM | |
| 1 | 05-04-2016 08:15 AM | |
| 1 | 03-24-2017 01:22 PM |
| Online Status |
Offline
|
| Date Last Visited |
10-18-2023
06:40 PM
|