# How to build cylinder or cube multipatch objects in ArcGIS?

I'm trying to visualise a series of boreholes, which consist of points on the ground surface, and soil sample values taken at 0.01m depth intervals (in a related table).

eg in this screenshot, I've selected one borehole and displayed its related samples in the table.

Ideally I'd like to create a series of cylinders in 1m depth segments, to represent the average soil values across that segment:

I can calculate the average soil values for any given 1m slice, and I know the start and end depth of each slice, and the desired width (eg 30cm).

My question: How can I build the cylinders?

I presume these will need to be multipatches, but I can't see anything in the Esri documentation on how to create the multipatches. Ideally I'd like to script this in arcpy as I have thousands of boreholes to process.

• Are these 3D points with X,Y,Z values? Commented Oct 31, 2014 at 1:20
• I will elaborate a bit - it is possible to turn borehole logs (XYZ points) into 3D polylines. I wrote a sript a few years ago that did just that but it was with ArcObjects. Each group of points had a unique value and I just looped and constructed 3D lines using the points as ToPoint and FromPoint and asigned soil type to each line. Once complete I symbolized on soil type using the the 3D line symbol which is a "cylinder". You can convert the 3D symbolized lines to multipatch but it's not necessary. This is only a comment bc i would have to dig deep to find that sript or re-write from scratch Commented Oct 31, 2014 at 1:40
• @Jakub great suggestion, it worked really well. If you write the above comment as an answer, I'll accept it. Thanks Commented Oct 31, 2014 at 5:47

It is possible to turn borehole logs (XYZ points) into 3D polylines. I wrote a sript a few years ago that did just that but it was with ArcObjects. Each group of points had a unique value and I just looped and constructed 3D lines using the points as ToPoint and FromPoint and assigned soil type attribute to each line. Once complete I symbolized on soil type using the the 3D line symbol which is a "cylinder". You can convert the 3D symbolized lines to multipatch but it's not necessary. Hope this helps, I would have to dig deep to find that script or re-write from scratch. I also had an Exaggeration parameter in the script, this way i could exaggerate the boreholes but not the surface.

I found an image of the project where I used this approach. This was done with ArcGIS 9.3 (ArcView) + 3D Analyst:

• Thanks for the tips. Your screenshot looks great - do you remember what software you used to create that? Commented Nov 2, 2014 at 21:52
• I made all the 3D models in ArcScene (different bookedmarked views of the same model) and exported as 2D image and just brought everything together in Photoshop or it could have been Corel Paint back then. The north arrow, vertical scale, borehole labels are all ArcScene (extruded lines / polygons) the legend, coloured arrows were done in Photoshop. Commented Nov 3, 2014 at 19:18

Many thanks to @jakub for pointing me on the right track. I'm posting the Python code snippet that I used in case it helps anyone.

I looped through each borehole to find the XY coordinates, then looped through the soil readings to create 0.5m deep segments.

One tip is that it (seems to be) necessary to offset one of the vertices by a small amount to avoid generating a zero-length line. For each row:

``````point = json.loads(inRow[1].JSON)
x = point["x"]
y = point["y"]
z =inRow[2] #(elevation was stored as an attribute)
maxDepth = inRow[3] #Maximum depth of this borehole
bandDepth = 0.5 #Depth of each band/segment to create
numBands = int(round((maxDepth / bandDepth) + 0.5)) #number of bands to create
for band in range(0, numBands):

top = band * bandDepth
bottom = top + bandDepth
vertices = [[x, y, (z - top)], [x + 0.001, y + 0.001, (z - bottom)]]
pts = [arcpy.Point(*coords) for coords in vertices]
line = arcpy.Polyline(arcpy.Array(pts), sr, True)
``````