|
POST
|
Hey Matthias, As I reread the question, this is the far superior answer as it achieves the expected goal. Kristian, when I gave my answer I realized it sounded like I precluded the ability to import rules from other projects because I stated you should move the assets folder if you want to create a self contained project (I only suggested that because sometimes it is easy to forget). Please follow the instructions Matthias provide on importing rules with relative paths to other projects. I will say relative paths from the project folder are at least best practice, with common references in the documentation for some path functions * for asset paths. That said, I think Matthias might have to clarify absolute paths in CityEngine. Matthias, when I try the following for the lanes folder (All Forward Slash because \ common to windows is not recognized), the rule does not seem to find assets paths when they are absolute. This is the case if I put "/C:" or C: is removed along with other path components past CE install workspace as well. *Edit: Based on the response below, using an absolute path based on the computer's root directory will never work in CityEngine. *Edit: In CityEngine the example below would be an absolute path because it is relative to the CityEngine root directory. I previously mentioned it as a relative path. -Absolute Paths- relative to CE Root directory and is project name dependent, if used for modular referencing it is assumed the project exists and its name space won't change. Have a / in front of them. This is how Esri.lib works for example. EX: /Complete_Street_Rule/assets/.... -Relative Paths- relative to the project folder's rule directory. - EX "Complete_Streets" Is there a correct way to use absolute paths in CGA? Can you elaborate? David
... View more
10-10-2016
06:44 AM
|
1
|
2
|
4827
|
|
POST
|
Hey Kristian, So what you are hinting at is actually really complicated and detailed matter for the CityEngine Team. First Why Python: Python can help you control global variables of your scene and your data in ways you could not with just CGA alone. This means adjusting camera angles and rule parameters based on data dynamically such as what is done in this video (you can find the code here), or even splitting parcels appropriately for Transit Oriented Development simulations (seen here). I have used python in CityEngine to batch render and export thousands of 3D street cross sections for multimodal planning projects where we wanted to visualize baseline conditions right next to improvements. It can be incredibly useful. The python script below as an example batch exports every layer in the CityEngine Scene to KML, which is useful if you have a lot of time layers you want to see in Google Earth or ArcGIS Earth. In terms of the problem at hand, you are touching on something that is a known limitation of CGA. CGA is a hierarchical rules based language, and as a result as you create new leafs in CGA (new leafs being new subdivided shapes) those shapes CANNOT communicate with previous shapes or shapes in other parts of the rule. This was a hard limitation for the Complete Street Rule, which had to make choices about which shapes take up scarce geometry on the road in the rule. To allocate shapes in that rule, I to precalculate street widths with functions GLOBALLY rather than have the resulting shapes send important information to other shapes (my bike lanes don't know how large their buffers are, but some global function declared before the first leaf can pass that information onto them). Python and smart math can get past this limitation in some cases, but other cases would require CGA shapes to be able to "talk" to each other. This is being talked about within the CE community, but so far we are just finding other ways around it. Cheryl Lau might have more to add on that point. # --------------------------------
# Name: CEBatchWebSceneExport.py
# Purpose: Batch export of CE layers to web scenes.
# Current Owner: David Wasserman
# Last Modified: 12/22/2015
# Copyright: (c) Co-Adaptive
# CityEngine Vs: 2015.2
# Python Version: 2.7
# License
# Copyright 2015 David J. Wasserman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# --------------------------------
# Import Modules
from scripting import *
# get a CityEngine instance
ce = CE()
outputFolder = "/BatchExport"
generateBoolean = False
deleteBoolean = False
# Turn off User Interface updates, or script might take forever.
@noUIupdate
def main():
# This function will export in batch web scenes to the input outputFolder
layers = ce.getObjectsFrom(ce.scene, ce.isLayer)
print("There are " + str(len(layers)) + " layers in the current scene.")
counter = 0
for layer in layers:
try:
ce.setSelection(layer)
OID = ce.getOID(layer)
layerName = ce.getName(layer)
if generateBoolean:
# generate models on selected shapes (assumes size of file is too big)
ce.generateModels(ce.selection())
ce.waitForUIIdle()
print ("Setting export settings for layer named: " + str(layerName))
exportSettings = KMLExportModelSettings()
exportSettings.setOutputPath(ce.toFSPath("models") + str(outputFolder))
exportSettings.setBaseName(layerName)
exportSettings.setCompression(False)
exportSettings.setTerrainLayers(exportSettings.TERRAIN_NONE)
ce.export(ce.selection()[0], exportSettings)
print ("Exported layer named: " + str(layerName) + "to models/BatchExport3WS")
counter += 1
if deleteBoolean:
ce.delete(ce.selection())
pass
print("Exported web scene for layer named:" + str(layerName))
# Change this to an absolute path that points to your KML files.
except:
print("Could not execute on counter " + str(counter))
counter += 1
pass
# Call
if __name__ == '__main__':
print("Batch Layer script started.")
main()
print("Script completed.")
... View more
10-07-2016
05:54 PM
|
2
|
2
|
3613
|
|
POST
|
While this is helpful to know, I am not sure I used those tools in these tool boxes BUT I did use the line geometry class extensively. Could that also be an issue?
... View more
10-06-2016
04:36 PM
|
0
|
3
|
1983
|
|
POST
|
You can also just draw streets using the editing tools if using the centerlines is too much of a hassle. I sometimes do this for small scenes.
... View more
09-19-2016
06:44 PM
|
1
|
1
|
1194
|
|
POST
|
Are you applying this to CAD Polygons? The complete street as it stands now only operates on centerlines (Street Graphs). A maintained version of the rule is here too: GitHub - Holisticnature/Complete_Street_Rule: This is an updated repository for a modified version of the ESRI Complete …
... View more
09-19-2016
12:07 PM
|
1
|
3
|
1194
|
|
DOC
|
I have a download link marked visibly, but I will think about it. I largely don't want to maintain it in two places. =(
... View more
09-18-2016
08:21 PM
|
0
|
0
|
2264
|
|
DOC
|
Chained Near Analysis This tool will conduct a near analysis that will add a new field for every Near Feature input into the Input Features dataset. Unlike Near, this tool will create a column wise set of Near fields for every Near Feature rather than using the closest of all the near features input into the tool. This results in many more fields, so use this only if you have a specific need to know proximity for every feature within the Input Feature class. Consider a Near Table if you want more detailed proximity information and are comfortable with a higher number of records (many to one). I largely made this quick script to associate multiple feature classes proximity with the input feature classes very quickly. I usually use long model builder models for this task that are annoying to build. Thought I would share it. Example Output Links Download Github Page: GitHub - d-wasserman/proximity-analysis: This tool will conduct a chained near analysis creating multiple near proximity…
... View more
09-18-2016
04:46 PM
|
1
|
5
|
3427
|
|
DOC
|
I sent you an invite on linked in, I will send you my email over a message and we can discuss citation. I basically just would like to be cited by name. In terms of your error, I am unable to replicate the issue. I end up with a 108 MB rpk. Is your error that it won't even work? What version of CityEngine are you using?
... View more
09-01-2016
10:02 PM
|
0
|
0
|
45069
|
|
POST
|
I understand that. That said, they pay attention to the activity on Geonet, so I am just trying to add to the attention to this limitation. Animations/DDP/Mosaic Integration as they stand are not great, but I know they will work on it.
... View more
08-27-2016
12:14 PM
|
0
|
1
|
1938
|
|
POST
|
I have the same question. This is a huge loss in functionality because I recently found out the animation tools do not support layout view exports. This makes pro's promise for animations really and severally limited. https://community.esri.com/ideas/12481
... View more
08-27-2016
11:03 AM
|
1
|
3
|
1938
|
|
POST
|
Workflow Outline is based on a reply from Chris Wilkins. First, you cannot directly use procedural symbols in a web scene. You must use FFCER or L3D2FC GP tools, to bake (or cook) geometry to a multipatch feature class (or layer). Then with that MP layer, you must use create and share using SPK (scene layer package). This is only because it is 3D. Start here: Layer 3D To Feature Class—Help | ArcGIS for Desktop and http://pro.arcgis.com/en/pro-app/help/sharing/overview/scene-layer-package.htm Which leads you to this GP tool: http://pro.arcgis.com/en/pro-app/tool-reference/data-management/create-scene-layer-package.htm And then you must use Share Package GP tool: http://pro.arcgis.com/en/pro-app/tool-reference/data-management/share-package.htm THEN, you must go to AGOL to hit the share/publish button. THEN, you must create a web scene and add the scene layer.
... View more
08-24-2016
11:48 AM
|
3
|
0
|
1399
|
|
POST
|
I recently asked a question to a pro expert about some issues I was having exporting procedural symbols to Web Scene, and the answer is you cannot export procedural symbols to webscene, you first must bake the geometry. See Answer below.
... View more
08-24-2016
11:47 AM
|
0
|
1
|
2459
|
|
POST
|
Can you verify if there are any raster environment settings that break Add Raster to Mosaic? I have had some issues with raster masks/processings extents and was curious if this is a known issue. What settings are known to be troublesome?
... View more
08-18-2016
10:05 AM
|
0
|
0
|
1031
|
|
IDEA
|
The new tools for animations for Pro are an improvement, but not enough to make dynamic infographics and animations that convey complex information. For example, my work trying to get animations involving time cannot show what time period each frame is showing, a legend, or any other meaningful information without some type of labeling hack. This makes the whole experience of trying to getting a useful animation out very difficult without some post processing in some other software package or using data driven pages to make a GIF/mp4 in some other software product. Using Layout view for animations is a key next step for enabling more use cases beyond fly throughs.
... View more
08-18-2016
08:59 AM
|
26
|
9
|
8086
|
|
POST
|
If you don't care about reporting, you could literally put the bike lane rule where the bus lane rule is. You could also just make a redirect option for the transit lanes to a bike lane rule. That would not take a lot of code. I will think about how to support this in the future. I did an exception for sidewalk side bike lanes, so this is not that much of a stretch until I have to implement all the exceptions for its impacts on performance metrics...
... View more
08-17-2016
09:32 PM
|
1
|
0
|
2223
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-07-2024 02:16 PM | |
| 1 | 05-15-2022 12:21 PM | |
| 1 | 08-27-2016 11:03 AM | |
| 1 | 12-19-2021 01:10 PM | |
| 1 | 06-12-2020 03:29 PM |