I too am having difficulty defining the subdivide settings using Python. I'm attempting to do a select by attribute followed by a subdivide - similarly to Jack de Valpine the code works with some subDivide settings defined, but when I add other settings (such as setSimplify) the code does not work. Does it matter what order settings are defined?
Here's my code - I must say I've only really worked with arcpy before and I'm finding this code a little alien:
def selectByAttribute(attr, value): objects = ce.getObjectsFrom(ce.scene) selection = [] for o in objects: attrvalue = ce.getAttribute(o, attr) if attrvalue == value: selection.append(o) ce.setSelection(selection) selectByAttribute("buildCat", "Residential") shapes = ce.getObjectsFrom(ce.selection()) divset = SubdivideShapesSettings() divset.setLotAreaMin(200) #divset.setIrregularity(0) #divset.setSimplify(1) #divset.setLotSubdivisionMethod("SKELETON") ce.subdivideShapes(shapes, divset)
ce.subdivideShapes(name, subds)
def subdBlock(name): ... ce.subdivideShapes(name, subds)
def subdBlock(shapes): ... ce.subdivideShapes(shapes, subds)
shapes = ce.selection()[0] ## the first object in the selection subdBlock(shapes)
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.