Select Continuous Graph Objects in Python

452
4
Jump to solution
10-29-2013 10:54 AM
ginoorgologo
New Contributor
Hi,
related to my previous thread in General Discussion
Is there a way to use the Continuous Graph Objects selection method via the python console?

In case that is not implemented I was thinking of some like:

  • select every street graph with isGraph

  • getVertices to check which ones have vertices in common

  • setSelection on every connected shapes

  • create a list of those in order to act separately on each group...

Am I going down a blind alley? :confused:

thanks in advance,
gino
Tags (3)
0 Kudos
1 Solution

Accepted Solutions
AndreasUlmer
Esri Contributor
you can use a layer as the first argument in getObjectsFrom.


layers = ce.getObjectsFrom(ce.scene, ce.isLayer, ce.withName("'Layer_Name'")  # the above returns a list of layers. typically there's only one with this name, so get first entry of list layer = layers[0]   allObjectsInLayer = ce.getObjectsFrom(layer)  # you can use filters as well when getting objects from layer instead of scene shapesInLayer = ce.getObjectsFrom(layer, ce.isShape) 

View solution in original post

0 Kudos
4 Replies
MatthiasBuehler1
Frequent Contributor II
Hi,

sorry, missed that thread.

there's no python method to do this available. would be a good thing though.

in 2013, you'll be able to better query selections of street connections, so that may be worth looking into.

currently, you can only try to work with getting the node coordinates and work around the missing tool.

ok ?

m.
0 Kudos
ginoorgologo
New Contributor
thanks Matt, your replies are very useful - as usual.

I found a way around to the problem itself importing my geometries in different layers.
so now I am trying to select a shape in a given Layer.. is it possible?
I was thinking of something like:

[INDENT]shapes = ce.getObjectsFrom(ce.scene, **ce.inLayer("Layer_Name")** )
[/INDENT]


I am not used to scripting in general, so every time I face a problem I change the initial condition to avoid it... but I guess the problem is my lack in jython :p

gino
0 Kudos
AndreasUlmer
Esri Contributor
you can use a layer as the first argument in getObjectsFrom.


layers = ce.getObjectsFrom(ce.scene, ce.isLayer, ce.withName("'Layer_Name'")  # the above returns a list of layers. typically there's only one with this name, so get first entry of list layer = layers[0]   allObjectsInLayer = ce.getObjectsFrom(layer)  # you can use filters as well when getting objects from layer instead of scene shapesInLayer = ce.getObjectsFrom(layer, ce.isShape) 
0 Kudos
ginoorgologo
New Contributor
Thanks andreas! That's what I was looking for.
0 Kudos