IDEA
|
In some cases, we need to lock graph node or graph segment from being edited where editing means: attribute changes or geometrical changes ce.setLocked( graphNodeObj, ATTRIBUTE|GEOMETRY)
ce.setLocked( list_of_graph_nodes, ATTRIBUTE|GEOMETRY)
ce.setLocked( list_of_graph_segments, ATTRIBUTE|GEOMETRY)
ce.setLocked( list_of_graph_nodes_and_graph_segments, ATTRIBUTE|GEOMETRY)
ce.setUnlocked( graphNodeObj, ATTRIBUTE|GEOMETRY)
ce.setUnlocked( list_of_graph_nodes, ATTRIBUTE|GEOMETRY)
ce.setUnlocked( list_of_graph_segments, ATTRIBUTE|GEOMETRY)
ce.setUnlocked( list_of_graph_nodes_and_graph_segments, ATTRIBUTE|GEOMETRY)
... View more
08-15-2017
06:46 AM
|
0
|
0
|
251
|
IDEA
|
In order to improve graph network elevation, it is often needed to insert a graph node to an existing graph segment. ce.addGraphNodeToGraphSegment( myGraphSegment, ( x, y, z ) )
ce.deleteGraphNodeFromGraphSegment( myGraphSegment, myGraphNode )
... View more
08-15-2017
06:08 AM
|
0
|
0
|
507
|
IDEA
|
The concept of a checksum is based on object's property and would be returned as string, is same way python does it with hash(object) or class.__hash__() for instance: - its attributes ( key - pair ) - its geometry where OID value would not be considered, since the OID value is always unique. This would allow to compare two graph elements in two graph layers, for example if ce.computeChecksum( graphNodeFromLayer1 ) == \
ce.computeChecksum( graphNodeFromLayer2 ):
print 'Yikes'
... View more
08-15-2017
06:04 AM
|
0
|
0
|
221
|
IDEA
|
If there was a way to quickly determine what are the graph nodes and graph segments withing a given distance, irrespective of connectivity. Proposed Workflow 1) Create a Spatial Query Object spatialQuery = ce.createSpatialQuery()
2) Add Objects to Spatial Query spatialQuery.addItems( list_of_graph_nodes )
spatialQuery.addItems( list_of_graph_segments )
spatialQuery.addItems( list_of_graph_layers )
3) Parameterize Spatial Query spatialQuery.setDistance( float )
spatialQuery.setExtents( minx = None , # determine by distance
miny = -10 ,
minz = None , # determine by distance
maxx = None , # determine by distance
maxy = 10 ,
maxz = None ) # determine by distance
spatialQuery.setFilters( ce.isGraphNode, ce.isGraphSegment )
spatialQuery.setMaxItems( 10 ) 4) Execute Query resultList = spatialQuery.execute( x, y, z )
or
resultList = spatialQuery.execute( aGraphNodeInstance )
or
resultList = spatialQuery.execute( aGraphNodeSegment )
print len( [ ce.isGraphNode( x ) for x in resultList ] ), 'Graph Nodes'
print len( [ ce.isGraphSegment( x ) for x in resultList ] ), 'Graph Segments'
> 40 Graph Nodes
> 34 Graph Segments
# the output is sorted by distance, closest to farest
# closest to queried coord/element
print resultList[0]
# farest to queried coord/element
print resultList[-1] 5) if a graphSegment is passed as query location, we could potentially have a mode where it uses its associat. ed graph nodes as query location, or use its centroid, where this decision could be controlled by a spatial query execution argument 6) if a list of elements is passed ( graph nodes, graph segments or tuple[3] ), the centroid position of all elements would be considered.
... View more
08-15-2017
06:00 AM
|
0
|
0
|
271
|
IDEA
|
It would be great to have control over View3D instance, where I could enable and disable some of the viewport settings such as AO, Shadow, Grid on/off, Texture mode, shadow mode, etc. Currently the only way to control this is by having viewports already created and configured into .cej scene file, and use it as starting point, hoping the user will not change any viewport settings before the script is being executed.
... View more
08-15-2017
05:45 AM
|
0
|
0
|
215
|
IDEA
|
It would be great to be able to organize menu items using sub-menus for instance possible menu definition argument
1) ( 'subMenu1', 'subMenu2', 'MenuItemName' )
2) 'subMenu1:subMenu2:MenuItemName'
ce.addScriptMenuItem( fileSystemPath, menuDefinition )
print ce.listScriptMenuItems()
as dict
> { menuDefinition : fileSystemPath }
as list of tuple
> [ ( menuDefinition , fileSystemPath ) ]
... View more
08-15-2017
05:30 AM
|
0
|
0
|
192
|
IDEA
|
Thanks Thomas, I see how it can be achieved. I guess my explanation weren't really detailed enough. I want to isolate material, texture, geometry generation into rule libraries, and be able to re-use it, by passing it as an argument to another rule. I hope it make sense with the code example below. generateWindowLayout( param1, param2 ) -->
...
generateWindowFrame ( param3, param4 ) -->
...
setMaterialAsGlass -->
...
generateModel( windowLayerRule ,
windowFrameRule ,
materialRule ) -->
windowLayerRule( 1,2 )
windowFrameRule( 3,4 )
materialRule
generateModel( generateWindowLayout,
generateWindowFrame ,
setMaterialAsGlass )
... View more
08-07-2017
05:25 AM
|
0
|
1
|
465
|
IDEA
|
in CityEngine, there is a way to move a Graph Node over another graph Node and it would combine the two graph nodes into one. if you use the python interface using ce.move(), the two points will not be merged like it does in the user interface. ce.move( [ list_of_graph_nodes ], merge = True, mergeDistance = 0.1 ) Moreover, if you have a GraphNode with N Adjacent Graph Segments, it would help to be able to break that Graph Node intro 1 Graph Node per adjacent Graph Segment. The end result would appear like all graph segments are independent and no longer linked ce.detachGraphNodes( list_of_graph_nodes )
... View more
08-03-2017
07:37 AM
|
0
|
0
|
257
|
IDEA
|
Currently it is not possible to pass rule as an Argument this is quite needed for materials and uvs, since the rule being executed is for the geometry, and the material and texture are being executed after. It allows to generate window with different materials, and make the code quite clean as well.
... View more
08-03-2017
07:32 AM
|
0
|
4
|
667
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|