<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SubdivideShapesSettings - setLotSubdivisionMethod in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/subdivideshapessettings-setlotsubdivisionmethod/m-p/412066#M5635</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Andreas,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the follow-up!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The argument &amp;lt;name&amp;gt; that is being passed to the function is a shape. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The issue that I noticed is that several of the shape settings do not seem to work/exist, eg setCornerAlignment, setSeed, setShallowLotFrac, setSimplify, setLotSubdivisionMethod. These class methods are all listed in the on-line documentation so it is puzzling. I did discover that there is a method: setSubdivisionOffset which is really what I thought I wanted out of setLotSubdivisionMethod. So I do have a scripted block subdivision working (note this is for static imported block shapes).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Jack&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Nov 2011 17:01:58 GMT</pubDate>
    <dc:creator>Jackde_Valpine</dc:creator>
    <dc:date>2011-11-17T17:01:58Z</dc:date>
    <item>
      <title>SubdivideShapesSettings - setLotSubdivisionMethod</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/subdivideshapessettings-setlotsubdivisionmethod/m-p/412064#M5633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am working on a python script that subdivides blocks (imported) based on some different parameters. To set the parameters I am using the SubdivideShapeSettings methods. Some of these class methods do not appear to exist, such as setLotSubdivisionMethod? Following is the function that I have defined:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]def subdBlock(name):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subds = SubdivideShapesSettings()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp; subds.setCornerAlignment('STREET_LENGTH')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subds.setCornerAngleMax(90.0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subds.setCornerWidth(0.0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subds.setForceStreetAccess(0.0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subds.setIrregularity(0.3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subds.setLotAreaMax(1500.0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subds.setLotAreaMin(500.0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subds.setLotElevation("EVEN_MIN")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subds.setLotMinWidth(10.0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subds.setSubdivisionRecursive("True")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subds.setOffsetWidth(25.0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp; subds.setSeed(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp; subds.setShallowLotFrac(1.0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp; subds.setSimplify(4.0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp; subds.setLotSubdivisionMethod("OFFSET")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ce.subdivideShapes(name, subds)[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The commented items generate errors when I try to include them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am running CityEngine 2010.3 build 0124 (release, win32-64bit).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Jack de Valpine&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PS, Note I have tried to see if this has been addressed in the forum archives. However, I am relatively new to City Engine, so if this is FAQ or otherwise documented somewhere please point me in the right direction!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 13:37:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/subdivideshapessettings-setlotsubdivisionmethod/m-p/412064#M5633</guid>
      <dc:creator>Jackde_Valpine</dc:creator>
      <dc:date>2011-11-14T13:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: SubdivideShapesSettings - setLotSubdivisionMethod</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/subdivideshapessettings-setlotsubdivisionmethod/m-p/412065#M5634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;not fully sure what you mean by&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"The commented items generate errors when I try to include them."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;does that mean when executing the script, or even before?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The script you sent parses fine for me. One thing that could be unclear:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you are calling the subdivide function with the param name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ce.subdivideShapes(name, subds)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;how does your function call look like? are you calling subdBlock(name) with name being a string name (e.g. "MyShape")? That would not work. You need to put a list of shapes as parameter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I recommend to rename&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def subdBlock(name):
&amp;nbsp; ...
&amp;nbsp; ce.subdivideShapes(name, subds)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def subdBlock(shapes):
&amp;nbsp; ...
&amp;nbsp; ce.subdivideShapes(shapes, subds)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and calling it for example with&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;shapes = ce.selection()[0]&amp;nbsp; ## the first object in the selection
subdBlock(shapes)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;assuming you have a shape selected.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:42:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/subdivideshapessettings-setlotsubdivisionmethod/m-p/412065#M5634</guid>
      <dc:creator>AndreasUlmer</dc:creator>
      <dc:date>2021-12-11T18:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: SubdivideShapesSettings - setLotSubdivisionMethod</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/subdivideshapessettings-setlotsubdivisionmethod/m-p/412066#M5635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Andreas,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the follow-up!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The argument &amp;lt;name&amp;gt; that is being passed to the function is a shape. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The issue that I noticed is that several of the shape settings do not seem to work/exist, eg setCornerAlignment, setSeed, setShallowLotFrac, setSimplify, setLotSubdivisionMethod. These class methods are all listed in the on-line documentation so it is puzzling. I did discover that there is a method: setSubdivisionOffset which is really what I thought I wanted out of setLotSubdivisionMethod. So I do have a scripted block subdivision working (note this is for static imported block shapes).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Jack&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 17:01:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/subdivideshapessettings-setlotsubdivisionmethod/m-p/412066#M5635</guid>
      <dc:creator>Jackde_Valpine</dc:creator>
      <dc:date>2011-11-17T17:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: SubdivideShapesSettings - setLotSubdivisionMethod</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/subdivideshapessettings-setlotsubdivisionmethod/m-p/412067#M5636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I too am having difficulty defining the subdivide settings using Python.&amp;nbsp; 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.&amp;nbsp; Does it matter what order settings are defined?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my code - I must say I've only really worked with arcpy before and I'm finding this code a little alien:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14163196868497156" jivemacro_uid="_14163196868497156"&gt;
&lt;P&gt;def selectByAttribute(attr, value):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objects = ce.getObjectsFrom(ce.scene)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; selection = []&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for o in objects:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attrvalue = ce.getAttribute(o, attr)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if attrvalue == value:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selection.append(o)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ce.setSelection(selection)&lt;/P&gt;
&lt;P&gt;selectByAttribute("buildCat", "Residential")&lt;/P&gt;
&lt;P&gt;shapes = ce.getObjectsFrom(ce.selection())&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;divset = SubdivideShapesSettings()&lt;/P&gt;
&lt;P&gt;divset.setLotAreaMin(200)&lt;/P&gt;
&lt;P&gt;#divset.setIrregularity(0)&lt;/P&gt;
&lt;P&gt;#divset.setSimplify(1)&lt;/P&gt;
&lt;P&gt;#divset.setLotSubdivisionMethod("SKELETON")&lt;/P&gt;
&lt;P&gt;ce.subdivideShapes(shapes, divset)&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 14:09:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/subdivideshapessettings-setlotsubdivisionmethod/m-p/412067#M5636</guid>
      <dc:creator>BenLeslie1</dc:creator>
      <dc:date>2014-11-18T14:09:54Z</dc:date>
    </item>
  </channel>
</rss>

