POST
|
Solution: Using the Calculate Value Tool with a Python statement. Expression: field() Code Block: def field():
ColName = []
CName = arcpy.ListFields("<pathtofolder>/%name%_id.shp", "FID_"+ "%name%"+ "_f*")
ColName.insert(0, CName[0].name)
return fieldName
Data Type: Field Then use the calculated Output Value as input for the next tool (e.g. Join Field) When using a where clause for the Select tool e.g.: Expression: field() Code Block:
def field():
ColName = []
CName = arcpy.ListFields("<pathtofolder>/%name%_id.shp", "FID_"+ "%name%"+ "_s*")
ColName.insert(0, CName[0].name)
where_clause = ColName[0] +' > -1'
return where_clause
Data Type: String The output value can then be used as input for the Expression of the Select Tool.
... View more
05-15-2014
02:48 AM
|
0
|
0
|
1139
|
POST
|
Hello, I've got the following issue to address: I process a bunch of shapefiles with a certain name stored in a folder. I use the %name% variable to name the outputs of geoprocessing operations. Now, I want to use an SQL statement for a Selection (Select Tool). I don't now the exact fieldname, because the field is produced during a geoprocessing task executed before (Identity). The name is something like "FID_" +[shapefilename]+ [s+further characters], but not exactly known. So I'd like to make a query such as: "FID"+%name% + "s*" > -1 . My thought is to pass a variable containing the expression needed for the Select Tool. So far it is possible to pass a string variable such as "FID_%name%" , but the s* Wildcard is not accepted as SQL syntax. Any clues? Tank you very much for your help! Kathrin
... View more
05-14-2014
02:02 AM
|
0
|
1
|
4755
|
POST
|
Thank you both very much! This arcpy.CalculateField_management(input ,"NAME", "'%s'" % (name ), "PYTHON") did the trick!
... View more
12-04-2013
03:32 AM
|
0
|
0
|
473
|
POST
|
I iterate through a list of shapefiles and do some geoprocessing chains and field calculations for each of the input shapes (works fine). The result is a dbf for each of the input shapefiles. Now I'd like to write the name of the input shapes into a field in the output dbf and then merge the dbfs. Merging works also fine. The naming process worked fine using ArcGIS 10 or 10.1, but fails using ArcGIS 10.2 and Python 2.7.3. Some snippets:
#Blabla Environment + Import
(...)
#List FCs
name = []
x = 0
fcList = arcpy.ListFeatureClasses()
for fc in fcList:
print fc
name.insert(x, fc.split(".")[0])
x += 1
#Blabla Geoprocessing
(...)
#Write Name into output dbf and merge
x=0
for fc in fcList:
arcpy.AddField_management(input ,"NAME", "TEXT")
arcpy.CalculateField_management(input ,"NAME", "name ", "PYTHON")
x += 1
out = outws + "Merge" + ".dbf"
result = arcpy.Merge_management (input, out)
Printing x, the input and name returns the right values for x and the file names (e.g. B, C, D, E, F). But only the first name is written into the table, e.g.: FID------BLA----NAME 0 -------- . ------B 1 -------- . ------B 2 -------- . ------B 3 -------- . ------B 4 -------- . ------B Any idea? By the way, I get now error message, but the info "returned exit code 0". Thanks Kathrin
... View more
12-03-2013
06:44 AM
|
0
|
3
|
1462
|
POST
|
Thank you! 🙂 Okay, finally found a way: I chose a longer distance for bearing distance to line and used my Multiple Ring Buffer + the new compass rose lines (that are longer than the distance of the MRB to the center point) in the Feature to Polygon tool. The result is exactly what I wanted concerning Feature to Polygon. But I discovered a different problem. The compass rose is somehow rotated a few degrees. I made one line every 15°, but the starting line is not 0/360 but something like 2°/362°...
... View more
12-02-2013
12:48 PM
|
0
|
0
|
525
|
POST
|
Hello ArcGIS Community, my intention is to create polygon features in the form of a compass rose. I use the bearing distance to line tool which works fine, creating the lines in the designated angle and distance from the center point of the compass rose. But now I need polygons. I tried to use Feature to Polygon for the compass rose line FC only and also for a FC containing a merge of the compass rose lines and a buffer of the center point, but the result is always a circle not containing the angular divisions. So how can I make polygon features out of my compass rose lines? Thank you Kathrin
... View more
12-02-2013
11:41 AM
|
0
|
2
|
1110
|
POST
|
Hello, the enclose multipatch tool unfortunately yields bad results. I have a multipatch FC created from an extrusion between two TIN surfaces for the area of building footprints. The Is Closed tool shows that a lot of Multipatch Features are not properly closed. Now I used the Enclose Tool to close these polygons, but this results in most shapes being distorted or looking damaged, some are also missing. Furtheron, how does the grid parameter affect the results? I often get the error message "use larger grid size", but using a larger grid size, ArcScene crashes. Using a grid size of 0.4 was the only handable value, but results in the mentioned distorted shapes. Any idea how I can close my multipatches and continue calculating surface area and volume? Thanks, Kathrin
... View more
11-20-2013
02:29 AM
|
1
|
2
|
5342
|
POST
|
I finally could do the extrusion. Problem was that I added the field to the shapefile in ArcGIS after loading it into City Engine. I thought CE would update it after a restart, but it didn't. After removing the shapes and adding the shp again, I could finally access the attribute field and extrude.
... View more
01-25-2013
08:50 AM
|
0
|
0
|
322
|
POST
|
Also, I am not able to open my old cej files any more... and when I ty to import them, CE produces gigs of data rubbish always repeating the name of the project for hundreds of times so that I got a project folder with hundreds of subfolders which Windows refuses to delete because the filename is too long. Hmmm...
... View more
01-25-2013
05:57 AM
|
0
|
0
|
322
|
POST
|
Hi there, I used my old pretty simple rule file for building extrusion based on an attribute field in a shapefile (called "height", field type Double), but the rule does not work anymore in CE 2012.
# inizialize attrs
attr height = 0
# please note : If the StartRule annotation is set, CityEngine automatically checks for Object Attibutes
# coming from GIS Data. If there exists one with the specific name, CE will point to it.
@StartRule
Lot -->
extrude(world.y, height) After generating, the building footprints are black, the shapes disappeared and nothing is extruded into the 3rd dimension (see attachment). I have chosen "object attribute with name 'height'" in the Attribute Connection Editor.
... View more
01-25-2013
04:29 AM
|
0
|
3
|
769
|
POST
|
Hello, I could finally download the tool using IE. Thanks!
... View more
01-22-2013
06:23 AM
|
0
|
0
|
186
|
POST
|
I need to burn multipatches into a DEM. The tool mentioned here: http://resources.arcgis.com/gallery/file/java/details?entryID=2929E846-1422-2418-A0DD-16627D87B471 is not accessible (Error 502). Would be glad if someone could help me out... Furtheron, I'm confused were Arcscripts went to. It says ArcScripts was moved to Code Galleries, but there are no active Code Galleries on the Ressource Center. So I registered with ArcGIS Online, and I don't find any python scripts or tools there. Where did the valuable idea of sharing code with others go? Thanks, Kathrin
... View more
01-22-2013
04:12 AM
|
0
|
0
|
517
|
POST
|
Zonal Statistics as Table could be what you are looking for. The tool calculates several statistical measures (MEAN; MAX; MAX; MIN; STD;....) for all the pixels in each zone (aka polygon of a shapefile): http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z000000w8000000.htm http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/How_Zonal_Statistics_works/009z000000wt000000/ Use your Building ID as zone field. You can then join the output table to your original footprint shapefile and copy the mean height values into the footprints shapefile's attribute table. Hope that helps. Kathrin
... View more
09-27-2012
07:43 AM
|
0
|
0
|
201
|
POST
|
Hey, thanks for your hints. The reimport to collada works out now, but I only can replace single features. Since I have hundreds of features in my FC, this would be a looot of work. Is there a way to use "Replace with Model" via Python or ModelBuilder? Thanks, Kathrin
... View more
09-18-2012
05:08 AM
|
0
|
0
|
347
|
Title | Kudos | Posted |
---|---|---|
1 | 11-20-2013 02:29 AM | |
1 | 03-07-2011 01:15 PM | |
1 | 02-17-2011 06:33 AM | |
1 | 08-31-2011 04:39 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|