Select to view content in your preferred language

Using layer.extrusion in a Python script

2555
10
Jump to solution
11-01-2022 07:11 PM
clc
by
Regular Contributor

I am developing a Python script tool to transform a 2D feature class into a multipatch.

Right now, I have to split the script into 2 scripts and manually do the extrusion, because I cannot figure out how to make the extrusion based on a field. I could apply a fixed extrusion by writing:

expression = "5"
lyr.extrusion("BASE_HEIGHT", expression)
But I would like a extrusion based on one of the field of my feature class (and also set the unit as it is possible in the Feature Layer Tab in Pro). I tried (among other combinations):
expression = "!Extrusion_ft! / 3.28084"
lyr.extrusion("BASE_HEIGHT", expression)
The script runs without error but no extrusion...
Thanks for any help.
 
 
Tags (1)
0 Kudos
10 Replies
WilliamLee
New Contributor

I have been looking for a solution like this for quite some time. Thank you @AnonymousUser23 and @clc for sharing your code and solutions. The [isFlattened = "false"] was also key in my testing. Thank you both!

0 Kudos