|
POST
|
You don't need to include a '__main__' section in the main script (although it is good practice), nor remove the '__main__' from an imported script (I think this might actually not be good practice). Why you don't need a '__main__' section: when you call your script, it is read from top to bottom, executing lines as it goes. If you know that script will always be the main script (i.e. not imported as a module) then it will execute as if everything was wrapped within a '__main__' section - you just skip the part where it confirms that it is indeed the main script. The problem arises when you want different behaviour between the script as run as a main script and when it's imported. Making Python scripts modular is good practice, although to be honest, I never do it. Why you don't need to remove the '__main__' section from the imported script: since you're importing the module, it will not be named '__main__' so that section will not execute.
... View more
11-22-2016
11:32 AM
|
1
|
3
|
1557
|
|
POST
|
See the example on using logic with Python: Calculate Field examples—Help | ArcGIS for Desktop
... View more
11-22-2016
10:53 AM
|
1
|
0
|
674
|
|
POST
|
Just to confirm: you've set the placement to on the line for each label class? Also, have you tried using Maplex labeling for this?
... View more
11-21-2016
02:08 PM
|
1
|
0
|
1418
|
|
POST
|
Here's an example, but really all I'm doing here is doing your web search for you: email - Attach a txt file in Python smtplib - Stack Overflow
... View more
11-21-2016
01:21 PM
|
0
|
2
|
3140
|
|
POST
|
What have you tried so far? I see lots of search results searching for "python email attachment".
... View more
11-21-2016
01:14 PM
|
0
|
4
|
3140
|
|
POST
|
One way to add a selection to your layer using Python is to run: Select Layer By Attribute—Help | ArcGIS for Desktop
... View more
11-21-2016
01:08 PM
|
1
|
0
|
1662
|
|
POST
|
Errrrr Dan, the statsFields parameter is supposed to be a list of lists. It's a list of field-stat pairs, so you can count one field, sum another field, etc. Summary Statistics—Help | ArcGIS for Desktop
... View more
11-21-2016
09:10 AM
|
2
|
1
|
1191
|
|
POST
|
It might help to describe where you are stuck, and go from there. Have you started? For sending email, I'd start here: 18.1.11. email: Examples — Python 2.7.12 documentation
... View more
11-18-2016
10:46 AM
|
1
|
0
|
1355
|
|
POST
|
Rather than pointing the cursor to the .lyr file, can you try pointing it to the feature class that the .lyr refers to?
... View more
11-18-2016
10:27 AM
|
0
|
0
|
7306
|
|
POST
|
If you simply want to make the extent rectangle larger than it really is (a bit of a lie), you can change the line offset property deep within the extent rectangle properties. Data Frame Properties -> Extent Indicators tab -> Frame... -> Border Properties ("i" button) -> Change Symbol... -> Edit Symbol... -> Cartographic Line Symbol -> Line Properties tab -> Change Offset to positive number Original: Same main map extent, with extent rectangle +4 offset:
... View more
11-18-2016
10:02 AM
|
2
|
3
|
5752
|
|
POST
|
You can always add a new field and calculate as metres to check against your known values, but given that you have to make an effort to calculate in units other than the linear unit, it's a safe bet that it's what was used.
... View more
11-17-2016
03:24 PM
|
1
|
1
|
1350
|
|
POST
|
I think you need fieldVar.name (a string) rather than fieldVar (a field object).
... View more
11-17-2016
03:09 PM
|
1
|
24
|
3215
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-30-2013 02:22 PM | |
| 1 | 04-12-2011 11:19 AM | |
| 1 | 09-17-2021 09:43 AM | |
| 1 | 04-04-2012 12:05 PM | |
| 2 | 07-16-2020 11:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-15-2023
12:11 AM
|