How to subdivide shapes(blocks) using CGA or python code?

574
2
Jump to solution
09-19-2022 06:44 AM
Vita_Vonanli
New Contributor II

Hi, I'm curious about how to subdivide an input 2D initial shape using CCA rule or python script?

I''ve seen many solutions about using split or splitArea to complete this, but there is a problem: the initial shape is still ONE object and cannot report informations about every subdivided lots respectively.

That means, I want the splitted lots be independent and can be assigned CGA rules respectively,  I think that is the same as the Shapes-Subdivide function in CityEngine menu bar,  but can I get them using CGA?

 

Here are some pictures to illustrate——

What 'split' function gets:

Vita_Vonanli_0-1663594442447.png

Vita_Vonanli_1-1663594471635.png

(only the initial shape can be selected)

What I want:

Vita_Vonanli_3-1663594579646.png

(only one object is selected)

Very need your help! Thanks!

0 Kudos
1 Solution

Accepted Solutions
JonasObertuefer
Esri Contributor

Hi @Vita_Vonanli,

There is no Shapes-Subdivide functionality in CGA but you can apply it to a shape using python and then assign your rule onto the created shapes again by python or via ui.

For more information check the python docs:

Hope this helps!

Best,
Jonas

View solution in original post

0 Kudos
2 Replies
JonasObertuefer
Esri Contributor

Hi @Vita_Vonanli,

There is no Shapes-Subdivide functionality in CGA but you can apply it to a shape using python and then assign your rule onto the created shapes again by python or via ui.

For more information check the python docs:

Hope this helps!

Best,
Jonas

0 Kudos
Vita_Vonanli
New Contributor II

Thanks a lot for your suggestion Jonas! Using Python script in CE is a little difficult for me but I will try my best!

0 Kudos