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)
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)
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.