|
POST
|
Hi @BlakeTerhune, So I figured out the issue with part of the script that was giving me issues. #Check to see if the following project already exists. If project exists, overwrite the existing project.
Project_GDB = ''
for root, directory, files in os.walk(folder_location):
GDB = os.path.split(root)[-1]
if GDB == ProjectGDB:
Project_GDB = root
else:
Project_GDB = arcpy.management.CreateFileGDB(folder_location, Project) Further in the script I converted the output to a string and then utilized the os.path.join which worked as intended. SubBoundaryFC_Name = 'SubdivisionBoundary'
SubdivisionFC = os.path.join(str(Project_GDB), SubBoundaryFC_Name)
SubBoundary = arcpy.management.FeatureToPolygon(FCs_forSubdivisionBoundary, SubdivisionFC)
arcpy.AddMessage('{} has been created.'.format(SubBoundaryFC_Name)) So this simple solution was really all I needed. Here is the message result that it generated. SubdivisionBoundary has been created.
... View more
09-10-2021
04:54 AM
|
2
|
0
|
6255
|
|
POST
|
Hi @BlakeTerhune, Here is the error message that I keep getting when it runs. Failed script Import Test...
Traceback (most recent call last):
File "*:\CAD Exporting Test\Default.tbx#ImportTest_Default.py", line 207, in <module>
File "*:\CAD Exporting Test\Default.tbx#ImportTest_Default.py", line 183, in ScriptTool
File "*:\''\''\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\ntpath.py", line 76, in join
path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not Result
Failed to execute (ImportTest). Not sure what this error refers to but I can't seem to bypass it for some reason. I am thinking that the issue is either a syntax issue or an output error.
... View more
09-09-2021
12:28 PM
|
0
|
2
|
6279
|
|
POST
|
I accidently left out of the snippet for this little piece here by mistake. FCs_forSubdivisionBoundary = [] It is derived from using walk to append each feature class in the database based on matching names.
... View more
09-09-2021
10:17 AM
|
0
|
4
|
6284
|
|
POST
|
Below is an example on how to set up the stacked bar graph by having a generic field for the soil and have a a field name for the soil and the attribute value as the depths. I don't know if it works well with negative values but you could give that a try. This is kind of a poor example but it should get you close to what you are trying to do.
... View more
09-09-2021
10:10 AM
|
0
|
1
|
3008
|
|
POST
|
Hi, I am currently working on a custom python tool that works until a certain point. The issue that I am having, and it is probably really simple but I can't seem to trouble shoot, is specifying the feature class using os.path.join method (unless I configured this wrong but running a random test proves otherwise). The input workspace is set by a created gdb derived from one of the user inputs. Everything works until this point and I am now at a standstill. Any help on this would be greatly appreciated. import arcpy
Project_GDB = 'input random gdb'
SubBoundaryFC_Name = 'SubdivisionBoundary'
SubdivisionFC = os.path.join(Project_GDB, SubBoundaryFC_Name)
SubBoundary = arcpy.management.FeatureToPolygon(FCs_forSubdivisionBoundary, SubBoundaryFC_Name)
arcpy.AddMessage('{} has been created.'.format(SubBoundary))
... View more
09-09-2021
07:02 AM
|
0
|
9
|
6310
|
|
POST
|
Hi @MatthewLau, Do you simply need a 2D graph or a 3D graph? If you are interested in the 3D graphs, click here to see some samples. If it is simply 2D with various views(Top with Dimensions, and Profile), then you can combine the stacked graph and either an image or html created object to indicate the top of the borehole with lines showing the x and y coordinates and using the graph for the elevations. Also, are these popups for ArcPro or ArcGIS Online? Just getting more clarity so to help direct you in the the direction you wish to go.
... View more
09-09-2021
06:47 AM
|
0
|
0
|
3013
|
|
POST
|
I figured out the issue. I wasn't sure why I didn't notice it before but the tool is working with the exception of the indexing error that I need to troubleshoot. class ToolValidator:
# Class to add custom behavior and properties to the tool and tool parameters.
def __init__(self):
# set self.params for use in other function
self.params = arcpy.GetParameterInfo()
def initializeParameters(self):
# Customize parameter properties.
# This gets called when the tool is opened.
return
def updateParameters(self):
# Modify parameter values and properties.
# This gets called each time a parameter is modified, before
# standard validation.
featureclass = self.params[2].value
fieldname = self.params[3].value
SubdivisionLayers = self.params[4].filter
if featureclass:
fcfields = [field.name for field in arcpy.ListFields(featureclass) if field.name == fieldname]
attributevalues = [row[0] for row in arcpy.da.SearchCursor(featureclass, fcfields)]
UniqueAttributes = set(attributevalues)
SubdivisionLayers.list = [str(value) for value in UniqueAttributes]
return
def updateMessages(self):
# Customize messages for the parameters.
# This gets called after standard validation.
return
# def isLicensed(self):
# # set tool isLicensed.
# return True The other issue is that it is passing the values with a ';' in between. I think I know a workaround but I will keep trying or create another post for any assistance.
... View more
09-08-2021
07:21 AM
|
0
|
0
|
5001
|
|
POST
|
So I tried both of your suggestions, but I am still not getting the multiple selection that I am looking for. Here is the updated script but I can't seem to figure out what I am missing. Do I need to initialize a parameter first before using the update parameter? If this is all correct then any ideas on how to accomplish this. I have never tinkered with the tool validations before so this is all new territory for me. class ToolValidator:
# Class to add custom behavior and properties to the tool and tool parameters.
def __init__(self):
# set self.params for use in other function
self.params = arcpy.GetParameterInfo()
def initializeParameters(self):
# Customize parameter properties.
# This gets called when the tool is opened.
return
def updateParameters(self):
# Modify parameter values and properties.
# This gets called each time a parameter is modified, before
# standard validation.
if self.params[3].value:
featureclass = self.params[3].value
fcfields = [field.name for field in arcpy.ListFields(featureclass) if field.name == self.params[4].valueAsText]
attributevalues = [row[0] for row in arcpy.da.SearchCursor(featureclass, fcfields)]
self.params[5].filter.list = set(attributevalues)
return
def updateMessages(self):
# Customize messages for the parameters.
# This gets called after standard validation.
return
# def isLicensed(self):
# # set tool isLicensed.
# return True
... View more
09-08-2021
05:35 AM
|
0
|
1
|
5008
|
|
POST
|
Hi @MatthewLau, There are a few ways in which you could accomplish this, but they are fairly extensive and may require knowledge of some kind of programming (primarily python) to generate a polygon shape. But it all depends on which direction you wish to take. Based on the image, is the image a profile of the borehole? I am somewhat familiar with these, so I have some knowledge of what they are. If the image you are looking to create is that of a vertical profile of the borehole, then perhaps a chart would be best. However, if you are looking to have some kind of complex viewing angles for the borehole, then a report might be more suitable in which case you could add the report as an attachment.
... View more
09-08-2021
04:30 AM
|
0
|
0
|
3036
|
|
POST
|
Hi, I was wondering if there was a way to set up the script tool parameters to update a multiple choice selection list based on a fields attribute values. I think I set it up correctly ( by all means correct me if it is wrong ) but it doesn't seem to be working accordingly. I might be missing something, but since I generally never mess with this, it is a bit foreign to me. Any help on this would be greatly appreciated. class ToolValidator:
# Class to add custom behavior and properties to the tool and tool parameters.
def __init__(self):
# set self.params for use in other function
self.params = arcpy.GetParameterInfo()
def initializeParameters(self):
# Customize parameter properties.
# This gets called when the tool is opened.
return
def updateParameters(self):
# Modify parameter values and properties.
# This gets called each time a parameter is modified, before
# standard validation.
if params[3].value:
fcfields = [field.name for field in arcpy.ListFields(params[3].value) if field.name == params[4].valueAsText]
attributevalues = [row for row in arcpy.da.SearchCursor(featureclass, fcfields)]
self.params[5].filter.list = set(attributevalues)
return
def updateMessages(self):
# Customize messages for the parameters.
# This gets called after standard validation.
return
# def isLicensed(self):
# # set tool isLicensed.
# return True Thanks
... View more
09-07-2021
01:03 PM
|
0
|
4
|
5244
|
|
POST
|
I do not think that this is possible simply because arcade expressions, when used for popups, only work for the particular layer that it corresponds to. You could try setting up the arcade expression to work with other features/geometries to see when one feature changes, then the arcade expression in the other feature also changes. This is my best guess for when it comes to creating custom popups using arcade expressions. Perhaps someone else in the community or Esri can give you further insight.
... View more
08-27-2021
04:48 AM
|
0
|
1
|
5247
|
|
POST
|
Your welcome @Suedietrich Then it sounds like you may have to use the define projection tool in conjunction with the project tool, or you could try to copy the data over using that projection. This is a pretty common issue with when it comes to converting projections. Or another option is to convert it to WGS 1984 Web Mercator and then re-project the data to the projection that you want. Try these options to see if either of these works. If not, then either I or someone in the community can give you some other options to try.
... View more
08-25-2021
09:17 AM
|
0
|
0
|
13289
|
|
POST
|
You can either define its projection using the Define Projection tool or the Projection Tool.
... View more
08-25-2021
07:28 AM
|
0
|
1
|
13354
|
|
POST
|
Yes, I am trying to use an arcade expression to populate the z values for each end of a line. When I try to set up an attribute rule to automatically populate these values. For some reason, whenever I try to create a rule to do this, it doesn't give me the option to switch from either python or arcade. It instead defaults to simply arcade.
... View more
08-20-2021
04:31 AM
|
0
|
1
|
2069
|
|
POST
|
Hi, I am trying to populate the vertices of a line feature class that represents wastewater mains and there exists two populated fields where one field has the invert elevation for one end of the line and another field with the invert elevation for the other end of the line. Is there a way to populate the z values for the ends of the line using arcade. I would greatly appreciate if anyone could let me know. Thanks.
... View more
08-19-2021
12:18 PM
|
0
|
3
|
2205
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-07-2026 01:36 PM | |
| 1 | 02-10-2026 06:09 AM | |
| 1 | 03-04-2026 01:08 PM | |
| 1 | 02-24-2026 12:59 PM | |
| 3 | 03-03-2026 10:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
Monday
|